Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enter .exe without a click
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Divers
Thread ID:
00494581
Message ID:
00494848
Vues:
16
Robert

I think you are seeing a new feature of Win 2000. Apps do not automatically come to the top of the stack and get focus. I discovered this problem last summer when my PC was upgraded to Win 2000. Apps that worked OK in Win 98 stopped comming to the top of the stack and getting focus. Also, off the shelf programs like QuickView had the same problem until I upgraded them. Here is a function I wrote to fix the problem in my VFP apps.

****************************
PROCEDURE BringToTop
LPARAMETERS tcAppName

*** Brings the app to the top and give it focus in Windows 2000
DECLARE INTEGER FindWindow IN Win32API STRING, STRING
DECLARE SHORT SetWindowPos IN USER32 ;
INTEGER hWnd, ;
INTEGER hWndInsertAfter, ;
INTEGER x, ;
INTEGER y, ;
INTEGER cx, ;
INTEGER cy, ;
INTEGER uFlags
#DEFINE HWND_TOPMOST_WINDOW -1
#DEFINE SWP_NOMOVE 2
#DEFINE SWP_NOSIZE 1
#DEFINE SWP_SHOWWINDOW 0x40
#DEFINE SWP_BRINGTOTOP SWP_NOSIZE + SWP_NOMOVE + SWP_SHOWWINDOW
hWnd = FindWindow(0, tcAppName)
=SetWindowPos(hWnd, HWND_TOPMOST_WINDOW, 0,0,0,0, SWP_BRINGTOTOP)
_SCREEN.AlwaysOnTop = .T.
_SCREEN.AutoCenter = .T.
_SCREEN.Visible = .T.
_SCREEN.Show()
_SCREEN.AlwaysOnTop = .F.
RETURN
****************************************************

I call it in my app startup program.

*** Bring app to top in Windows 2000
BringAppToTop(_SCREEN.Caption)

Hope this helps.
Dennis Lindeman
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform