Simple static control demo :
include StaticControl.inc
.data
ClassName db "WndClass",0
AppName db "Window",0
CtrlName db 'Static',0
text1 db 'This is a static control.',0
.data?
hInstance dd ?
.code
start:
invoke GetModuleHandle,0
mov hInstance,eax
invoke GetCommandLine
invoke WinMain,hInstance,0,eax,SW_SHOWDEFAULT
invoke ExitProcess,eax
WinMain PROC hInst:DWORD,hPrevInst:DWORD,CmdLine:DWORD,CmdShow:DWORD
LOCAL wc:WNDCLASSEX
LOCAL msg:MSG
LOCAL hwnd:DWORD
xor eax,eax
mov wc.cbSize,SIZEOF WNDCLASSEX
mov wc.style, CS_HREDRAW or CS_VREDRAW
mov wc.lpfnWndProc, OFFSET WndProc
mov wc.cbClsExtra,eax
mov wc.cbWndExtra,eax
push hInstance
pop wc.hInstance
mov wc.hbrBackground,COLOR_WINDOW+1
mov wc.lpszMenuName,eax
mov wc.lpszClassName,OFFSET ClassName
invoke LoadIcon,NULL,IDI_APPLICATION
mov wc.hIcon,eax
mov wc.hIconSm,eax
invoke LoadCursor,NULL,IDC_ARROW
mov wc.hCursor,eax
invoke RegisterClassEx,ADDR wc
xor eax,eax
mov ecx,100
invoke CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,\
WS_OVERLAPPEDWINDOW or WS_VISIBLE,ecx,\
ecx,500,400,eax,eax,\
hInst,eax
mov hwnd,eax
invoke UpdateWindow,hwnd
.WHILE TRUE
invoke GetMessage,ADDR msg,NULL,0,0
.BREAK .IF (!eax)
invoke TranslateMessage,ADDR msg
invoke DispatchMessage,ADDR msg
.ENDW
mov eax,msg.wParam
ret
WinMain ENDP
WndProc PROC hWnd:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
.IF uMsg==WM_DESTROY
invoke PostQuitMessage,NULL
.ELSEIF uMsg==WM_CREATE
mov eax,20
invoke CreateWindowEx,0,ADDR CtrlName,ADDR text1,\
WS_CHILD or WS_VISIBLE or SS_LEFT,\
eax,eax,240,160,hWnd,0,hInstance,0
.ELSE
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.ENDIF
xor eax,eax
ret
WndProc ENDP
END start