how do you do this?? instead of ICON_INFORMATION, etc etc..
you load your own icon on the messagebox
or you just create a child window?
Can't be done in a normal message box. Give the following code a blast, you can set your own icon this way.
; ¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤
MessageBoxI proc hParent:DWORD,lpMsg:DWORD,
lpTitle:DWORD,dlgStyle:DWORD,iconID:DWORD
LOCAL mbp:MSGBOXPARAMS
mov mbp.cbSize, SIZEOF MSGBOXPARAMS
mov eax, hParent
mov mbp.hwndOwner, eax
mov eax, hInstance
mov mbp.hInstance, eax
mov eax, lpMsg
mov mbp.lpszText, eax
mov eax, lpTitle
mov mbp.lpszCaption, eax
mov eax, dlgStyle
or eax, MB_USERICON
mov mbp.dwStyle, eax
mov eax, iconID
mov mbp.lpszIcon, eax
mov mbp.dwContextHelpId, NULL
mov mbp.lpfnMsgBoxCallback, NULL
mov mbp.dwLanguageId, NULL
invoke MessageBoxIndirect,ADDR mbp
ret
MessageBoxI endp
; ¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤=÷=¤
Thanks hutch-- ,will try it :U
Hutch, you should add this procedure to masm32.lib :U
Erol,
I was supposed to, I just forgot. ::)
Hutch,
I added the missing hInstance parameter to your procedure :
MessageBoxI PROC hInstance:DWORD,hParent:DWORD,lpMsg:DWORD,lpTitle:DWORD,\
dlgStyle:DWORD,iconID:DWORD
Attached is a quick example.
[attachment deleted by admin]
Thanks Vortex! :U
Vortex is right, I normally set hInstance as a global but it should properly be self contained so it remains as close as possible to the normal MesageBox API call. I have attached a simple demo on how it works with the minor change.
[attachment deleted by admin]