Open
Description
When I set showCountDown true, an exception occurs.
code:
using System.Globalization;
using System.Windows.Forms;
namespace AutoClosingMessageBoxTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
CultureInfo.CurrentUICulture = new CultureInfo("en-US");
AutoClosingMessageBox.Show(null, showCountDown:true);
}
}
}
output:
Unhandled Exception: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
at System.Text.StringBuilder.ToString(Int32 startIndex, Int32 length)
at Utils.Win32Api.GetDlgButtonText(IntPtr hWnd, Int32 dlgButtonId)
at System.Windows.Forms.AutoClosingMessageBox.CountDownStrategy.Proceed()
at System.Windows.Forms.AutoClosingMessageBox.OnCountDownTimer(Object state)
at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireNextTimers()
at System.Threading.TimerQueue.AppDomainTimerCallback(Int32 id)
The snapshot before process is killed.
I'm using Windows 10 and Windows display language is Korean.