Hi to all :)
I would like to know how could I push literal text to a function...
for example, if I use a messagebox, the normal way is this:
invoke MessageBox, NULL, addr Message, addr Title, MB_OK
right?
but all I want to do is this:
invoke MessageBox, NULL, "lalalalal =D", "my title :D", MB_OK
I've tested a macro made by myself but it doesn't work :/
T MACRO TEXT
.data
Text_ byte MAX_PATH dup (?)
.code
mov eax, sizeof TEXT
xor edi, edi
.repeat
mov bl, byte ptr TEXT
mov byte ptr [Text_+edi], bl
inc edi
.until edi == eax
push offset Text_
ENDM
I was using it like this:
T <"ABC">
But I got an error xD
Anyone can help me?
I would appreciate your help :)
Thanks in advance ;)
Germain,
Have a look at the available macros for simplifies text handling.
fn MessageBox,hWnd."Text Message","Title",MB_OK
; or
mov var, rv(MessageBox,hWnd."Text Message","Title",MB_YESNO)
You must have the macros.asm file included to use them.
God I hate these new keyboards. !!!!
In GoAsm you can do this :
invoke MessageBox, NULL,"Test1","Title",MB_OK
Also, I've made a macro :
MBox(%lpText,%lpTitle) MACRO
INVOKE MessageBox,0,addr %lpText,addr %lpTitle,MB_OK
ENDM
So I can quickly do :
MBox("Text1",addr sz_title)
or
MBox("Text1","MyTitle")
invoke MessageBox, NULL, chr$("lalalalal =D"), chr$("my title :D"), MB_OK
Quote from: BlackVortex on March 13, 2010, 08:15:47 AM
In GoAsm you can do this :
invoke MessageBox, NULL,"Test1","Title",MB_OK
Also, I've made a macro :
MBox(%lpText,%lpTitle) MACRO
INVOKE MessageBox,0,addr %lpText,addr %lpTitle,MB_OK
ENDM
So I can quickly do :
MBox("Text1",addr sz_title)
or
MBox("Text1","MyTitle")
Thanks to all :P
I liked your macro :dance: