Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Communicating with other VFP exe's
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00061459
Message ID:
00061547
Vues:
41
>Hi
>
> I have a main VFP exe program that also runs another different
>VFP exe program. How do I determine from the first program whether
>the second program is running or not. If it is running then I would
>like to maximize it rahter than running a second copy.
>
>Thanks Gary

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	
:0)
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