News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Insomnia project

Started by Magnum, February 20, 2011, 01:07:47 PM

Previous topic - Next topic

Magnum

I am trying to make a program similar to insomnia so I don't lose any more large downloads
when my hard drive goes to reduced power mode.


; invoke CreateThread ; may need this

invoke SetThreadExecutionState,ES_CONTINUOUS
invoke Sleep,30000 ; this is probably counter productive

invoke ExitProcess,0


end start
Have a great day,
                         Andy

dedndave

is there a reason for not using Control Panel/Power Options/Power Schemes
you can create custom themes and switch between them

Magnum

Can I just double click to switch back and forth?

Andy
Have a great day,
                         Andy

dedndave

well - i guess if you want to do that, you can make the themes in control panel
then use SetActivePwrScheme using powrprof.inc/lib

i guess they are "schemes" - not "themes" - lol

other functions...
EnumPwrSchemes
GetActivePwrScheme

there are more - see powrprof.inc

Magnum

For now, I will work with SetThreadExecutionState.

It looks easier to get functional.

Andy
Have a great day,
                         Andy