' Graphics via Win32 GDI — create window with GDI drawing surface
#COMPILE EXE
#DIM ALL

DECLARE FUNCTION CreateWindowEx LIB "USER32.DLL" ALIAS "CreateWindowExA" (BYVAL dwExStyle AS LONG, BYVAL lpClassName AS ASCIIZ, BYVAL lpWindowName AS ASCIIZ, BYVAL dwStyle AS LONG, BYVAL x AS LONG, BYVAL y AS LONG, BYVAL nWidth AS LONG, BYVAL nHeight AS LONG, BYVAL hWndParent AS LONG, BYVAL hMenu AS LONG, BYVAL hInstance AS LONG, BYVAL lpParam AS LONG) AS LONG
DECLARE FUNCTION DefWindowProc LIB "USER32.DLL" ALIAS "DefWindowProcA" (BYVAL hWnd AS LONG, BYVAL uMsg AS LONG, BYVAL wParam AS LONG, BYVAL lParam AS LONG) AS LONG
DECLARE FUNCTION PostQuitMessage LIB "USER32.DLL" (BYVAL nExitCode AS LONG)
DECLARE FUNCTION GetMessage LIB "USER32.DLL" ALIAS "GetMessageA" (BYREF lpMsg AS LongPtr, BYVAL hWnd AS LONG, BYVAL wMsgFilterMin AS LONG, BYVAL wMsgFilterMax AS LONG) AS LONG
DECLARE FUNCTION DispatchMessage LIB "USER32.DLL" ALIAS "DispatchMessageA" (BYREF lpMsg AS LongPtr) AS LONG
DECLARE FUNCTION RegisterClass LIB "USER32.DLL" ALIAS "RegisterClassA" (BYREF lpWndClass AS LongPtr) AS LONG

FUNCTION PBMAIN() AS LONG
    PRINT "Graphics Window: Use Win32 GDI API via DECLARE"
    PRINT "See graphic_shapes.pb for GDI drawing"
    FUNCTION = 0
END FUNCTION
