Windows API

BlitzMax Forums/BlitzMax Beginners Area/Windows API

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, 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