Normal
Well I have come up with something that works. It is very dirty and brutal but does the job. I tried other methods, such as SetThreadExecutionState to no avail - despite the DLL appearing to call and report success, it seemed to have no effect at all.So here is what I have:Three Autohotkey (AHK) Scripts.Wake Up.Exe is called by Task Scheduler, triggered by a power state change message. This therefore kicks in if the computer is woken up from sleepStart MP.Exe is scheduled to run at start up and is the "main" controller programme. It is also called by Wake Up.Exe to make sure everything starts afresh on wake.Dummy Process.Exe is exactly as it sounds it does nothing. It is run by Start MP if the computer was woken with the power button or switched on by the user. The key is to tell PowerScheduler not to shut down if "Dummy Process" is running and you can do that in the PowerScheduler configuration in TV Server.I include the compiled exe programmes and the ahk scripts for you to examine in notepad. There are other things in those, such as the switching on of my Energenie Sockets and the hiding of the mouse pointer (the latter which I cannot take full credit for at all, I just did the bit which repositions it to where it was when the mouse was disabled)I have left the failed experiments in the scripts as comments, in case anyone can tidy this up and make it work with the DLLs which would be much tidier.The original idea which I would still like to pursue if possible is to detect if TV recording has stopped, and send the PC to sleep if it wasn't switched on with the power button. Sadly, while the AHK DllCall function finds the DLL, it can't find the command that reports if any card is recording. It may be a privileges issue, or maybe it is a 32 bit issue. I just don't know, that is beyond my powers.
Well I have come up with something that works. It is very dirty and brutal but does the job. I tried other methods, such as SetThreadExecutionState to no avail - despite the DLL appearing to call and report success, it seemed to have no effect at all.
So here is what I have:
Three Autohotkey (AHK) Scripts.
Wake Up.Exe is called by Task Scheduler, triggered by a power state change message. This therefore kicks in if the computer is woken up from sleep
Start MP.Exe is scheduled to run at start up and is the "main" controller programme. It is also called by Wake Up.Exe to make sure everything starts afresh on wake.
Dummy Process.Exe is exactly as it sounds it does nothing. It is run by Start MP if the computer was woken with the power button or switched on by the user. The key is to tell PowerScheduler not to shut down if "Dummy Process" is running and you can do that in the PowerScheduler configuration in TV Server.
I include the compiled exe programmes and the ahk scripts for you to examine in notepad. There are other things in those, such as the switching on of my Energenie Sockets and the hiding of the mouse pointer (the latter which I cannot take full credit for at all, I just did the bit which repositions it to where it was when the mouse was disabled)
I have left the failed experiments in the scripts as comments, in case anyone can tidy this up and make it work with the DLLs which would be much tidier.
The original idea which I would still like to pursue if possible is to detect if TV recording has stopped, and send the PC to sleep if it wasn't switched on with the power button. Sadly, while the AHK DllCall function finds the DLL, it can't find the command that reports if any card is recording. It may be a privileges issue, or maybe it is a 32 bit issue. I just don't know, that is beyond my powers.