10-03-2010 09:18 PM
Hello All
Does anybody know if it is possible to lock the mouse cursor (the arrow) at a particular position on the FP, when a vi is running, and release it after the vi stops for normal operation, and still be able to use mouse up/down events
The "lock" location is not specific to a graph, indicator or control. In simpler terms...when the vi starts (position of mouse arrow is not critical ), the mouse cursor cannot be repositioned on the FP...no matter how much mouse scrolling the user tries.
I am already using the mouse down/up events with "panel"...so no suggestions about using this please.
The procedure might look like this
1. Vi starts
2. mouse arrow is locked into position (wherever it is)
3. Vi function performs
4. Vi stops and releases mouse for windoze use.
Regards
Ray
10-03-2010 10:12 PM
I don't think there would be any way you could do that. The cursor is controlled by Windows, and I really don't think Windows is going to let an application take that kind of control of a cursor. It is just too dangerous. If the application never relinquishes control, then Windows will be effectively locked up with no easy way to get control back again from the renegade application.
10-04-2010 03:55 PM
Thanks Ravens Fan
I suspected as much, but doesn't hurt to put it out there. You never know.....somebody may have done it at some time.
Regards
Ray
10-04-2010 04:13 PM
You could probably use the WINAPI functions GetCursorPos and SetCursorPos together in order to simulate the mouse being unmovable. You wouldn't be immobilizing the mouse cursor, but instead you would just be constantly moving the cursor to a set position every time.
One problem exists however and that is the fact that the Get Cursor Pos returns an LPPOINT structure. Since LabVIEW can't handle structs in the Call Library Function Node, you will have to make a C wrapper DLL that calls the function and puts it in more useful values.
10-04-2010 04:17 PM
David
yes, that's the way my thinking was heading. I was actually looking at microsoft website with just that in mind when your reply posted.
Thanks for your interest
Regards
Ray