1

I am writing a WPF application and I want to show a Windows task dialog in it. I have used a home grown .Net wrapper around the Windows TaskDialogIndirect P/Invoke function, and I used the OOkii dialogs NuGet package, but both fail as soon as the application is running as a 64 bit process. I need "AnyCPU", because my code is a MS Office Add-in, and it should be able to run in 32 Bit as well as 64 Bit MS Outlook.

I want to avoid to roll my own task dialog as a WPF window, so my question: Is there a .Net library/control suite that offers Windows Task Dialog functionality and also supports 64 bit?

Heinz Kessler
  • 1,610
  • 11
  • 24

3 Answers3

1

You could use the NET wrapper Microsoft provided in the WindowsAPICodePack library.

This is how you can get hold of that "retired" library:

See here for usage:

Or you could use a library that's reimplemented most of the TaskDialog API in C#:

Colin Smith
  • 12,375
  • 4
  • 39
  • 47
1

Contemporary answer: Add

<UseWindowsForms>true</UseWindowsForms>

to the PropertyGroup in your .csproj file and you can use all these standard dialogs directly. No, this is not an ugly hack, it seems to be the supported and recommended way...

This is where adding TaskDialog to .NET was discussed, with many samples: https://github.com/dotnet/winforms/issues/146

Gábor
  • 9,466
  • 3
  • 65
  • 79
0

Ookii.Dialogs.Wpf works fine for me in 64-bit -- and does a great job overall for task dialogs. When you say

fail as soon as the application is running as a 64 bit process

perhaps you are referring to the note in their readme, which sounds like it has been fixed since they released Ookii.Dialogs.Wpf v3.1.0?

Hugh W
  • 716
  • 2
  • 10
  • 33