Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mouse click or Windows API needed?
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00593193
Message ID:
00593242
Views:
26
>This should be simple but I've not had any success so far. In VFP 6.0 I have a standard form with two controls on it: a command button and the "Image" ActiveX OLE Control that comes with Windows 2000 (Imaging.EditCtrl.1). I'd like to be able to click on the command button and then programmatically move the mouse pointer somewhere over the imaging control and then programmatically issue a mouse click. My current code in the command button is:
>
>* - Just load an image into the imaging control
>ThisForm.Olecontrol1.Display()
>
>MOUSE AT 5,5
>MOUSE CLICK
>
>The mouse movement works just fine, however, the MOUSE CLICK code doesn't. I've tried a variety of similar approaches without any success.

The problem is that the MOUSE CLICK is sent to the hWnd of the form, not the control it's positioned over; you should either get the hWnd of the ActiveX control and use PostMesage() to pass a WM_MOUSEDOWN and WM_MOUSEUP to the hWnd of the ActiveX control, or simply invoke the Click() method of the control on the form.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform