Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set Focus To Top Level Form
Message
De
07/05/2010 16:10:51
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
07/05/2010 13:59:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
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:
01463700
Vues:
126
>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 #838207

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform