06-22-2020, 04:24 PM
the way you have that currently setup osd is called over and over again which will cause some issues. also need to change acc statement so it can detect when device is unplugged. i also set a check condition so osd is not called over and over again unnecessarily.
try this
try this
int ticheck
rep
,int w=wait(-1 WV win("" "Shell_TrayWnd"))
,Acc a.Find(w "PUSHBUTTON" "Safely Remove Hardware and Eject Media" "class=ToolbarWindow32[]id=1504" 0x5 1)
,if a.NotFound
,,if ticheck =1
,,,OsdHide
,,,OnScreenDisplay "USB device plugged out" 5 0 -1 "Arial" 0 4 0xff0000
,,,ticheck=0
,else
,,if ticheck =0
,,,OnScreenDisplay "USB device plugged in" -1 0 -1 "Arial" 0 4 0xff0000
,,,ticheck=1
,0.5