How to change desktop/folders Icons size programmatically C# - c#

I'm developing a WPF that needs to make desktop icons and folder icons bigger while the WPF is active
and returns them to their previous state when closing the WPF
basically I want to be able to control the following options programmatically:
Folders icons :
desktop icons:
also how to change folder option to single click mode :

Folder icon settings are often per-folder and you will have a hard time forcing your preferences on them. You can probably find some descriptions of the registry locations and format if you search the internet for "shellbags" but this puts you in undocumented territory.
The desktop icon mode can probably be changed by undocumented/hacky means but you should just let the user do it.
You might be able to change the double-click mode by playing with fDoubleClickInWebView and SHGetSetSettings.

Related

When creating a custom file extension, is it possible to assign it an icon different from the application icon?

Hello wonderful people!
I have created some code for an application which upon startup, simply makes sure the registry has a key for my own file extension (or I guess 'class', as Windows calls it). It allows me to double-click a file with said extension and have it open with my program. Simple.
My query is this; is it possible for me to change the icon for this file class, to be different from the icon of my application? I would prefer to have some different icons for the various file extensions I'm registering, much in the same way that Photoshop for example gives a different icon for .PSD files than the actual application icon.
In simpler terms, I would like to mimic this behaviour but with my own icons and application:
Photoshop (the actual application):
Photoshop Document file:
I am working in C# and WPF. And I should also specify that the solution I'm looking for should be able to work in a scenario where I was to send my application to someone else to install on their computer; they should be able to see all the icons as described. I'd kindly request that in your answers you provide code examples, as I am not particularly familiar with working directly with the registry.
I should also specify that my application does have an icon, and this is currently what the custom filetype displays in Windows Explorer.

How to set a little icon on files under windows?

i would to set dynamically a little icon on the files (maybe on folders too) that i lock with my app.
I saw it with google app for synchronize, a little "refresh icon" appears to symbolize they are in synchronization, and i want make the same thing with my app that lock temporarely files to prevent changement meanwhile it works on it.
I Imagine it must use c++ api for Windows ?
It needs to change all the icon or with windows 10 you can add by a layer another icon ?
How to change dynamically an icon files ?
thanks.
Informations:
Environnement: Windows10.
Target: Files icon.
Language: c#, maybe
c++ api windows.
You can assign icons to the members of the file type by implementing
an icon handler. An icon handler is a type of Shell extension handler
that allows you to dynamically assign icons to the members of a file
type.
Refer to "How to Create Icon Handlers".
Similar topic: "How to create a IconHandler used by the shell in c++?"

Force combinig icons on taskbar for windows form applications (C#)

I have a problem with combining icons for instances of my application in taskbar.
For some users it combines without any problems and others see new button in taskbar for every instance of my windows forms application opened (although they have "always combine" in taskbar settings).
Is there a way to force combining icons of my application programatically? What property decides that windows recognizes instances of my application as similar or not?
As I understand it it's based on the weather the additional "things" are spawned as a process from the same executable.
I don't think there's a way you can enforce this grouping behaviour. But you could ensure clients have the start menu property set to combine buttons by Group Policy. In:
User Configuration\Administrative Templates\Start Menu and Taskbar\Prevent grouping of taskbar items
Source link for Group Policy settings: https://technet.microsoft.com/en-gb/library/ee617162%28v=ws.10%29.aspx

Taskbar icon looks pixelated using ClickOnce

When I run my wpf application in debug mode, the icon on the taskbar looks fine (left image), but after I published and open the application, the icon looks pixelated (right image).
I've referred to this link and I set the icon image to 256x256, but still looks pixelated.
Please help.
try using an ico editor to save the icon with all the correct resolutions (the OS will display the correct one). I use icofx, but there are many options if you google it - they should all correct your image proportions. Most should have an equivalent option to the 'save windows icon' (in icofx) where you select all the resolutions you want to add to the file.
Just another thought - is you icon a resource file? If so you may need to remove it then add it again and make sure the resource is set to publish correctly (so you are not using an old version).

How can I use FileOpenPicker to browse my install folder?

I am building a C# Windows Store app and I want to include a few image files with it for the app background. I want to let the user pick one of these images for the app background or pick from their own pictures. The FileOpenPicker.SuggestedStartLocation is only useful for picking from a predefined set of start locations. FilePicker contracts are too complex, include extra UI that appears within the file picker page, and let other apps get to my image files when they really should not have that access.
The only viable alternative so far is to create my own file picker page that looks close to the built-in page, but this is an ugly solution to what should not be this hard.
The best way is to devise your own. Load your included images into a selectable GridView or such and add another button or a specific tile to let the user pick from elsewhere. I wouldn't try to make the basic functionality look like the file picker.
Neither the app's install location or app data folders are intended to be user data, so there isn't an in-box way to pick from them. Advanced users can point the FileOpenPicker at those locations, but there is nothing like SuggestedStartLocations to guide the user there.

Categories