EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Check if a Icon is installed

Posted: 08/02/2012 04:29:49
by Christopher Lenz (Basic support level)
Joined: 07/25/2012
Posts: 16


is there an inhouse function to check if an icon is installed?
First I hoped while calling InstallIcon I get a false return for restartRequired...
Theb I hoped while calling SetIcon I get an exception or so, but still no solution...

Is the only way to open the registry and iterate all keys to find the corresponding?

I want to check every start if the correct icon which I want to set is installed.

Posted: 08/02/2012 05:03:16
by Vladimir Cherniga (Team)

these functions returns false in the case of error. InstallIcon requires restarting system shell in any case. Install icon is made by changing registry settings and process of loading the icon is delayed until shell restart. So it does require restart current user logon session, that can be made by restarting explorer.exe process or restarting system/session.
Posted: 08/02/2012 05:09:46
by Christopher Lenz (Basic support level)
Joined: 07/25/2012
Posts: 16

okay. I know that I have to restart the system but how can I detect that an icon is installed?
I want to detect this with my program and not with my eyes?!?
Posted: 08/02/2012 05:25:21
by Vladimir Cherniga (Team)

Check boolean value returned from InstallIcon.
Posted: 08/02/2012 05:46:09
by Christopher Lenz (Basic support level)
Joined: 07/25/2012
Posts: 16

this is everytime true
Posted: 08/02/2012 06:28:47
by Vladimir Cherniga (Team)

From the system side, all icon images are added in to the global system image list. So the only way to check if it was added is checking this list. It does require shell interface functions manipulation (try something like SHGetIconOverlayIndex, etc). I should note also that SetIcon api send information about icon to the target storage driver, and when system tries to show that icon, we check this information interactively with a storage driver from the dedicated thread in our shell extension dll. The question is what exectly do you want to check. If you just want to enumerate registry entries created with InstallIcon we can make this by adding interface function with IconId as an input parameter.
Posted: 08/30/2012 03:25:29
by Christopher Lenz (Basic support level)
Joined: 07/25/2012
Posts: 16

I want to check if the Icon which I want to set is installed.
Something like that:

if (!CallbackFileSystem.IconInstalled("1"))
    CallbackFileSystem.InstallIcon("C:\\my.ico", "1", ref restartRequired);

Posted: 08/30/2012 04:11:00
by Vladimir Cherniga (Team)

In the current implementation we first uninstall icon silently from CallbackFileSystem.InstallIcon(), if the same iconId already exist. Then add new installation. But we may add requested functionality in the next release.



Topic viewed 1562 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!