MessageBox PROTO hwnd:DWORD, lpText:DWORD, lpCaption:DWORD,uType:DWORD
- hWnd 是父窗口的句柄。句柄代表您引用的窗口的一个地址指针。它的值对您编 Windows 程序并不重要(译者注:如果您想成为高手则是必须的),您只要知道它代表一个窗口。当您要对窗口做任何操作时,必须要引用该窗口的指针。
- lpText 是指向您要显示的文本的指针。指向文本串的指针事实上就是文本串的首地址。
- lpCaption 是指向您要显示的对话框的标题文本串指针。
- uType 是显示在对话框窗口上的小图标的类型。
-
下面是源程序
.386
.model flat,stdcall
option casemap:none
include windows.inc
include kernel32.inc
includelib kernel32.lib
include user32.inc
includelib user32.lib
.data
MsgBoxCaption db "Iczelion Tutorial No.2",0
MsgBoxText db "Win32 Assembly is Great!",0
.code
start:
invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK
invoke ExitProcess, NULL
end start