▼ 2014/5/15 (木) 12:10:26 LR4 | |
Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0 |
Index: sakura_core/util/MessageBoxF.cpp
===================================================================
--- sakura_core/util/MessageBoxF.cpp (リビジョン 3706)
+++ sakura_core/util/MessageBoxF.cpp (作業コピー)
@@ -40,6 +40,25 @@
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- //
// メッセージボックス:実装 //
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- //
+int Wrap_MessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType)
+{
+ static int (WINAPI *RealMessageBox)(HWND, LPCTSTR, LPCTSTR, UINT, WORD);
+ static HMODULE hMod = NULL;
+ if( hMod == NULL ){ // 初期化されていない場合は初期化する
+ hMod = GetModuleHandle(_T("USER32"));
+#ifdef _UNICODE
+ *(FARPROC *)&RealMessageBox = GetProcAddress(hMod, "MessageBoxExW");
+#else
+ *(FARPROC *)&RealMessageBox = GetProcAddress(hMod, "MessageBoxExA");
+#endif
+ }
+
+ // lpText, lpCaption をローカルバッファにコピーして MessageBox API を呼び出す
+ // ※ 使い回しのバッファが使用されていてそれが裏で書き換えられた場合でも
+ // メッセージボックス上の Ctrl+C が文字化けしないように
+ return RealMessageBox(hWnd, std::tstring(lpText).c_str(), std::tstring(lpCaption).c_str(), uType, CSelectLang::getLangId());
+}
+
HWND GetMessageBoxOwner(HWND hwndOwner)
{
if(hwndOwner==NULL && g_pcEditWnd){
|
|