15.02.2015 Views

C# 4 and .NET 4

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

new Controls <strong>and</strong> Dialogs ❘ 1409<br />

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 4)]<br />

internal class TASKDIALOGCONFIG<br />

{<br />

internal uint cbSize;<br />

internal IntPtr hwndParent;<br />

internal IntPtr hInstance;<br />

internal TASKDIALOG_FLAGS dwFlags;<br />

internal TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons;<br />

[MarshalAs(UnmanagedType.LPWStr)]<br />

internal string pszWindowTitle;<br />

internal TASKDIALOGCONFIG_ICON_UNION MainIcon;<br />

// NOTE: 32-bit union field, holds pszMainIcon as well<br />

[MarshalAs(UnmanagedType.LPWStr)]<br />

internal string pszMainInstruction;<br />

[MarshalAs(UnmanagedType.LPWStr)]<br />

internal string pszContent;<br />

internal uint cButtons;<br />

internal IntPtr pButtons; // Ptr to TASKDIALOG_BUTTON structs<br />

internal int nDefaultButton;<br />

internal uint cRadioButtons;<br />

internal IntPtr pRadioButtons; // Ptr to TASKDIALOG_BUTTON structs<br />

internal int nDefaultRadioButton;<br />

[MarshalAs(UnmanagedType.LPWStr)]<br />

internal string pszVerificationText;<br />

[MarshalAs(UnmanagedType.LPWStr)]<br />

internal string pszExp<strong>and</strong>edInformation;<br />

[MarshalAs(UnmanagedType.LPWStr)]<br />

internal string pszExp<strong>and</strong>edControlText;<br />

[MarshalAs(UnmanagedType.LPWStr)]<br />

internal string pszCollapsedControlText;<br />

internal TASKDIALOGCONFIG_ICON_UNION FooterIcon;<br />

// NOTE: 32-bit union field, holds pszFooterIcon as well<br />

[MarshalAs(UnmanagedType.LPWStr)]<br />

internal string pszFooter;<br />

internal PFTASKDIALOGCALLBACK pfCallback;<br />

internal IntPtr lpCallbackData;<br />

internal uint cxWidth;<br />

}<br />

To use the new version of the common controls with a WPF application, an application manifest with the<br />

reference to version 6 of the common controls library must be added:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

code snippet TaskDialogDemo/app.manifest<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!