' DECLARE — Win32 API: GetModuleHandle, MessageBox
#COMPILE EXE
#DIM ALL

DECLARE FUNCTION GetModuleHandle LIB "KERNEL32.DLL" ALIAS "GetModuleHandleA" (BYVAL lpModuleName AS ASCIIZ) AS LONG
DECLARE FUNCTION MessageBox LIB "USER32.DLL" ALIAS "MessageBoxA" (BYVAL hWnd AS LONG, BYVAL lpText AS ASCIIZ, BYVAL lpCaption AS ASCIIZ, BYVAL uType AS LONG) AS LONG

FUNCTION PBMAIN() AS LONG
    LOCAL hMod AS LONG
    hMod = GetModuleHandle("")
    MessageBox(0, "Hello from declared API!", "WinAPI Demo", 0)
    FUNCTION = 0
END FUNCTION
