alaphate Posted January 8, 2009 Posted January 8, 2009 (edited) 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, 2009 by alaphate
mudlord Posted January 8, 2009 Posted January 8, 2009 (edited) 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, 2009 by mudlord
alaphate Posted January 8, 2009 Author Posted January 8, 2009 (edited) 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, 2009 by alaphate
mudlord Posted January 9, 2009 Posted January 9, 2009 I see what you want to do now. Thanks for the example.
alaphate Posted January 15, 2009 Author Posted January 15, 2009 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 }}
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now