My Software consists of several modules. Each window of a single module can be opened directly via commandline argument e.g. “program.exe module1” opens module1. If no commandline argument is passed, the app starts regulary and shows me a list of available modules.
This runs pretty well but the apps’ icon remains the same. I would like to switch this icon depending on the chosen module. In case of module1 is opened I would like to use Icon1 as app icon, in case of module2 Icon2 and so on.
My Question:
How can I switch App Icons (in all its different sizes 16px,32px, 128px, 512px) within code?
[quote=116552:@Tomas Jakobs]My Software consists of several modules. Each window of a single module can be opened directly via commandline argument e.g. “program.exe module1” opens module1. If no commandline argument is passed, the app starts regulary and shows me a list of available modules.
This runs pretty well but the apps’ icon remains the same. I would like to switch this icon depending on the chosen module. In case of module1 is opened I would like to use Icon1 as app icon, in case of module2 Icon2 and so on.
My Question:
How can I switch App Icons (in all its different sizes 16px,32px, 128px, 512px) within code?[/quote]
Application icon management is very much tied to the system. I provided you with a Windows method because you mentioned ‘program.exe’. For Mac OS X, look into DockItem http://documentation.xojo.com/index.php/DockItem
A true cross platform solution can be achieved if instead of having one application with changing icons, you created several programs, each with its own icon, and managed that with a central application that launches each module.
the latest xojo 2.1 release shows an new example file “Platform-Specific/Windows/SetWindowIcon” how to change icon by code.
it’s still not a cross-platform but it shows a way for windows user.