Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check if QM Editor window is open
#1
I am wondering about the best method to check if Qm Editor window is open, active or not, minimised or not. I have written the following code which it works, but I doubt whether there exists something more elegant. Many thanks in advance.

Function tempf
Trigger SF8     Help - how to add the trigger to the macro
Code:
Copy      Help
ARRAY(int) aw; GetMainWindows aw
int i
for i 0 aw.len
,if  aw[i]=_hwndqm
,,mes "QME Window Exists"
,,break
#2
Macro Macro1721
Code:
Copy      Help
;this also works in exe and in macros running in separate process

int w
#if EXE
w=FindWindow("QM_Editor" 0)
if(w=0) mes "no window"; ret
#else
w=_hwndqm
#endif

mes F"active={w=win}, visible={!hid(w)}, minimized={min(w)}, enabled={IsWindowEnabled(w)}"


Forum Jump:


Users browsing this thread: 1 Guest(s)