Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Preventing application from running more than once
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00048262
Message ID:
00048375
Views:
23
>I put code in my application that checks to see if it is already running and if it is it stops loading and informs the user with a messagebox that it is already running. I would like to modify this so if the user tries to run it a second time instead of getting the messagebox, the current running application is brought to the front and maximized. I am using VFP 5.0a.
>
>Any ideas?
>
>
>Jeff Rusch
>UW-Madison


From my application wrapper:

DECLARE INTEGER FindWindow IN Win32API STRING @lcWindowTitle, STRING otherstring
DECLARE INTEGER SetForegroundWindow IN Win32API Integer
IF ! This.MultiSession
lnAppActive = FindWindow(0,This.AppName) && returns the window handle of any window with the caption (This.AppName)
IF lnAppActive > 0
=SetForegroundWindow(lnAppActive) && Brings the window with the handle lnAppActive to the foreground
RETURN .F.
ENDIF
ENDIF
Dan
St. Petersburg, FL

"I started out with nothing and I still have most of it left"
Previous
Reply
Map
View

Click here to load this message in the networking platform