Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Prevent Multiple Instance
Message
 
To
29/07/2003 02:17:14
Samir Chheda
Remittag Software Pvt. Ltd.
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00814432
Message ID:
00814436
Views:
12
Hi Samir,
I am using an EXE file wich starts the main EXE, It also check for new version of the programm installed on server and some other things. In it I have the following:
IF IsRunning("Your Main application caption")
   MessageBox("Bla bla...",16,"Error")
   QUIT
ENDIF


FUNCTION IsRunning(cCaption)
     DECLARE INTEGER GetActiveWindow IN Win32API
     DECLARE INTEGER GetWindow       IN Win32API INTEGER hWnd, INTEGER nType
     DECLARE INTEGER GetWindowText   IN Win32API INTEGER hWnd, STRING @cText, INTEGER nType
     LOCAL hNext, cText
     hNext = GetActiveWindow()
     DO WHILE hNext # 0
        cText = REPLICATE(CHR(0), 80)
        GetWindowText(hNext, @cText, 80)
        IF UPPER(cCaption) == UPPER(cText)
           RETURN .t.
        ENDIF
        hNext = GetWindow(hNext, 2)
     ENDDO

RETURN .f.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform