Hey i just work around with masm trying to figure out marcos. How do i make a simple marco to get Text string and out put that to messageBox?
dbMsg_Capt db 'Caption',0
TextMsg_buff db ?
TextMsg MACRO Text:VARARG
mov eax,Text
mov TextMsg_buff,eax
invoke MessageBox,hWin,addr TextMsg_buff,addr dbMsg_Capt,MB_OK
endm
:bg
Try and existing one.
fn MessageBox hWnd,"Howdy, I am a message box","The Title",MB_OK
Inclusde the masm32 macro file and you can use all of them.
If its just a quick messagebox thing, you could base it on the CTEXT macro found in the MASM32: (masm32\macros\macros.asm)
CTEXT macro Text
local szText
.data
szText byte Text, 0
.code
exitm <offset szText>
endm
TextMsg MACRO Text
LOCAL __TextMsg_buff
.data
__TextMsg_buff db Text,0
.code
invoke MessageBox,hWin,addr__TextMsg_buff,addr dbMsg_Capt,MB_OK
EXITM <eax>
ENDM
with your dbMsg_Capt db 'Caption',0 being defined in the main .data section of your asm file.