Hello,
I am working on a simple program that pops up a message box that displays OK and NO.. i was just wondering what to look for to tell what option the user clicked on. Im sure i could figure it out if i knew what to look for... any help is appreciated Thanks
Dug
I am working on a simple program that pops up a message box that displays OK and NO.. i was just wondering what to look for to tell what option the user clicked on. Im sure i could figure it out if i knew what to look for... any help is appreciated Thanks
Dug
Afternoon, zealott.
test eax for IDOK or IDNO.
Cheers,
Scronty
test eax for IDOK or IDNO.
Cheers,
Scronty
Im new to this flavor of assembly (used to 16bit assembly) but anyway would you give an example please... also handy would be in what method this would go in.. my guess would be right after the message box is created, but then again im not that sure.. thanks agian for the help
[size=9]
.586
.MODEL FLAT, STDCALL
OPTION CASEMAP:NONE
INCLUDE \masm32\include\windows.inc
INCLUDE \masm32\include\kernel32.inc
INCLUDELIB \masm32\lib\kernel32.lib
INCLUDE \masm32\include\user32.inc
INCLUDELIB \masm32\lib\user32.lib
.CODE
Yes DB "You clicked Yes.", 0
No DB "You clicked No.", 0
Start:
invoke MessageBox, 0, 0, 0, MB_YESNO
cmp eax, IDYES
jne @@UserClickedNo
invoke MessageBox, 0, OFFSET Yes, 0, 0
jmp @@ExitProgram
@@UserClickedNo:
invoke MessageBox, 0, OFFSET No, 0, 0
@@ExitProgram:
invoke ExitProcess, 0
END Start[/size]
:)
Thanks.. very extremely helpful
hehe
hehe
Just remember: after any win32 api call the return value will always be in EAX. To make sure you know what to check on those returned values on every win32 api calls, there are online win32 reference or get the platform SDK.