Findwindow (OpenInsight 64-bit)
At 25 OCT 2023 10:42:50PM Gerry Van Niekerk wrote:
OI 10
I am trying to see if an external window is still running.
I have the handle of the window, used to do it with findwindow by title I think many moons ago.
Is there a way I can do it in OI 10 easily?
Thanks
Gerry
At 26 OCT 2023 01:28AM Donald Bakke wrote:
OI 10
I am trying to see if an external window is still running.
I have the handle of the window, used to do it with findwindow by title I think many moons ago.
Is there a way I can do it in OI 10 easily?
Thanks
Gerry
If you already have the handle to the external window, you should be able to call msWin_IsWindow(handle) and get a 1 response if it is still running.
At 31 OCT 2023 07:30PM Gerry Van Niekerk wrote:
Hi Don,
Doesn't work for me, on win 11 or server
I get the handle by using "runwin" and it is correct as per task manager
However status always returns 0
Not sure…
Thanks
Gerry
At 31 OCT 2023 08:17PM Donald Bakke wrote:
Hi Don,
Doesn't work for me, on win 11 or server
I get the handle by using "runwin" and it is correct as per task manager
However status always returns 0
Not sure…
Thanks
Gerry
I don't think the process handle you get from RunWin is the same as the window handle that msWin_IsWindow uses. Carl can chime in and correct me if I'm wrong.
We wrote a utility that finds the window handle based on the caption of the running window. This relies upon msWin_GetWindow and msWin_GetWindowText. Once we get a valid window handle we can do other things such as using msWin_IsWindow to confirm it is still running.
At 01 NOV 2023 06:09AM Carl Pates wrote:
HI Gerry,
Don is correct - the information returned from the RUNWIN method does not relate to window handles, though it might be useful with FindWindow et al because you can check that the window you've found belongs to that process etc.
But in the first instance you would need to use another method to get an actual handle.
Regards