diff --git a/PInvoke/ComCtl32/CommCtrl.TaskDialog.cs b/PInvoke/ComCtl32/CommCtrl.TaskDialog.cs
index 0f226aa0..9f06c128 100644
--- a/PInvoke/ComCtl32/CommCtrl.TaskDialog.cs
+++ b/PInvoke/ComCtl32/CommCtrl.TaskDialog.cs
@@ -453,7 +453,7 @@ namespace Vanara.PInvoke
///
[PInvokeData("Commctrl.h", MSDNShortId = "bb760544")]
[DllImport(Lib.ComCtl32, CharSet = CharSet.Unicode, ExactSpelling = true)]
- public static extern HRESULT TaskDialogIndirect(TASKDIALOGCONFIG pTaskConfig, out int pnButton, out int pnRadioButton, [MarshalAs(UnmanagedType.Bool)] out bool pfVerificationFlagChecked);
+ public static extern HRESULT TaskDialogIndirect([In] TASKDIALOGCONFIG pTaskConfig, out int pnButton, out int pnRadioButton, [MarshalAs(UnmanagedType.Bool)] out bool pfVerificationFlagChecked);
///
/// The TASKDIALOG_BUTTON structure contains information used to display a button in a task dialog. The TASKDIALOGCONFIG structure
@@ -480,7 +480,7 @@ namespace Vanara.PInvoke
///
// https://docs.microsoft.com/en-us/windows/desktop/api/commctrl/ns-commctrl-_taskdialogconfig
[PInvokeData("commctrl.h", MSDNShortId = "bb787473")]
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public class TASKDIALOGCONFIG : IDisposable
{
/// Specifies the structure size, in bytes.
@@ -641,6 +641,11 @@ namespace Vanara.PInvoke
/// A pointer to application-defined reference data. This value is defined by the caller.
public IntPtr lpCallbackData;
+ ///
+ /// The width of the task dialog's client area, in dialog units. If 0, the task dialog manager will calculate the ideal width.
+ ///
+ public uint cxWidth;
+
///
/// Initializes a new instance of the class setting the field properly.
///
@@ -649,11 +654,6 @@ namespace Vanara.PInvoke
cbSize = (uint)Marshal.SizeOf(typeof(TASKDIALOGCONFIG));
}
- ///
- /// The width of the task dialog's client area, in dialog units. If 0, the task dialog manager will calculate the ideal width.
- ///
- public uint cxWidth;
-
///
/// The string to be used for the task dialog title. If this parameter is NULL, the filename of the executable program is used.
///