Hi all guys of the forum, based on this script:
http://www.autoitscript.com/forum/topic/140024-english-msgbox-button-texts-for-everyone/
I want to make custom button name but i have a problem:
If i start only one of those separately work, ifi try to start both of them not. I think the problem is "clear" the array, i have add the $MsgBox_Name = "" but not work. Some suggestion?
Thanks to all
http://www.autoitscript.com/forum/topic/140024-english-msgbox-button-texts-for-everyone/
I want to make custom button name but i have a problem:
[ autoit ]
#include <WinAPI.au3> Global $hHookMsgBox _MsgBox(0, "Title", "Text", "Button1") _MsgBox(1, "Title", "Text", "Button1|Button2") ;~ _MsgBox(2, "Title", "Text") ;~ _MsgBox(3, "Title", "Text") ;~ _MsgBox(4, "Title", "Text") ;~ _MsgBox(5, "Title", "Text") ;~ _MsgBox(6, "Title", "Text") ;~ _MsgBox(7, "Title", "Text") Func _MsgBox($flag, $title, $text, $var = "", $timeout = 0, $hwnd = 0) Global $MsgBox_Name = StringSplit($var, "|") 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) $MsgBox_Name = "" Return $iRet EndFunc ;==>_MsgBox_Ex 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, $MsgBox_Name[1]) _WinAPI_SetDlgItemText($wParam, 2, $MsgBox_Name[2]) _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
If i start only one of those separately work, ifi try to start both of them not. I think the problem is "clear" the array, i have add the $MsgBox_Name = "" but not work. Some suggestion?
Thanks to all