LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wie kann ich mit Labview den Mauscursor auf eine bestimmte Position setzen ?

Wie kann ich mit Labview den Mauscursor auf eine bestimmte Position setzen ?
Gibt es ein vi oder ein Beispielprogramm ?
0 Kudos
Message 1 of 7
(3,791 Views)
hi

under LV7.0 you can use the vis

Initialize Mouse.vi
Acquire Input Data.vi
Close Input Device.vi

in the palette ->Advanced ->Input Devices

best regards
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 7
(3,786 Views)
hi again

ups, you want to SET the mouse position.... sorry, got now idea.

good luck
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 3 of 7
(3,785 Views)
How can I set the position of the mouse cursor programmatically?


Interessiert mich auch, deshalb das ganze mal auf englisch - erhöht die
Erfolgschance der Antwort um ein paar Dekaden 😉


moersi schrieb:
> Wie kann ich mit Labview den Mauscursor auf eine bestimmte Position setzen ?<br>Gibt es ein vi oder ein Beispielprogramm ?

0 Kudos
Message 4 of 7
(3,783 Views)
hi

here's an extract from the MSDN:

SetCursorPos
The SetCursorPos function moves the cursor to the specified
screen coordinates. If the new coordinates are not within
the screen rectangle set by the most recent ClipCursor function,
the system automatically adjusts the coordinates so that the cursor stays within the rectangle.

BOOL SetCursorPos(
int X, // horizontal position
int Y // vertical position
);

Parameters
X Specifies the new x-coordinate, in screen coordinates, of the cursor.
Y Specifies the new y-coordinate, in screen coordinates, of the cursor.

Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, callGetLastError.

Remarks
The cursor is a shared resource. A window should move the cursor only when the cursor is in its client area.

The calling process must have WINSTA_WRITEATTRIBUTES access to the window station.

QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
Import Library: Use user32.lib.

See Also
Cursors Overview, Cursor Functions, ClipCursor, GetCursorPos, SetCaretPos, SetCursor, ShowCursor



hope that helps
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 5 of 7
(3,781 Views)
On a side note, It is generally considered bad form to warp the cursor programmatically. It is something that should not be done.
The cursor is an input tool and supposed to be under the complete control of the operator. It can be very annoying to the user if it suddenly moves by itself or jumps to a different screen location with a mind of its own. On a big, high-resolution screen, it might be difficult to find where it went without moving it again.

Yes, there is software out there that does these things, but I consider it unacceptable in 99.9% of the cases. Are you sure there is no better alternative?
0 Kudos
Message 6 of 7
(3,770 Views)
I agree (to 99.9%) with 'altenbach': don't move the mouse cursor programmatically.

If you still want to do it, visit the following topic in the german labview forum:

LabVIEW Usergroup CE
0 Kudos
Message 7 of 7
(3,756 Views)