1
votes

I am writing a windows application which requires mouse pointer shape change notification. I have searched thoroughly but could not find a satisfactory solution. I want to receive a notification for cursor shape change as well as the type of cursor to which it has changed.

From the search I came to know that I will have to install a hook in every process and capture WM_SETCURSOR event but capturing this message does not give me full information. So please guide me if anybody can help

1
What information are you expecting and what are you getting (or missing)? - MikMik
I am expecting the type of the cursor ( for ex when it has changed from arrow to hand, or when it changes for resizing), I am getting only its location.I have seen that in loadcursor() we can specify some ID (IDC_CROSS, IDC_HAND) for changing the cursor.So if the same id or something equivalent to that, I can get in my application then it would serve the purpose - John_Avi_09

1 Answers

2
votes

You can get the handle to the current cursor with GetCursor or GetCursorInfo.

The problem is to know which cursor the handle refers to. I don't think there's a "reverse find" function, so you would have to implement it by comparing your handle with the one returned by LoadCursor for the different possible values.

Fortunately, the docs say this:

The LoadCursor function loads the cursor resource only if it has not been loaded; otherwise, it retrieves the handle to the existing resource.