Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Top Level Form needs focus..
Message
 
To
01/09/2000 11:26:09
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00411754
Message ID:
00411808
Views:
17
I use Top Level Forms all of the time and started noticing this behavior in VFP 6. It is a major pain. The way that I have gotten around it is to add this code to the init of my Top Level Form:

DECLARE INTEGER FindWindow IN Win32API STRING, STRING
DECLARE INTEGER SetForegroundWindow IN "User32.dll" INTEGER
hWnd = FindWindow(0,"Account Analysis Input")
=SetForegroundWindow(hWnd)

The second parameter in the FindWindow() is the caption of the form.

HTH,
George


>Hi Folks,
>
>Say, when I create a simple project with a launching PRG calling a Top Level form after the form launches it appears to not have focus.
>
>That is, the top bar is grey as opposed to the blue I normally see when an object has Windows focus.
>
>I have a _screen.visible = .f. in the PRG as well.
>
>I'm trying to see if this is a bug or what might be required to make the form have focus when launched from a shortcut.
>
>I've dug around a bit looking for a mention of this and can't find any FAQ or anything on it.
>
>Best,
>
>DD
Everything we see or seems
Is but a dream within a dream
- Edgar Allen Poe
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform