views:

339

answers:

2

We have an application that has a "launcher" app that sits there with a pretty UI while the main app loads in the background. Both of these apps are written in VB6 (sigh).

In Windows 7, if user's pin the launcher program, we get two different icons on the taskbar (one for the main app, and then the pinned icon for the launcher program). This looks very odd.

I've tried using the following function: http://msdn.microsoft.com/en-us/library/dd378422%28VS.85%29.aspx to no avail so far.

I gave both the same name (Company.Product), as advised in the documentation, and before any UI pops up. If I pin the launcher app while it is running, this works fine. If I pin the executable for the launcher, I get two icons.

Any ideas on how to fix it such that I can users could just pin the launcher exe and all is good?

A: 

Make it so your main app doesn't show up in the taskbar and make it so when launcher is clicked in the taskbar it will send a message to the main window to appear if it is minimized. This can be achieved with Windows API.

Use FindWindowEx to get a handle for the main window then send a WM_SYSCOMMAND message with SC_RESTORE.

Nick Brooks
The launcher app goes away when the main app opens though (through some similar talking)... so that won't work.
Daemonic
Then there is no way except invading the Windows 7 taskbar.
Nick Brooks
+1  A: 

Why have two separate executables (particularly when they are written in the same language). Why not merge the launcher in with the "main application" and do some threading to have the main app actually start while the launcher is displaying a title screen, etc. There are number of tutorials for creating launchers.

JasCav
It's been this way since it was written (I just try to maintain it... I would love to rewrite the whole thing).And threading in VB6 is icky. Like scary icky.
Daemonic
I've managed to convince management that we should make this modification in the future, so giving you full credit for it. :)
Daemonic