Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
Hi,
 
I saw this article today:
 
http://www.codeguru.com/cpp/w-p/win32/messagebox/article.php/c10873/MessageBox-with-Custom-Button-Captions.htm[^]
 
And it works like a champ!
 
I was wondering if it was also then possible while the MessageBox was hooked, to widen the buttons that recieve the new text just a bit to display a somewhat larger string.
 
Thanks.
 
:ron
Posted 29-Jan-13 6:34am
Comments
Ron Anders at 29-Jan-13 13:25pm
   
Thanks, I did that early this morning. I guess I have to wait for the mods over there.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Check it :
 
static LRESULT __stdcall ChangeCaptions(int nCode, WPARAM wParam, LPARAM lParam)
{
    if (nCode == HCBT_ACTIVATE) {
        SetWindowText(GetDlgItem((HWND) wParam, IDOK), L10N(GUI_OK_MSG));
        SetWindowText(GetDlgItem((HWND) wParam, IDCANCEL), L10N(GUI_CANCEL_MSG));
        SetWindowText(GetDlgItem((HWND) wParam, IDYES), L10N(GUI_YES_MSG));
        SetWindowText(GetDlgItem((HWND) wParam, IDNO), L10N(GUI_NO_MSG));
    }
    return 0;
}
 
int addon_gui_messagebox(HWND parentHWnd, HINSTANCE hInstance, void *text, void *caption, int type)
{
    int ret;
    hook = SetWindowsHookEx(WH_CBT, ChangeCaptions, hInstance, GetCurrentThreadId());
    ret = MessageBox(parentHWnd, text, caption, type);
    UnhookWindowsHookEx(hook);
    return ret;
}
  Permalink  
Comments
Ron Anders at 1-Feb-13 8:12am
   
Thank you. I'll give it a go.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 710
1 OriginalGriff 543
2 Abhinav S 318
3 thatraja 245
4 Emre Ataseven 170
0 Sergey Alexandrovich Kryukov 8,322
1 OriginalGriff 4,790
2 Peter Leow 3,784
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 1 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid