>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! ;)
Check the codes near the end of thread here (you don't need to know or tanslate from Turkish):
http://www.fox4um.com/topic/1545/formsetfocus-hk/Or from UT:
Re: Focusing window Thread #
838202 Message #
838207Cetin