Skip to content

Count down makes exception #14

Open
@FaltoGH

Description

@FaltoGH

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.
image

I'm using Windows 10 and Windows display language is Korean.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions