Fun challenge. Took code from here and here: ; =============================================================================
; MsgBoxEx And InputBoxEx Examples
; Purpose: Custom Buttons Of System Dialog
; Author: Ward
; =============================================================================
#Include <winapi.au3>
#include <guimenu.au3>
MsgBoxEx("Ok", 0, "MsgBoxEx", "Test")
Func MsgBoxEx($CustomButton, $Flag, $Title, $Text, $Timeout = 0, $Hwnd = 0)
Assign("MsgBoxEx:CustomButton", $CustomButton, 2)
Local $CBT_ProcCB = DllCallbackRegister("MsgBoxEx_CBT_Proc", "long", "int;hwnd;lparam")
Local $CBT_Hook = _WinAPI_SetWindowsHookEx($WH_CBT, DllCallbackGetPtr($CBT_ProcCB), 0, _WinAPI_GetCurrentThreadId())
Local $Ret = MsgBox($Flag, $Title, $Text, $Timeout, $Hwnd)
Local $Error = @Error
_WinAPI_UnhookWindowsHookEx($CBT_Hook)
DllCallbackFree($CBT_ProcCB)
Assign("MsgBoxEx:CustomButton", 0, 2)
Return SetError($Error, 0, $Ret)
EndFunc
Func MsgBoxEx_CBT_Proc($nCode, $wParam, $lParam)
If $nCode = 5 Then ; HCBT_ACTIVATE
_GUICtrlMenu_EnableMenuItem(_GUICtrlMenu_GetSystemMenu($wParam), $SC_CLOSE, 1, False)
Local $CustomButton = StringSplit(Eval("MsgBoxEx:CustomButton"), "|")
For $i = 1 To $CustomButton[0]
ControlSetText($wParam, "", $i, $CustomButton[$i])
Next
EndIf
Return _WinAPI_CallNextHookEx(0, $nCode, $wParam, $lParam)
EndFunc