Replace calls to PSTaskDialog.dll

Description

PSTaskDialog calls generate the following exception:

System.EntryPointNotFoundException was unhandled
HResult=-2146233053
Message=Unable to find an entry point named 'TaskDialogIndirect' in DLL 'ComCtl32'.
Source=PSTaskDialog
TypeName=""
StackTrace:
at PSTaskDialog.VistaUnsafeNativeMethods.TaskDialogIndirect(TASKDIALOGCONFIG& pTaskConfig, Int32& pnButton, Int32& pnRadioButton, Boolean& pfVerificationFlagChecked)
at PSTaskDialog.VistaTaskDialog.PrivateShow(IntPtr hwndOwner, Boolean& verificationFlagChecked, Int32& radioButtonResult)
at PSTaskDialog.VistaTaskDialog.Show(IWin32Window owner, Boolean& verificationFlagChecked, Int32& radioButtonResult)
at PSTaskDialog.cTaskDialog.ShowTaskDialogBox(IWin32Window Owner, String Title, String MainInstruction, String Content, String ExpandedInfo, String Footer, String VerificationText, String RadioButtons, String CommandButtons, eTaskDialogButtons Buttons, eSysIcons MainIcon, eSysIcons FooterIcon, Int32 DefaultIndex)
at PSTaskDialog.cTaskDialog.ShowTaskDialogBox(IWin32Window Owner, String Title, String MainInstruction, String Content, String ExpandedInfo, String Footer, String VerificationText, String RadioButtons, String CommandButtons, eTaskDialogButtons Buttons, eSysIcons MainIcon, eSysIcons FooterIcon)
at PSTaskDialog.cTaskDialog.MessageBox(IWin32Window Owner, String Title, String MainInstruction, String Content, String ExpandedInfo, String Footer, String VerificationText, eTaskDialogButtons Buttons, eSysIcons MainIcon, eSysIcons FooterIcon)
at mRemoteNG.UI.Window.ConnectionWindow.CloseConnectionTab() in C:\Users\kaise01\Documents\Source\mRemoteNG\mRemoteV1\UI\Window\ConnectionWindow.cs:line 508
at mRemoteNG.UI.Window.ConnectionWindow.TabController_ClosePressed(Object sender, EventArgs e) in C:\Users\kaise01\Documents\Source\mRemoteNG\mRemoteV1\UI\Window\ConnectionWindow.cs:line 500
at Crownwood.Magic.Controls.TabControl.OnClosePressed(EventArgs e)
at Crownwood.Magic.Controls.TabControl.OnCloseButton(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at mRemoteNG.App.ProgramRoot.Main(String[] args) in C:\Users\kaise01\Documents\Source\mRemoteNG\mRemoteV1\App\ProgramRoot.cs:line 17
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(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.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

This could help:
https://support.microsoft.com/en-us/kb/830033

However as PSTaskDialog is old/unmaintained:
http://www.codeproject.com/Articles/21276/Vista-TaskDialog-Wrapper-and-Emulator

it is likely best to just use standard methods where possible and write a new form/dialog class for anything that requires "custom" handling (possibly the "Do you want to close the connection" with the "remember this choice" checkbox that generated the above exception.

Environment

None

Status

Assignee

入海勇人

Reporter

Sean K

Labels

None

Components

Fix versions

Priority

Blocker
Configure