Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Looking for mousedown API -Top Level Form loses focus
Message
From
14/08/2009 12:36:01
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01418032
Message ID:
01418143
Views:
45
>I posted this a few weeks back but was not able to get a fix. I have form 1 that then runs form 2 from a command button. Form 2 is used to change settings on form 1. Form 1 is a modal formset with two forms. Form 2 is a modless top level form. When you click on any control on form 1 the form gets focus and form 2 loses focus. After that, the only way you can get form 2 to have focus is by clicking on the title bar.
>
>Form 2 has a pointer to form 1 so that when the user changes a setting in form 2 the change is reflected in form 1. (form 1 code: do form2 with thisform. Thisform is then saved in a property of form 2 and it also sets a property in form 1 with its own Thisform.) Thus each form has a handle on the other. It must be that way so each form can change things in the other as needed.
>
>In place of fixing the problem of not being able to set focus on form 2 by clicking it I thought about simply tracking the mouse pointer on the entire windows desktop and if the mouse is over form 2 then simply have some code set focus to it. I found code at new2news.com but what I found only tracks the mouse position and must be run repeatedly in a loop to get the position.
>
>Does anyone know the windows API for mouse down anywhere on the windows desktop? I can get the position, I just need the mousedown event to fire off my code.

Try to change "Form 2" to modless "In Top-Level Form".
Desktop property is an option to set "Form 2" out of the "Form 1".
Previous
Reply
Map
View

Click here to load this message in the networking platform