程式語言 - MASM32 - x64 - Single Document Interface (SDI) - Create Window



參考資訊:
https://www.masm32.com/

main.asm

    option casemap:none
  
include c:\masm64\include64\masm64rt.inc

    .data
szName      BYTE "main",0
hInstance   QWORD 0
pCmdLine    QWORD 0
wndClass    WNDCLASSEX <0>
      
    .code
WinMain proc hInst:QWORD, hPrevInst:QWORD, CmdLine:QWORD, CmdShow:QWORD
    local msg:MSG
 
    mov wndClass.cbSize, sizeof WNDCLASSEX
    mov rax, DefWindowProc
    mov wndClass.lpfnWndProc, rax
    lea rax, szName
    mov wndClass.lpszClassName, rax
    invoke RegisterClassEx, addr wndClass
   
    invoke CreateWindowEx, WS_EX_LEFT, addr szName, addr szName, WS_OVERLAPPEDWINDOW or WS_VISIBLE, 0, 0, 320, 240, NULL, NULL, NULL, NULL
   
@@:
    invoke GetMessage, addr msg, NULL, 0, 0
    cmp rax, 0
    je @f
    invoke DispatchMessage, addr msg
    jmp @b
 
@@:
    mov rax, msg.wParam
    ret
WinMain endp
    
start proc
    invoke GetModuleHandle, NULL
    mov hInstance, rax
      
    invoke GetCommandLine
    mov pCmdLine, rax
      
    invoke WinMain, hInstance, NULL, pCmdLine, SW_SHOWDEFAULT
    invoke ExitProcess, 0
start endp
end

完成