Hi, i find a tip to launch one instance of my app, but how do i show the first window when the user want to launch it for the second time. FindWindow need the name of the class, since my app is a dialog based application i can't do that. can anyone tell me how to find the HWND of my dialog based app ?
Posted on 2001-05-09 06:38:00 by blackhorus
I recommend you to use the Mutexes to prevent multiple application instances... it's better, faster, more secure than the FindWindow tip. You will find some interesting information about that on this page. Happy coding. This message was edited by Readiosys, on 5/9/2001 7:05:55 AM
Posted on 2001-05-09 07:05:00 by Readiosys
thanks for replying, i've read this article, and i've used the third method (the one who used the Atom table), but the problem wasn't that. i'm gonna re-explain it : i want to show my app, when the user click for the second time on the icon (the first one, launch the app, and register a string in the atom table, and the second one, found that there's a string matchin, and before exit, it show the app, so the user know that there's an instance there), but i don't know how to get the handle of my window, since it is a dialog based app how do we can retrieve the handle, of a dialog based app ?
Posted on 2001-05-09 18:55:00 by blackhorus
You got the handle in your DialogProc so you might wanna use the broadcast method and send back the hwnd in response to the calling app.
Posted on 2001-05-10 00:26:00 by goofee
I would suggest using an event to sync between processes as it is the least complicated global object. Lookup CreateEvent
Posted on 2001-05-10 03:59:00 by George
Download ErrShow from Iczelion site. It's exactly what you need. Start code shows how to communicate between two instances of dlg based apps. It not only prevent the second instance from running but also in start on second instance brings the first on top and even pass parameters of command line from second instance to the first and make the first instance to react on parameters passed to the second instance. How to get handles and class names in dlg apps all shown. The Svin.
Posted on 2001-05-12 11:39:00 by The Svin
i didn't find the file "ErrShow" of the Iczelion site can u give a link, where i can download it ? thanks
Posted on 2001-05-15 07:58:00 by blackhorus
It's called ErrorShow. I can see it on the first page of Iczelion site.
Posted on 2001-05-16 04:58:00 by The Svin