The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Magnum on February 20, 2011, 01:07:47 PM

Title: Insomnia project
Post by: Magnum on February 20, 2011, 01:07:47 PM
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
Title: Re: Insomnia project
Post by: dedndave on February 20, 2011, 01:35:33 PM
is there a reason for not using Control Panel/Power Options/Power Schemes
you can create custom themes and switch between them
Title: Re: Insomnia project
Post by: Magnum on February 20, 2011, 02:19:07 PM
Can I just double click to switch back and forth?

Andy
Title: Re: Insomnia project
Post by: dedndave on February 20, 2011, 02:41:27 PM
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
Title: Re: Insomnia project
Post by: Magnum on February 20, 2011, 03:30:12 PM
For now, I will work with SetThreadExecutionState.

It looks easier to get functional.

Andy