We have a custom function that is used to identify the window being displayed, but it seems to fail on the odd occasion. If we then close that window and re-open, it works. The code is as follows:
' Declare the GetForegroundWindow function for use in the script.
Extern.Declare micInteger, "IsWindowVisible", "user32.dll", "IsWindowVisible", micHwnd
Extern.Declare micHwnd, "GetForegroundWindow", "user32.dll", "GetForegroundWindow"
' obtain foreground window handle
wndHandle = Extern.GetForegroundWindow
' obtain title of application with wndHandle
topWindow = Window("hwnd:="& wndHandle).GetROProperty("text")
Has anyone had a similar problem and have any suggestions on how to fix the issue? I thought of using a while loop until it recognises the window.
Instead of Hwnd try applying browser title and let me know.
The issue what you have listed does not exist, works fine in my machine- stupid comment from the developer
Thanks, it's a windows based system though, it doesn't use a browser.
Check whether there is a title for windows and specify the title there.
I'm not too sure what you mean by "a title for windows"? The function looks for the name of the window that is displayed.
just spy and check whether name is the common property or title then apply it and check