get the last nagoa.inc update for nasm

http://visual-assembler.pt.vu
or
http://194.65.3.199/win32asm/

thanks hgb for this new macros !!!
==========================
here an example of iczelion 5 tutorial
==========================

%include '\lab\vasm\inc\nagoa.inc'




;declaring here the function we made
;------------------------------------

def WinMain
def WndProc

..start:
call GetModuleHandle, NULL
var Instance, 4
mov dword, eax
call WinMain, , NULL, NULL, SW_SHOWDEFAULT
call ExitProcess, eax


; the funct parameters and locals (stack) used are preceded by a ;point

funct WinMain, hInstanceARG, hPrevInstance, lpCmdLine, nCmdShow

sizef 32 ; <---- leave this value empty
; nasm will give a message with
; the name of the function and
; the right size value !

local hwnd, 4,msg,MSG ; var?s using the stack
var wc, WNDCLASSEX ; data declared var


mov dword, WNDCLASSEX_size
mov dword, CS_VREDRAW | CS_HREDRAW
mov dword,WinProc
mov dword, NULL
mov dword, NULL
m2m dword,[.hInstanceARG]
mov dword,COLOR_WINDOW+1
mov dword, NULL
var ClassName , "Nagoa window",source ;-----> string data declared
mov dword, ClassName
call LoadIconA, NULL, IDI_APPLICATION
mov dword, eax
mov dword, eax
call LoadCursor, NULL, IDC_ARROW
mov dword, eax
call RegisterClassEx, wc

call CreateWindowEx, NULL,ClassName, "Aplication", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL,, NULL

mov dword[.hwnd], eax
call ShowWindow, [.hwnd], [.nCmdShow]
call UpdateWindow, [.hwnd]

.Messageloop
lea eax,[.msg] ; get the effective adress
call GetMessageA,eax, NULL, 0, 0
test eax, eax
je .Fim
cmp eax, -1
je .erro
lea eax,[.msg]
call TranslateMessage,eax
lea eax,[.msg]
call DispatchMessageA,eax
jmp .Messageloop

.Fim
mov eax, [.msg+MSG.wParam]
return
.erro
endfunct

funct WinProc, hWnd, uMsg, wParam, lParam

sizef 72
local hdc, 4
local ps, PAINTSTRUCT
local hfont, 4

;=============================================
mov eax, dword[.uMsg]
cmp eax, WM_PAINT
JE .WM_PAINT
cmp eax, WM_DESTROY
je .WM_DESTROY
;==========================================
call DefWindowProc, [.hWnd], [.uMsg], [.wParam],[.lParam]
return
;==========================================
.WM_DESTROY:
call PostQuitMessage, 0
return
;==========================================
.WM_PAINT:
lea eax, [.ps]
call BeginPaint, [.hWnd], eax
mov dword[.hdc], eax
call CreateFont, 24,16,0,0,400,0,0,0,OEM_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SCRIPT,"script"
call SelectObject, [.hdc], eax
mov dword[.hfont], eax
RGB 200, 200, 60
call SetBkColor, [.hdc],eax
RGB 0, 10, 200
call SetTextColor, eax
call TextOut, [.hdc],0,0,"Nasm Rocks", 11
call SelectObject, [.hdc], [.hfont]
lea eax, [.ps]
call EndPaint, [.hWnd], eax
return
;========================================
endfunct
Posted on 2003-03-03 21:19:21 by Nguga