Scenario: when I am trying to get the status of cursor by “System.Windows.Forms.Cursor.Current.ToString.ToLower” it is always returning [cursor: waitcursor] even if cursor is not busy
Steps to reproduce: tried in different versions
Current Behavior: always shows wait
Expected Behavior: should say default if cursor is not busy
Studio/Robot/Orchestrator Version: 2017 and 2016
Last stable behavior: never tried
Last stable version: 2016 n 2017
OS Version: windows 10 enterprise
Others if Relevant: (workflow, logs, .net version, service pack, etc):
Here is an example that shows a busy cursor or a handle in the Log. Any help would be greatly appreciated. What I see right now is only 65543 as my cursor handle.Main.xaml (11.5 KB)
Invoke the code below to create a pause while cursor is busy or application is opening or it is not loaded yet:
Dim cinfo As PInvoke.User32.CURSORINFO
Dim hndl As Integer
cinfo.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(cinfo)
Do
Call pinvoke.User32.GetCursorInfo(cinfo)
hndl = cinfo.hCursor.ToInt32
Loop While (hndl = 65543 Or hndl = 65561 Or hndl =0)
Your handles could be different, but you can use the same code to figure them out.
Hi
I try to execute your code but it is not working properly which means even if cursor status changed also it is waiting . Please let me know if need any modifications.
Best Regards,
Likith Rajesh.
Dim cinfo As PInvoke.User32.CURSORINFO
Dim hndl As Integer
Dim n As Integer
Dim i As Integer = 0
Do
n = CInt(in_Timeout/500) 'Max number of times loop is executed
cinfo.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(cinfo)
Call pinvoke.User32.GetCursorInfo(cinfo)
hndl = cinfo.hCursor.ToInt32
Threading.Thread.Sleep(500)
i = i + 1
Loop While (hndl = 65545 And i<n)
If i = n
out_TimeoutExceeded = True
End if
Included “cinfo.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(cinfo)” within the Do While loop
Included out_TimeoutExceeded as an output parameter
Included a boolean output to notify if timeout is exceeded