程式語言 - FreeBASIC - Win32 API - Hello, world!



參考資訊:
https://www.freebasic.net/
https://sourceforge.net/projects/fbc/files/

main.bas

#include once "windows.bi"
 
declare function WinMain(byval hInst as HINSTANCE, _
    byval hPrevInst as HINSTANCE, _
    byval szCmdLine as zstring ptr, _
    byval dwCmdShow as integer) as integer
end WinMain(GetModuleHandle(null), null, Command(), SW_NORMAL)
 
function WinMain(byval hInst as HINSTANCE, _
    byval hPrevInst as HINSTANCE, _
    byval szCmdLine as zstring ptr, _
    byval dwCmdShow as integer) as integer
 
    MessageBox(null, "Hello, world!", "main", MB_OK)
    return 0
end function

編譯、執行

$ export WINEPREFIX=/home/user/.wine_x86

$ box86 wine fbc32 main.bas
$ box86 wine main.exe

完成