"GovBob" <x@no.email> wrote in message news:1173976818521-492443@exchange.ni.com...
Sorry about hijacking this thread but my question might be relevant. Is there a way to disable the sleep mode of a laptop in the vi? Perhaps through ActiveX? Does anyone know the correct call to make?
You can set and modify power schemes, with a few functions (SetActivePowerScheme), but those functions are nasty. I'd use a c program as a wrapper, in LabVIEW it will be very difficult to get working.
There is an easier function, that applications can use to prevent the computer from going to sleep mode. This function, SetThreadExecutionState, has four flags (one parameter, bitwise complementairy) that inform the system if the system is needed, if a display is needed, etc. Look it up at the msdn (or simply google). Using this, you could even tell the laptop to enter sleep mode when the application is done.
Regards,
Wiebe.