Does 'extern' allow me to access Win32API?

BlitzMax Forums/BlitzMax Programming/Does 'extern' allow me to access Win32API?

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 say 100% yes. Quick example:

Extern "win32"
	Function GetKeyboardState%(pbKeyState:Byte Ptr)
End Extern

Const VK_CAPITAL = $14
Const VK_NUMLOCK = $90
Const VK_SCROLL = $91
Const VK_INSERT = $2d

Global kbstate:Byte[256]

Graphics 640,480,0

Repeat
	Cls
	
	GetKeyboardState kbstate
	DrawText "Caps Lock = "+kbstate[VK_CAPITAL] , 10,20
	DrawText "Num Lock = "+kbstate[VK_NUMLOCK] , 10,40
	DrawText "Scroll Lock = "+kbstate[VK_SCROLL] , 10,60
	DrawText "Insert = "+kbstate[VK_INSERT] , 10,80
	
	Delay 5
	Flip
Until KeyHit(KEY_ESCAPE)

End