TaskDialog hidden icons.

Before starting, you need to know there’s a small issue on using the API in your project, you can get an Unable to find an entry point name ‘TaskDialogIndirect’ in DLL ‘comctl32.dll’ error.

To get the whole story, see my post Unable to find an entry point name ‘TaskDialogIndirect’ in DLL ‘comctl32.dll’


Thanks to Bart Desmet, you can access all flavors of icons; these are not present in the TaskDialog documentation, I think they have been removed.

Another CancelShutdown ?

TaskDialog

TaskDialog (2)

TaskDialog (3)

TaskDialog (4)

TaskDialog (5)

Replace the TaskDialogStandardIcon definition with the one below.

    /// <summary>
    /// Specifies the icon displayed in a task dialog.
    /// </summary>
    public enum TaskDialogStandardIcon
    {
        /// <summary>
        /// Displays no icons (default).
        /// </summary>
        None = 0,

        /// <summary>
        /// Displays the warning icon.
        /// </summary>
        Warning = 65535,

        /// <summary>
        /// Displays the error icon.
        /// </summary>
        Error = 65534,

        /// <summary>
        /// Displays the Information icon.
        /// </summary>
        Information = 65533,

        /// <summary>
        /// Displays the User Account Control shield.
        /// </summary>
        Shield = 65532,

        SecurityShieldBlue = 65531,

        SecurityWarning = 65530,

        SecurityError = 65529,

        SecuritySuccess = 65528,

        SecurityShieldGray = 65527,
    }

If you are lazy like I am, get the code : TaskDialogHiddenIcons

Too easy,

  • You still have to get the Windows API Code Pack,
  • Point the Core project location to where you extracted it,
  • Update the TaskDialogStandardIcon definition with the one provided above,
  • Enjoy !

If you’re even lazier than I am (I didn’t know this was possible, I have to meet you right now :-), go to bin\Debug and run the application’s .EXE :-)


Post a Comment

Your email is never shared. Required fields are marked *

*
*