Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set Focus To Top Level Form
Message
From
07/05/2010 13:59:58
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Set Focus To Top Level Form
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01463657
Message ID:
01463657
Views:
261
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.
Next
Reply
Map
View

Click here to load this message in the networking platform