![]() ![]() ![]() We opt to check for the window class name regardless of the caption. This routine can check for window captions, (unreliable because they can change while a program is running), the window class name (better), or both. We use the FindWindow Windows API routine to search for a top level window of the required class. An Initial Approach Finding if your program is running Mutexes can be used to detect muliple application instances and memory mapped files can be used to exchange data. Listing 1 outlines the methodology we will be using in pseudo-code: Once such an application is detected we then pass any command line data via the WM_COPYDATA message. The method we will use to prevent multiple application instances is based on the detection of an application with a known main window class. We also look at how a duplicate instance can pass its command line parameters to the existing instance before terminating. An application does this by checking if an instance is already running and terminating it if so. ![]() This article discusses how to ensure that just a single instance of an application can be run. Passing the command line to a previous instance. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |