Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is the application already running
Message
 
À
09/10/2002 04:24:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00709151
Message ID:
00709152
Vues:
31
Try this function. You must pass part or whole caption of Your application as a parameter.


FUNCTION IsRunning(cCaption)
LOCAL hNext, cText
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
hNext = GetActiveWindow()
DO WHILE hNext # 0
cText = REPLICATE(CHR(0), 80)
GetWindowText(hNext, @cText, 80)
IF UPPER(cCaption) $ 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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform