To get the screen icon on the buttons of the dialog box with the system message, you need to process the callback from the dialog.
For example, I will illustrate using the TaskDialogIndirect() API introduced in Vista.
In the basic dialog box, you can specify the main icon, but not the screen icon for the buttons in the dialog box. To do this, you need to provide a callback function that responds to the TDN_CREATED notification.
This callback might look like this:
HRESULT CALLBACK TaskDialogCallbackProc( HWND hwnd, UINT uNotification, WPARAM wParam, LPARAM lParam, LONG_PTR dwRefData ) { if (TDN_CREATED == uNotification) { SendMessage( hwnd, TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE, ID_FOR_MY_BUTTON_SPECIFIED_IN_TASKDIALOGCONFIG_STRUCT, 1 ); } return S_OK; }
The magic is contained in the TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE message.
As far as I can tell, so you intend to achieve the desired effect.
source share