The MASM Forum
Projects => Easy Code IDE 32/64-bit => Topic started by: PaulIshak on July 29, 2012, 05:23:09 AM
-
Can someone help me out with a hello world sample? :icon_mrgreen:
-
include \masm32\include\masm32rt.inc
.code
main proc
print "abc",13,10
exit
main endp
end main
-
Thanks ;) How can I show hello world inside a message box when the button is clicked?
.Const
.Data?
.Data
.Code
Window1Procedure Proc hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
.If uMsg == WM_CREATE
.ElseIf uMsg == WM_COMMAND
.ElseIf uMsg == WM_CLOSE
Invoke IsModal, hWnd
.If Eax
Invoke EndModal, hWnd, IDCANCEL
Mov Eax, TRUE ;Return TRUE
Ret
.EndIf
.EndIf
Xor Eax, Eax ;Return FALSE
Ret
Window1Procedure EndP
Window1Button1 Proc hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
Xor Eax, Eax ;Return FALSE
Ret
Window1Button1 EndP
-
Hi PaulIshak,
Thanks fo using Easy Code!
Here is the code you asked for:
.Const
.Data?
.Data
.Code
Window1Procedure Proc hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
.If uMsg == WM_CREATE
.ElseIf uMsg == WM_COMMAND
LoWord wParam
.If Ax == IDC_WINDOW1_BUTTON1
HiWord wParam
.If Ax == BN_CLICKED
Invoke MessageBox, hWnd, TextAddr("Hello world!"), TextAddr("Title"), MB_OK
Return TRUE
.EndIf
.EndIf
.ElseIf uMsg == WM_CLOSE
Invoke IsModal, hWnd
.If Eax
Invoke EndModal, hWnd, IDCANCEL
Mov Eax, TRUE ;Return TRUE
Ret
.EndIf
.EndIf
Xor Eax, Eax ;Return FALSE
Ret
Window1Procedure EndP
Note that the procedure for Button1 (Window1Button1 Proc ...) has been removed as it is not needed.
Please read the help file for visual projects.
Regards,
Ramon
-
Awesome! :t Thank you rsala!
-
Whats going on with each line of code?