Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto hide unwanted window to tray - not working
#1
Greetings,
a dumb mouse driver which autostarts with Windows opens it's control window in normal state, which is completely useless, so I wanted QM to hide it immediately for me to tray. I've done a simple macro that hides the window if I open it from tray icon and launch this macro by hand

Code:
Copy      Help
int w=wait(300 WV win("Rapoo Wireless Driver" "#32770" "RapooWirelessDriver"))
wait 5
hid w

But the same window is not hidden when it's initially opened on autorun.
This macro is scheduled to run on QM start (QM events > Startup > Windows started), whereas QM is set to autorun with Windows.
Now I think that there may by a timing problem when QM and the macro is run after the driver window is already opened, but this scenario works if I open by hand the driver window and then test run the macro, or the driver window appears when QM and macro is already started, but I can simulate this situation too by starting the macro first, then opening the driver window, and this scenario works too. I'm sure the timeout 300 is more than enough to catch the window.
Any idea what might be preventing the macro do it's job? Thanks.
#2
try
Code:
Copy      Help
int debug=1
int w=wait(300 WV win("Rapoo Wireless Driver" "#32770" "RapooWirelessDriver"))
rep
,hid w
,err
,,if(debug) out "closed"
,,ret
,wait 1 -WV w
,err
,,if(debug) out "failed to hide"
,,continue
,break
if(debug) out "now should be hidden"

Also, maybe the macro does not run because some other macro runs at that time. In Properties convert it to function or select "Run simultaneously".
Also, if possible, instead of hid let the macro hide the window in the same way as you do it manually.


Forum Jump:


Users browsing this thread: 1 Guest(s)