Jump to content

How to get the mouse's status ?


Recommended Posts

Specifically here - this returns the handle to the current cursor - which allows you to determine its' status.

Thanks all, I have made one "GetCurrsor" sample attached, but, it is not well, as the cursor turns to "busy" status, and the back count is not changed. the count can changed at labVIEW front panel only, if the cursor is out of labVIEW front panel, it is no response. is anything wrong ?

please help to point out.

Download File:post-4703-1151896776.vi

Link to comment
Thanks all, I have made one "GetCurrsor" sample attached, but, it is not well, as the cursor turns to "busy" status, and the back count is not changed. the count can changed at labVIEW front panel only, if the cursor is out of labVIEW front panel, it is no response. is anything wrong ?

please help to point out.

Changing the global cursor is not such a simple exercise. Basically Windows maintains a cursor state for each application and changes it accordingly whenever the cursor changes into a screen area owned by a different application. And in the case of LabVIEW it gets rather nasty for the application cursor. LabVIEW has the habit of resetting the cursor frequently to what it thinks it should be. But if you use LabVIEW 8 then you have already functions in the palatte to change the cursor state for at least LabVIEW.

To change the global cursor consistently I'm afraid you would end up having to write some hook function again.

Rolf Kalbermatter

Link to comment
Changing the global cursor is not such a simple exercise. Basically Windows maintains a cursor state for each application and changes it accordingly whenever the cursor changes into a screen area owned by a different application. And in the case of LabVIEW it gets rather nasty for the application cursor. LabVIEW has the habit of resetting the cursor frequently to what it thinks it should be. But if you use LabVIEW 8 then you have already functions in the palatte to change the cursor state for at least LabVIEW.

To change the global cursor consistently I'm afraid you would end up having to write some hook function again.

Rolf Kalbermatter

Thanks rolfk, but I don't want to change the global cursor, I just want to get the global cursor's status.

Link to comment
Thanks rolfk, but I don't want to change the global cursor, I just want to get the global cursor's status.

Then read the entire MSDN article pointed to in the previous post! It mentions that GetCursor is only for the applciation cursor while there is a GetCursorInfo or similar function that will give you the global cursor (at least if you are not using an archeological Windows version).

Rolf Kalbermatter

Link to comment
Then read the entire MSDN article pointed to in the previous post! It mentions that GetCursor is only for the applciation cursor while there is a GetCursorInfo or similar function that will give you the global cursor (at least if you are not using an archeological Windows version).

Rolf Kalbermatter

thanks rolfK, and I found msdn tells "[out] Pointer to a CURSORINFO structure that receives the information. Note that you must set CURSORINFO.cbSize to sizeof(CURSORINFO) before calling this function"

I don't undertand well about "must set CURSORINFO.cbSize to sizeof (CURSORINFO)" what is the sizeof that I must pay attenction to ?

and I set the cbSize to any count, labVIEW prompts error dialog box. that is my error vi. would you help to point out my error at your convenience time? thanks !

Download File:post-4703-1152159461.vi

Link to comment
thanks rolfK, and I found msdn tells "[out] Pointer to a CURSORINFO structure that receives the information. Note that you must set CURSORINFO.cbSize to sizeof(CURSORINFO) before calling this function"

I don't undertand well about "must set CURSORINFO.cbSize to sizeof (CURSORINFO)" what is the sizeof that I must pay attenction to ?

and I set the cbSize to any count, labVIEW prompts error dialog box. that is my error vi. would you help to point out my error at your convenience time? thanks !

Hi,

inputs are wrong to the function, create the structure from docs

cosmin

Download File:post-4089-1152278395.vi

Link to comment
  • 2 months later...

Hello everyone from Germany; I am no good programmer and do not know what labview is, but I have the problem, that I have to know when the cursor is changing, that is used by an other application.

I did try

HCURSOR hcursor;

hcursor=GetCursor();

CURSORINFO cursorinfo;

cursorinfo.hCursor=hcursor;

cursorinfo.cbSize=sizeof(CURSORINFO);

GetCursorInfo(&cursorinfo);

But cursorinfo.cbSize always is '20' dec. and does not change. :(

As my program is important for me I wold be endless thankful, if anyone could help me the program part make deliver a changing value when the cursor changes (into no hourglass but to a certain symbol in a java programm as an indicator of busy state of the strange application ). (or is it not possible to access a strange application's state?)

Thanks yet

Link to comment
Hello everyone from Germany; I am no good programmer and do not know what labview is...

Although there's an outside chance that someone here might be able to help you out, this is a LabVIEW list - LabVIEW is a particular programming language. This is probably not the right forum to be asking this question. Good luck! :)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.