Search the Community
Showing results for tags 'English MsgBox'.
-
I don't know if there is some need, but I made a simple function to use only english button names in MsgBox. #include <WinAPI.au3> Opt("MustDeclareVars", 1) Global $hHookMsgBox _MsgBoxEnglish(0, "Title", "Text") _MsgBoxEnglish(1, "Title", "Text") _MsgBoxEnglish(2, "Title", "Text") _MsgBoxEnglish(3, "Title", "Text") _MsgBoxEnglish(4, "Title", "Text") _MsgBoxEnglish(5, "Title", "Text") _MsgBoxEnglish(6, "Title", "Text") _MsgBoxEnglish(7, "Title", "Text") #region English Button text for MsgBox!! ;########################################################## Func _MsgBoxEnglish($flag, $title, $text, $timeout = 0, $hwnd = 0) Local $hProcMsgBox = DllCallbackRegister("CbtHookProcMsgBox", "int", "int;int;int") Local $TIDMsgBox = _WinAPI_GetCurrentThreadId() $hHookMsgBox = _WinAPI_SetWindowsHookEx($WH_CBT, DllCallbackGetPtr($hProcMsgBox), 0, $TIDMsgBox) Local $iRet = MsgBox($flag, $title, $text, $timeout, $hwnd) _WinAPI_UnhookWindowsHookEx($hHookMsgBox) DllCallbackFree($hProcMsgBox) Return $iRet EndFunc ;==>_MsgBoxEnglish Func CbtHookProcMsgBox($nCode, $wParam, $lParam, $hHookMsgBox) Local $RET = 0, $hBitmap = 0, $xWnd = 0 Local $sButtonText If $nCode < 0 Then $RET = _WinAPI_CallNextHookEx($hHookMsgBox, $nCode, $wParam, $lParam) Return $RET EndIf Switch $nCode Case 5 ;5=HCBT_ACTIVATE _WinAPI_SetDlgItemText($wParam, 1, "OK") _WinAPI_SetDlgItemText($wParam, 2, "Cancel") _WinAPI_SetDlgItemText($wParam, 3, "&Abort") _WinAPI_SetDlgItemText($wParam, 4, "&Retry") _WinAPI_SetDlgItemText($wParam, 5, "&Ignore") _WinAPI_SetDlgItemText($wParam, 6, "&Yes") _WinAPI_SetDlgItemText($wParam, 7, "&No") _WinAPI_SetDlgItemText($wParam, 8, "Help") _WinAPI_SetDlgItemText($wParam, 10, "&Try Again") _WinAPI_SetDlgItemText($wParam, 11, "&Continue") EndSwitch Return EndFunc ;==>CbtHookProcMsgBox Func _WinAPI_SetDlgItemText($hDlg, $nIDDlgItem, $lpString) Local $aRet = DllCall('user32.dll', "int", "SetDlgItemText", _ "hwnd", $hDlg, _ "int", $nIDDlgItem, _ "str", $lpString) Return $aRet[0] EndFunc ;==>_WinAPI_SetDlgItemText ;########################################################## #endregion English Button text for MsgBox!!