Windows API

BlitzMax Forums/BlitzMax Beginners Area/Windows API

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Global SetSystemPowerState:Int(fSuspend, fForce) "win32"
Global GetLastError:Int() "win32"


lib = LoadLibraryA ("kernel32.dll")
If lib
	SetSystemPowerState = GetProcAddress(lib, "SetSystemPowerState")
	GetLastError=GetProcAddress(lib, "GetLastError")

Else
   Print "Dead"; End
EndIf

SetSystemPowerState(False,False)
e=GetLastError()
Print e

ERROR_PRIVILEGE_NOT_HELD=1314!

do enjoy the windows api it is *such* a joy to use NOT!!! lol