Skip to content

Commit 0da8e6e

Browse files
Update ProgressDialog to display immediately (#60)
1 parent bf03130 commit 0da8e6e

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/Ookii.Dialogs.Wpf/Interop/IProgressDialog.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
#endregion
1616

1717
using System;
18-
using System.Collections.Generic;
19-
using System.Linq;
20-
using System.Text;
2118
using System.Runtime.InteropServices;
2219

2320
namespace Ookii.Dialogs.Wpf.Interop
@@ -45,7 +42,15 @@ internal enum ProgressDialogFlags : uint
4542
NoMinimize = 0x00000008,
4643
NoProgressBar = 0x00000010,
4744
MarqueeProgress = 0x00000020,
48-
NoCancel = 0x00000040
45+
NoCancel = 0x00000040,
46+
}
47+
48+
[Flags]
49+
internal enum ProgressDialogTimerAction : uint
50+
{
51+
Reset = 0x00000001,
52+
Pause = 0x00000002,
53+
Resume = 0x00000003,
4954
}
5055

5156
[ComImport]
@@ -112,10 +117,8 @@ object pvResevered
112117

113118
[PreserveSig]
114119
void Timer(
115-
uint dwTimerAction,
116-
object pvResevered
120+
ProgressDialogTimerAction dwTimerAction,
121+
object pvReserved
117122
);
118-
119123
}
120-
121124
}

src/Ookii.Dialogs.Wpf/ProgressDialog.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,7 @@ private void RunProgressDialog(IntPtr owner, object argument, CancellationToken
787787
flags |= Ookii.Dialogs.Wpf.Interop.ProgressDialogFlags.NoMinimize;
788788

789789
_ownerHandle = owner;
790+
_dialog.Timer(Interop.ProgressDialogTimerAction.Resume, pvReserved: null);
790791
_dialog.StartProgressDialog(owner, null, flags, IntPtr.Zero);
791792
_backgroundWorker.RunWorkerAsync(argument);
792793
}

0 commit comments

Comments
 (0)