Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set Focus To Top Level Form
Message
De
07/05/2010 13:59:58
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Set Focus To Top Level Form
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01463657
Message ID:
01463657
Vues:
259
I have an application that starts with a modeless password form. The trouble is that when I start the application from the exe, the password form does not have focus.

* In Config.fpw I have:
--------------------------------------------------------------------------------------------------
SCREEN=OFF

* In the main program I have:
--------------------------------------------------------------------------------------------------
declare integer ShowWindow in Win32API;
integer hwnd,;
integer hwnd

DO FORM PASSWORD
* various commands tried see below
READ EVENTS

* For the form itself the only non-cosmetic properites set are:
--------------------------------------------------------------------------------------------------
ShowWindow=2 - As Top-Level Form
WindowType=0 - Modeless

I thought about using the forms HWnd property to set focus, but I am not sure when I have access to it. I put the above Win32API ShowWindow declaration in my main program so I could utilize it to set focus to the password form, but I am not sure where to put the command to show the window. Should it have been in the form itself?

Between the DO FORM PASSWORD and READ EVENTS commands in the main program I have tried:
--------------------------------------------------------------------------------------------------
DO FORM PASSWORD
*password.show()
*password.activate()
*ShowWindow(Password.hwnd,8)
READ EVENTS

All seem to fail to bring the password form to the forefront and into focus.

I know this is probably an old problem to many of you, so help me out! ;)
Carole Shaw
Fred Hutchinson Cancer Research Center

Eagles may soar, but weasels don't get sucked into jet engines.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform