程式語言 - Flat Assembler (FASM) - Win32 API - head.asm



    format PE GUI 4.0
    entry start
             
    include "c:\fasm\include\win32a.inc"
    include "c:\fasm\include\api\kernel32.inc"
    include "c:\fasm\include\api\gdi32.inc"
    include "c:\fasm\include\api\user32.inc"

    CLEARTYPE_QUALITY   equ 5
    DT_VCENTER          equ 4h
    DT_CENTER           equ 1h
    DT_SINGLELINE       equ 20h

    section ".idata" import data readable writeable
library \
        gdi32,      "gdi32.dll",    \
        user32,     "user32.dll",   \
        kernel32,   "kernel32.dll"

    section ".data" data readable writeable
szName          db "main",0
szFont          db "Arial",0
szMsg           db "Test",0
MsgLen          =  ($ - szMsg) - 1
hWin            dd 0
hInstance       dd 0
pCommand        dd 0
pDefWndProc     dd 0
pWndClass       WNDCLASS <0>
szBuf           db 255 dup(0)
FMT_KBD         db "Key: %d",0
FMT_MOUSE       db "%d-%d",0
FMT_TIMER       db "%d",0
dwCnt           dd 0
SLUP            db "LINE++",0
SLDN            db "LINE--",0
SPUP            db "PAGE++",0
SPDN            db "PAGE--",0