Here is an example of a message box displaying a customized button. The demo is based on the article :
http://www.catch22.net/tuts/msgbox.asp
#include "CustMsgBox.inc"
.data
msg1 db 'This is a customized message box',0
capt db 'Hello!',0
buttontext db 'Click here',0
hMboxHook dd ?
pButtonText dd ?
.code
start:
invoke CustomMsgBox,0,ADDR msg1,ADDR capt,ADDR buttontext
invoke ExitProcess,0
mboxCBTProc FRAME nCode,wParam,lParam
cmp d[nCode],0
jb >
cmp d[nCode],HCBT_ACTIVATE
jne >
invoke GetDlgItem,[wParam],IDOK
invoke SetWindowText,eax,[pButtonText]
xor eax,eax
ret
:
invoke CallNextHookEx,[hMboxHook],[nCode],[wParam],[lParam]
ret
ENDF
CustomMsgBox FRAME hWnd,message,caption,buttontext
mov eax,[buttontext]
mov [pButtonText],eax
invoke GetCurrentThreadId
invoke SetWindowsHookEx,WH_CBT,ADDR mboxCBTProc,NULL,eax
mov [hMboxHook],eax
invoke MessageBox,0,[message],[caption],MB_OK
invoke UnhookWindowsHookEx,[hMboxHook]
ret
ENDF
[attachment deleted by admin]
Here is the GoAsm version of the demo where the message box is moved to a thread.
[attachment deleted by admin]
Great stuff Vortex - thanks!
Simplified code to detect the message box.