Getting the mouse cursor type from Web application
I have found a little information on the forums for getting the mouse cursor state from an open application, but I have a Web application. Has anyone been able to get the mouse cursor type while the mouse is over a Web page?
The reason I am trying to do this is I want to create a function to wait for my application to be ready before continuing script execution. If I wait for the hourglass cursor to change back to a pointer, this might be one way to accomplish that.
BTW, I am using JScript as my scripting language.
Re: Getting the mouse cursor type from Web application
I think I got the answer to my own question. At least it seems to work with the little bit of testing I did.
<font class="small">Code:</font><hr /><pre>function GetMouseCursor()
var nHandle = Win32API.GetForegroundWindow();
var nProcessID = Win32API.GetWindowThreadProcessId(nHandle, null);
var nThreadID = Win32API.GetCurrentThreadId();
Win32API.AttachThreadInput(nProcessID, nThreadID, true);
var nCursor = Win32API.GetCursor();
Win32API.AttachThreadInput(nProcessID, nThreadID, false);
// Some of the common mouse cursor types
var c_nMouse_Pointer = 65555;
var c_nMouse_Hourglass = 65559;
var c_nMouse_Text = 65557;
var c_nMouse_Hand = 65583;</pre><hr />