Refer to the following two articlesArticleThe English dialog box is displayed on the Chinese system. I am very happy that this problem has plagued me for three days. Now we have finally solved the problem.
Key words: Using Hook Functions in C.
Http://www.codeproject.com/cpp/dMsgBox.asp
How to change the MessageBox window
Http://www.codeproject.com/cs/miscctrl/MessageBoxChk.asp
A "don't show this again" checkbox for the. NET MessageBox
Constructor
Public messageboxinternal ()
{
//
// Todo: Add constructor logic here
//
M_cbt = new localcbthook ();
M_cbt.windowcreated + = new localcbthook. cbteventhandler (wndcreated );
M_cbt.windowdestroyed + = new localcbthook. cbteventhandler (wnddestroyed );
M_cbt.windowactivated + = new localcbthook. cbteventhandler (wndactivated );
}
Private void wndcreated (Object sender, cbteventargs E)
{
If (E. isdialogwindow)
{
M_binit = false;
M_hwnd = E. Handle;
}
}
Private void wnddestroyed (Object sender, cbteventargs E)
{
If (E. Handle = m_hwnd)
{
M_binit = false;
M_hwnd = intptr. zero;
// If (bst_checked = (INT) sendmessage (m_hwndbtn, bm_getcheck, intptr. Zero, intptr. Zero ))
// M_bcheck = true;
}
}
Private void wndactivated (Object sender, cbteventargs E)
{
If (m_hwnd! = E. Handle)
Return;
// Not the first time
If (m_binit)
Return;
Else
M_binit = true;
If (thread. currentthread. currentuiculture. lcid = (new system. Globalization. cultureinfo ("En-us"). lcid)
{
Setdlgitemtext (m_hwnd, idok, "& OK ");
Setdlgitemtext (m_hwnd, idcancel, "& cancel ");
Setdlgitemtext (m_hwnd, idabort, "& abort ");
Setdlgitemtext (m_hwnd, idretry, "& retry ");
Setdlgitemtext (m_hwnd, idignore, "& ignore ");
Setdlgitemtext (m_hwnd, idyes, "& yes ");
Setdlgitemtext (m_hwnd, IDNO, "& No ");
}
}