Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I move a screen by using MOUSEDOWN?
Message
From
26/04/2013 13:28:01
 
 
To
26/04/2013 12:53:41
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01571991
Message ID:
01572007
Views:
40
>>I have a form (dialog) withut a title bar
>>how can I allow users to move the form?

I dont follow.
Would you have a snippet I could study?

thanks

P
>
>Perhaps a better way to do it is to trap the MouseDown event on your form somewhere where there is no other event that's triggered, and then monitor MouseMove to see if the user is left-clicking for more than a few pixels. If so, then BINDEVENT(thisForm.hwnd, WM_MOUSEMOVE, thisForm, "myCustomMouseMoveEvent") and monitor those locations. Use the Windows function GetAsyncKeyState() to read the mouse button state (http://msdn.microsoft.com/en-us/library/windows/desktop/ms646293%28v=vs.85%29.aspx) and GetCursorPos() to find out where the mouse is on the entire desktop (http://msdn.microsoft.com/en-us/library/windows/desktop/ms648390%28v=vs.85%29.aspx) and then begin reading mouse deltas from the original location and position your form adjusted by those deltas from its original position.
>
>Once the mouse button is released, UNBINDEVENT().
Peter Cortiel
Previous
Reply
Map
View

Click here to load this message in the networking platform