Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ShowWindow - Problem getting VFP Top-level form to the t
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00320669
Message ID:
00321333
Views:
16
>Hey George,
>
>I got it all figured out. My framework incorporates top-level forms with dynamic window titles. I needed to insure only one instance of the application was running. The common method found here and other places is to compare the window’s title. This just wasn’t going to work for me so I started looking at the processes running on the machine as an alternative. The problem I was the number of hidden windows in each VFP process running. I was trying to ShowWindow the wrong window. I actually placed the test code in the file section under WIN32API & others APIs. It makes use of Ramon F. Jaquez's Enumerate Processes in Windows file under the same section. I use the win32api’s GetWindowThreadProcessId function to locate windows belonging to known processes the application is running in.
>
>Thanks,
Hi Bill,

I'm glad you got everything straightened out. While the most common method of insuring that an application can have only one instance may be checking the title bar, the recommended way is to have each application create a mutex on startup. If a particular mutex cannot be created (they're named objects), it means that the application is already running. I wrote an article describing this technique for FoxPro Advisor. It's on-line at their web site in case you care to check it out.
George

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

Click here to load this message in the networking platform