Ok, I finally wrote my first successful ASM program, which is below.
My question is this - how do I find out what button ( yes/no/cancel ) the user pressed? Where is this information stored? According to the Win32API:
If the function succeeds, the return value is one of the following menu-item values returned by the dialog box:
Value Meaning
IDABORT Abort button was selected.
IDCANCEL Cancel button was selected.
IDIGNORE Ignore button was selected.
IDNO No button was selected.
IDOK OK button was selected.
IDRETRY Retry button was selected.
IDYES Yes button was selected.
If a message box has a Cancel button, the function returns the IDCANCEL value if either the ESC key is pressed or the Cancel button is selected. If the message box has no Cancel button, pressing ESC has no effect.
How do I have another message box come up and tell me what I chose?
Thanks in advance. As you can see, I am really new at this - yesterday to be exact.
Regards,
Trope
My question is this - how do I find out what button ( yes/no/cancel ) the user pressed? Where is this information stored? According to the Win32API:
If the function succeeds, the return value is one of the following menu-item values returned by the dialog box:
Value Meaning
IDABORT Abort button was selected.
IDCANCEL Cancel button was selected.
IDIGNORE Ignore button was selected.
IDNO No button was selected.
IDOK OK button was selected.
IDRETRY Retry button was selected.
IDYES Yes button was selected.
If a message box has a Cancel button, the function returns the IDCANCEL value if either the ESC key is pressed or the Cancel button is selected. If the message box has no Cancel button, pressing ESC has no effect.
How do I have another message box come up and tell me what I chose?
Thanks in advance. As you can see, I am really new at this - yesterday to be exact.
Regards,
Trope
Code:
Here is my code so far:
.386
.model flat, stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\gdi32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\gdi32.lib
.data
MsgCaption db "My Window Caption",0
MsgBoxText db "My First Program!",0
.code
start:
invoke MessageBox, NULL,addr MsgBoxText, addr MsgCaption, MB_YESNOCANCEL
invoke ExitProcess,NULL
end start