Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to detect if your program is already running before
Message
 
To
21/06/2001 14:09:46
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00522073
Message ID:
00522088
Views:
9
>Hello Group,
>
>We have a user who keeps starting the filetrac program and watching to see its old icon in the tray. This isn't going to happen until I learn how to make the new filetrac program put the old filetrac icon in the tray.
>
Jim,

Do you mean preventing a second instance of the application running? Are you talking about the taskbar or the System Tray?

If you mean preventing a normal executable from running twice, there are a number of ways. Use the FindWindow() API call or something like my Is_Run32 program from the download section to determine if the window already exists. You could set up the application as a DDE server and test to see if it's active. Ed Rauh suggests using the CreateEvent() API call. I think if you'll check the FAQs you'll find that. I wrote an article for FoxPro Advisor (Nov., 1998) that uses CreateMutex().

Some of this (inlcuding the DDE implementation) you can find in the FAQs or download sections.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform