xManh Posted October 18, 2006 Share Posted October 18, 2006 Please help me how to make the computer goes to stand by. I found shutdown function but it only supports shutdown, restart, hibernate... but not stand by Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted October 18, 2006 Share Posted October 18, 2006 i do think 64 is hibernate in the help file 0 = Logoff 1 = Shutdown 2 = Reboot 4 = Force 8 = Power down 32= Suspend 64= Hibernate Link to comment Share on other sites More sharing options...
Micha1405 Posted October 18, 2006 Share Posted October 18, 2006 ;Standby like this SetSuspend() Func SetSuspend($mode=true,$force=true) $result = DllCall("PowrProf.dll", "long", "SetSuspendState", "long",$mode, "long",$force, "long", false) EndFunc My TrayToolBar Link to comment Share on other sites More sharing options...
The Kandie Man Posted October 18, 2006 Share Posted October 18, 2006 ;Standby like this SetSuspend() Func SetSuspend($mode=true,$force=true) $result = DllCall("PowrProf.dll", "long", "SetSuspendState", "long",$mode, "long",$force, "long", false) EndFunc Not really necessary. All you need to do is this: Shutdown(4+32);4 is to force it and 32 is to set it in standby(also known as suspend) "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
xManh Posted October 18, 2006 Author Share Posted October 18, 2006 I'm sorry but but your all solutions don't workFunc SetSuspend($mode=true,$force=true)$result = DllCall("PowrProf.dll", "long", "SetSuspendState", "long",$mode, "long",$force, "long", false)EndFuncThis perform system hibernate which is different from standby@The Kandie ManShutdown(4+32) does not make the computer standby too Link to comment Share on other sites More sharing options...
Micha1405 Posted October 18, 2006 Share Posted October 18, 2006 (edited) you must call the function first ! ;Standby like this SetSuspend() Func SetSuspend($mode=true,$force=true) $result = DllCall("PowrProf.dll", "long", "SetSuspendState", "long",$mode, "long",$force, "long", false) EndFunc for me (XP system) it works ! Compile it and start it Edited October 18, 2006 by Micha1405 My TrayToolBar Link to comment Share on other sites More sharing options...
The Kandie Man Posted October 18, 2006 Share Posted October 18, 2006 I'm sorry but but your all solutions don't work This perform system hibernate which is different from standby @The Kandie Man Shutdown(4+32) does not make the computer standby too My apologies. Upon closer inspection i found that the function doesn't allow a forced suspend(aka standby). All you needed to do to fix the code remove the 4. Shutdown(32) "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
xManh Posted October 19, 2006 Author Share Posted October 19, 2006 @Micha1405 I have copied and compiled your code but It still hibernated. I'm using Xp sp2 too. May be there is wrong in the parameters? @The Kandie Man Shutdown(32) works well, thank you very much Link to comment Share on other sites More sharing options...
Micha1405 Posted October 19, 2006 Share Posted October 19, 2006 (edited) @Micha1405 I have copied and compiled your code but It still hibernated. I'm using Xp sp2 too. May be there is wrong in the parameters? @The Kandie Man Shutdown(32) works well, thank you very much may be the settings @ power option are diffrent ?!? I use this on my notebook and it works ! Hibernate is deactivated on my Notebook Edited October 19, 2006 by Micha1405 My TrayToolBar Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now