12-24-2013, 01:25 PM
I think there are no reliable ways to know when Windows and startup programs/services are fully loaded. Also, depends on what must be loaded/working. Is it when Windows becomes quiet and responsive, or when you can access network files, internet, or when certain process is loaded, etc.
For me, the main indicator that Windows is still loading is disk activity. This code waits while disk is busy.
GetDiskUsage uses performance counters. On some Windows versions it does not work if the macro runs not as administrator.
This code may wait too long if something uses disk after Windows is fully loaded, for example some Windows service or antivirus. Try to replace 5 to 20 or 50. Waiting for CPU is less reliable. Maybe better simply use wait 10 or wait 20 etc, depending on your PC startup speed.
To wait for a tray icon, wait for its accessible object.
See also:
http://stackoverflow.com/questions/1050 ... er-startup
For me, the main indicator that Windows is still loading is disk activity. This code waits while disk is busy.
int n d=GetDiskUsage
;int c=GetCPU
rep
,1
,d=GetDiskUsage
,out d
,;out "%-5i %5i" d GetCPU
,if(d<=5)
,,n+2
,,if(n>=10) break
,else if(n>0) n-1
This code may wait too long if something uses disk after Windows is fully loaded, for example some Windows service or antivirus. Try to replace 5 to 20 or 50. Waiting for CPU is less reliable. Maybe better simply use wait 10 or wait 20 etc, depending on your PC startup speed.
To wait for a tray icon, wait for its accessible object.
int w=wait(60 WV win("" "Shell_TrayWnd"))
Acc a.Find(w "PUSHBUTTON" "QTranslate 4.1.0" "class=ToolbarWindow32[]id=1504" 0x1005 60)
See also:
http://stackoverflow.com/questions/1050 ... er-startup