#COMPILE EXE
#DIM ALL

DECLARE FUNCTION GetStdHandle LIB "kernel32.dll" ALIAS "GetStdHandle" (BYVAL nStdHandle AS LONG) AS QUAD
DECLARE FUNCTION WriteFile LIB "kernel32.dll" ALIAS "WriteFile" (BYVAL hFile AS QUAD, BYVAL lpBuf AS ASCIIZ PTR, BYVAL nBytes AS LONG, BYREF lpWritten AS LONG, BYVAL lpOverlapped AS QUAD) AS LONG

FUNCTION PBMAIN() AS LONG
    LOCAL hOut AS QUAD
    LOCAL written AS LONG
    LOCAL msg AS STRING
    msg = "PBXA64 WinAPI Test OK"
    LOCAL stdOut AS LONG
    stdOut = -11
    hOut = GetStdHandle(stdOut)
    written = 0
    CALL WriteFile(hOut, STRPTR(msg), LEN(msg), written, 0)
    PRINT "Test1 PASSED"
    FUNCTION = 0
END FUNCTION
