0

I have a Windows Gadget I created that performs a function within a sub, which is timed (currently 10 seconds), it will check each 10 seconds then wait and loop and perform the function again, however, the loop stops when the PC comes out of sleep, it stops dead and won't resume, how would I stop this from happening in VBScript/HTA?

<SCRIPT LANGUAGE="VBScript">
    Option Explicit
    Dim iTimerID, RefreshList
    Sub
        Window_OnLoad RefreshList
        iTimerID = window.setInterval("RefreshList", 10000, "VBScript")
    End Sub
</SCRIPT>

Sub RefreshList {do something} End Sub
Teemu
  • 22,918
  • 7
  • 53
  • 106
Hyperjase
  • 127
  • 2
  • 21
  • Please show some code. – Teemu Apr 26 '13 at 05:26
  • Here's the VBScript: `` `Sub RefreshList` `{do something}` `End Sub` That's it in a nutshell, it reloads every 10 seconds but after sleep/hibernate it ends and won't restart (unless I reopen the gadget) Sorry, I keep trying to show this as code but when I try inserting 4 spaces, it just ignores it! – Hyperjase Apr 26 '13 at 09:24
  • Maybe `Refreshlist` triggers an error. Also afaik the third argument is ignored in IE8+. (BTW you can add a codefield by selecting the text for the code, then click `{}` in the editor.) – Teemu Apr 26 '13 at 09:45
  • Thanks, oddly the "VBScript" was required for it to work, it didn't run otherwise. This is running inside a HTA file, which I presume does actually used IE8. In VBScript would there be any way of detecting after sleep/hibernate? – Hyperjase Apr 26 '13 at 10:21

0 Answers0