Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keeping Window on top and focused
#1
Is it possible with the QM Windows, Controls function to open an application, let's say Notepad, keeping it on top and more importantly: force focus (blinking cursor) on it so that the user cannot activate underlying applications until Notepad has closed?

I've tried about every On Top, Focus, Z-order, If..option in the QM menu but I haven't been able to accomplish this yet....
#2
Not easily. Not reliably. Would need keyboard and mouse hooks to not allow to click other windows and press Alt+Tab, Win, etc. Also activate window in loop. Cannot disable Ctrl+Alt+Delete.
#3
maybe something like this

It's not perfect but will keep notepad active


Function NotepadExample
Code:
Copy      Help
int w
run "$system$\notepad.exe" "" "" "" 0x800 win("" "Notepad") w
Zorder w HWND_TOPMOST
rep
,0.2
,if(!IsWindow(w)) ret
,if win()!=w
,,act w
,,err
,,,if(!IsWindow(w)) ret
#4
Great work Kevin! Works perfectly with Notepad. However, if I replace it with another application, like in this case a simple text input dialog made with QM, it doesn't work. Does it have to do with one of the flags?


Code:
Copy      Help
int w
run "$program files$\Test\Test Application.exe" "" "" "" 0x800 win("" "Test Application") w
Zorder w HWND_TOPMOST
rep
,0.2
,if(!IsWindow(w)) ret
,if win()!=w
,,act w
,,err
,,,if(!IsWindow(w)) ret
#5
It doesn't  work because this line is incorrect 
win("""Test Application")
The first set of quotes is for window name the second is for window class.
#6
Thanks, had already figured it out by going through the Files, web menu  ;-)


Code:
Copy      Help
int w
run "$program files$\Test\Test Application.exe" "" "" "" 0x800 win("Test Application" "#32770") w
Zorder w HWND_TOPMOST
rep
,0.2
,if(!IsWindow(w)) ret
,if win()!=w
,,act w
,,err
,,,if(!IsWindow(w)) ret


Forum Jump:


Users browsing this thread: 1 Guest(s)