Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Prevent run second session
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00061508
Message ID:
00061546
Vues:
44
>Hi: I need find the way to prevent the user open same application twice. Does anyone know how to do it?
>
>Thanks,
>tfp@inel.gov

There is the solution!
**Can maximize a window
DECLARE INTEGER ShowWindow ;
IN WIN32API ;
	INTEGER  hWnd , ;
	INTEGER nState

**get the window handle
DECLARE INTEGER FindWindow ;
IN WIN32API ;
	STRING cNull, ;
	STRING cWinName 

**place the window on top
DECLARE INTEGER BringWindowToTop ;
IN WIN32API ;
	INTEGER  hWnd 

*Sample code, it this case the window title = 'Calculatrice'
IF !FindWindow( 0, 'Calculatrice') > 0
	*Not find, do something...
ELSE
	*Find! Bring it to top and maximize it!
	=BringWindowToTop(FindWindow( 0, 'Calculatrice'))
	=ShowWindow(FindWindow( 0, 'Calculatrice'),1)
ENDIF	
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform