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.

I'm trying to get BlitzMax to call a Windows API function, without much success... Anyone can shed some light on what I need to do here?

Global SetSystemPowerState(fSuspend, fForce) "win32"

lib = LoadLibraryA ("kernel32.dll")
If lib
   SetSystemPowerState = GetProcAddress(lib, "SetSystemPowerStateA")
Else
   Print "Dead"; End
EndIf

SetSystemPowerState(0,0)


It compiles without error, but attempting to run it returns the error: Attempt to call uninitialized function pointer

Any help would be appreciated!