Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Top Level form isn't top level (Win 2000)
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00495789
Message ID:
00495820
Vues:
9
Yeah, I tried that, but it doesn't work. Here's what the code looked like:
nhWnd = FindWindow( 0, _chrWindowName )
?"nhWnd = " + ALLTRIM(STR(nhWnd))

DECLARE INTEGER GetLastError;
   IN WIN32API


DECLARE SHORT SetForegroundWindow IN USER32.DLL INTEGER hWnd
*  I assume you've got the hWnd you want stored in the variable nhWnd
nResult = SetForegroundWindow(nhWnd)

IF nResult # 0
   *  the desired window and thread are now in the foreground
   ?"Success"
ELSE
   *  the hWnd was not assigned to the foreground and the thread
   *  remains at its default priority
   ?"nResult = 0"
   nError = GetLastError()
   ?"Error code:  " + STR(nError)

ENDIF
I get:
nhWnd = 7195
nResult = 0
Error code: 2

I looked error code 2 up on MSDN and see that it means "file not found." Freaky. Is this an issue in VFP 6.0 vs. 2000 as well?

Marty

>>I've got a situation that's driving me nuts! VFP 5.0
>>
>>I have a 2-As Top Level Form that works great in Windows 98, but has gone nuts in Windows 2000. When I start the application, it fires up the form behind any explorer windows which are open. I've tried everything!
>>
>>The only thing I've found that works, is removing SCREEN=OFF from CONFIG.FPW. I put an Application.Visible = .F. in the main program, and everything works fine. Problem is, it does that ugly "flash" of the VFP screen.
>>
>>I can't be the only person who's experienced this. I saw Ed Rauh's solution using WindowPos API call, but that doesn't fix it either.
>
>Try the SetForeGroundWindow API function. It's in the WinAPI section.
>
>HTH.
Marty Smith, CSQE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform