Where can I find the standard system mailbox icons through WinApi?

Where can I find the standard system mailbox icons through WinApi? I want to create an advanced dialog (with the details extension) as a WinApi resource, but I want to use the default icons for the system, for example:

Standard system icons

For .NET. I know that I will find them in System.Drawing.SystemIcons , but where to find them using native C and WinApi? And how can I apply them?

+4
source share
2 answers

You can get them using LoadIcon . To get the question mark icon, use LoadIcon(NULL, IDI_QUESTION) , other identifiers: IDI_ERROR , IDI_WARNING and IDI_INFORMATION .

+9
source

Right,

If someone here needs my code to set the icon, and also play the corresponding sound.

 HICON hIcon = NULL; if(mbdIcon == MBD_ICON_INFORMATION) { hIcon = LoadIcon(NULL, IDI_INFORMATION); MessageBeep(MB_ICONASTERISK); } else if(mbdIcon == MBD_ICON_QUESTION) { hIcon = LoadIcon(NULL, IDI_QUESTION); MessageBeep(MB_ICONQUESTION); } else if(mbdIcon == MBD_ICON_WARNING) { hIcon = LoadIcon(NULL, IDI_WARNING); MessageBeep(MB_ICONWARNING); } else if(mbdIcon == MBD_ICON_ERROR) { hIcon = LoadIcon(NULL, IDI_ERROR); MessageBeep(MB_ICONERROR); } else { ShowWindow(hPictureIcon, SW_HIDE); } if(hIcon != NULL) { Static_SetIcon(hPictureIcon, hIcon); } 

Maybe he will save someone a few minutes. :)

+2
source

All Articles