Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
API Findwindow() / ShowWindow()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
API Findwindow() / ShowWindow()
Divers
Thread ID:
00069446
Message ID:
00069446
Vues:
1446
I only allow one App session per machine of my application and I am trying to NOW do this through the Windows API (new for me) I was playing with the locking idea, but after some research I decided that the API call would suit my needs a little better. I did get a piece of code from the knowledge base that works fine, however when
when the API finds my window and brings it to the top, the window is not maximized(it was before). Is there a parameter that I have set incorrectly in the showWindow() below. I am fairly new to VFP and green as can be on API, I would also appreciate any ideas for learning more of API as it pertains to VFP (i.e common VFP applications).

Thanks for any ideas!!!

*!* This code copied from UT knowledge Base
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, in this case the window title = 'Rural/Metro Fire'
IF !FindWindow( 0, 'Rural/Metro Marketing System') > 0
*Okay to continue
ELSE
*Find! Bring it to top and maximize it!
=BringWindowToTop(FindWindow( 0, 'Rural/Metro Fire'))
=ShowWindow(FindWindow( 0, 'Rural/Metro Fire'),1)
QUIT
ENDIF
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform