;关于函数的返回值,也就是你选择了哪个按钮,有待进一步的研究。
.386
.model flat,stdcall
option casemap:none
include windows.inc

include kernel32.inc
includelib kernel32.lib
 
include user32.inc
includelib user32.lib
 
.code
szSoftModalMessageBox db "SoftModalMessageBox",0
szuser32 db "user32.dll",0

huser32 dd 0
pSoftModalMessageBox dd 0

align 4

u_ok dw 'o','k',0
u_no dw 'n','o',0

bufid dword 1,2;,0 ;按钮id的序列,可以增加。也可以一个按钮也没有哟!最多支持有多少个按钮,你可以试一下!
bufstr dword offset u_ok,offset u_no;,0 ;按钮的内容,可以增加。

szCaption dw 'm','a','d','e',' ','b','y',' ','c','o','r','r','e','y',0
szText dw 'W','e','l','l','c','o','m','e',' ','t','o',' ','H','t','t','p',':','/','/','c','o','r','r','e','y','.','w','e','b','s','.','c','o','m',0

align 4 ;最好加上,不加也没有事。
mbd dd 28h ;sizeof MSGBOXPARAMS
    dd 0 ;hwndOwner
    dd 0 ;hInstance
    dd offset szText ;lpszText
    dd offset szCaption ;lpszCaption
    dd 0 ;dwStyle
    dd 0 ;lpszIcon
    dd 0 ;dwContextHelpId
    dd 0 ;lpfnMsgBoxCallback
    dd 0 ;dwLanguageId
    ;MSGBOXPARAMS 结构结束。一下是附加的定义的结构。
    dd 0 ;pwndOwner
    dd 0 ;wLanguageId
    ;dd 0 ;windows 7-64下要加这一行,可能结构变了,不然:不会显示按钮,具体的啥功能我也不知道,还没有实验。
          ;因为这个,我浪费了大半天的时间。在非windows 7-64操作系统下要去掉这一行。版权归我所有,我的新发现。
    dd offset bufid ;pidButton
    dd offset bufstr ;ppszButtonText
    dd 2 ;cButtons 按钮的数量。
    dd 0 ;DefButton 默认的按钮。
    dd 1 ;CancelId 0 1
    dd -1 ;Timeout
    ;注释:下面这个是我自己附加的。
    dd 0 ;奇哉怪哉,这样点击就不会出错了,下面的加align 4也不行。自己的新发现,必须加这一行。
    
align 4
psi SYSTEM_INFO <> 

start:
align 4

invoke LoadLibrary,addr szuser32
mov huser32,eax

invoke GetProcAddress,huser32,addr szSoftModalMessageBox
mov pSoftModalMessageBox,eax

pushad
;pushf

push offset mbd
call pSoftModalMessageBox

;popf
popad
 
exit:invoke ExitProcess,0
end start
;made at 2011.08.17

上传的附件 SoftModalMessageBox.rar