Posted January 8, 200916 yr I found a article about how to change the button text of MessageBox.http://www.codeguru.com/cpp/w-p/win32/mess...icle.php/c10873Could Any buddy tell me how to draw MessageBox buttons?Such as IDOK button IDCANCEL buttonI know how to make these buttons to OWNERDRAW buttons in CBTProc hook procedure.i.e. SendMessage(hMB,BM_SETSTYLE,BS_OWNERDRAW,TRUE);However, I don't figure out how to draw these buttons.Thanks for help. Edited January 8, 200916 yr by alaphate
January 8, 200916 yr Okay....int ConfirmPatching(HWND hwnd, LPCSTR lpstrText){ int msgboxID = MessageBox( hwnd, lpstrText, "Confirm Patching?", MB_ICONEXCLAMATION | MB_YESNO ); if (msgboxID == IDYES) { } return msgboxID; }http://msdn.microsoft.com/en-us/library/ms...spx#message_box Edited January 8, 200916 yr by mudlord
January 8, 200916 yr Author mudlord, you might misunderstand my opinion.Here's a example of my application.cpp, c language is perferred. Thanks a lot.bmpBtn.zip Edited January 8, 200916 yr by alaphate
January 15, 200916 yr Author I figured out how to change the MessageBox's button style.Use:SetWindowsHookEx(WH_CALLWNDPROC, &CallWndProc, 0, GetCurrentThreadId());LRESULT CALLBACK CallWndProc(INT nCode, WPARAM wParam, LPARAM lParam) { CWPSTRUCT *pMsg= (CWPSTRUCT *)lParam; switch (pMsg->message) { case WM_DRAWITEM: //draw Buttons here }}
Create an account or sign in to comment