Reputation: 37278
I'm trying to use winapi methods to modify an exe.
I don't know how to do it by hand either so that would be a good start if someone can share that with me then i can try to programatically acheive it.
Basically have this exe: "C:\Program Files (x86)\Mozilla Firefox\firefox.exe". I copied and pasted it to: "C:\Program Files (x86)\Mozilla Firefox\SecondFirefox.exe"
I don't want to make it a shortcut because I get some weird separation issues on the taskbar.
I want to make "SecondFirefox.exe" launch with default command line arguments of -P "Dev" -no-remote
, is this possible?
Thanks
Upvotes: 7
Views: 14857
Reputation: 1857
This will not answer your question on how to do it but it should give you a clue about what is going on
Windows use what is called Application ID
which is an attribute for windows
,processes
and shortcuts
.
Using this ID
Windows is able to determine how taskbar buttons are associated with windows and applications and how the system decides whether an application needs two taskbar buttons for its different windows or whether multiple applications need to share a single taskbar button.
But these IDs
can be customized by the applications which means that the application still can specify whether two windows share the same icon or not
I create a small executable then I duplicate it and start them together, the result is each one has its own icon.
But this were not the case with firefox
when I duplicate the executable
It is likely that firefox is altering the Application IDs
of all running instances to one application ID and that is why all firefox
taskbar icons are combined.
with that being said even if you tried to build it on your own, it is not easy to do.
I don't know for sure because I don't want to read the source code but you can still check out if that is Right.
Check out this link for more information about taskbar API
Upvotes: 3
Reputation: 613302
Making a copy of the executable seems like a poor idea. Why should you have two copies of the same thing.
I'd make a launcher program. A very simple program that did nothing more than launch the original executable using the modified command line.
Upvotes: 3