LRESULT CALLBACK MsgBoxCBTProc(int nCode, WPARAM wParam, LPARAM lParam) { ?? ?TCHAR msgstr[128]; ?? ?_stprintf(msgstr, langMapTbl_I[gSysLangIdx].guideMsg[24]); ?? ?switch (nCode) { ?? ?case HCBT_ACTIVATE: ?? ??? ?HWND hWnd = (HWND)wParam; ?? ??? ?SetDlgItemText(hWnd, IDOK, msgstr); ?? ??? ?return 0; ?? ?} ?? ?return CallNextHookEx(hMsgBoxHook, nCode, wParam, lParam); }
int MsgBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType) { ?? ?hMsgBoxHook = SetWindowsHookEx(WH_CBT, MsgBoxCBTProc, NULL, GetCurrentThreadId()); ?? ?int ret = MessageBox(hWnd, lpText, lpCaption, uType); ?? ?UnhookWindowsHookEx(hMsgBoxHook); ?? ?return ret; }
|