Information générale
Catégorie:
Installation et configuration
>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.
Didn't work. Thanks for the shot at it! I'll keep an eye out for anything else.
Robert
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement