04-07-2024, 08:29 AM
For some reason, I need to close the osdText window when a certain window is not visible. The following code will prompt an error when executed. Why?
//.
script.setup(trayIcon: true, sleepExit: true);
//..
var w = wnd.find(1, "LibreAutomate", "HwndWrapper[Au.Editor;*");
int _M = 0; //Line18 ERR
//int _M = 1; //Line18 OK
osdText osd = null;
if (_M == 1)
{
osd = osdText.showText("hello", -1);
}
wait.until(3, () => !w.IsVisible);
if (osd != null) osd.Close(); osd.Dispose();