Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to prohibit User to start 2nd time the executable
Message
 
 
To
11/01/2002 03:15:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00603363
Message ID:
00603649
Views:
19
Petros,

The problem with the code is that your test is finding itself. Here's a better way to do this in your main.prg
lcCaption = "My application" && the real application window caption

_screen.Caption = lcCaption + sys(2015) && temporarily hack the caption

lnHWND = FindWindow( ... lcCaption ... )

if ( lnHWND > 0 )
   return
endif

_screen.Caption = lcCaption && set to the real caption
>I used your code in my main.prg under the command :
>
>MODIFY WINDOW SCREEN TITLE "app caption" ICON FILE XXX.ICO NOCLOSE
>
>and the lnWinHandle = 1928 the first time the i am starting the .exe
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform