Created
November 22, 2012 13:12
-
-
Save tuttlem/4131110 to your computer and use it in GitHub Desktop.
MessageBox Masm Body
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ######################################################################### | |
.code | |
start: | |
invoke GetModuleHandle, NULL ; provides the instance handle | |
mov hInstance, eax | |
invoke GetCommandLine ; provides the command line address | |
mov szCommandLine, eax | |
; actually invoke the windows entry point for the application | |
invoke WinMain,hInstance,NULL,szCommandLine,SW_SHOWDEFAULT | |
invoke ExitProcess,eax ; cleanup & return to operating system | |
; ######################################################################### | |
; The application's entry point (according to windows) | |
WinMain proc hInst :DWORD, | |
hPrevInst :DWORD, | |
CmdLine :DWORD, | |
CmdShow :DWORD | |
; declare some variables to use | |
szText szDialogTitle, "First example" | |
szText szMessageText, "This is masm32 at work!" | |
; show the message box | |
invoke MessageBox, 0, ADDR szDialogTitle, ADDR szMessageText, MB_OK | |
; exit this function with success (eax == 0) | |
xor eax, eax | |
ret | |
WinMain endp | |
end start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment