SetConsoleIcon example

Started by Vortex, September 11, 2010, 10:43:38 AM

Previous topic - Next topic

Vortex


#include <windows.h>

/* Check BuildLib.lib and kernel32.def to build kernel32v2.lib exporting the SetConsoleIcon function */

BOOL WINAPI SetConsoleIcon(HICON hIcon);

int main( int argc, char **argv )
{
HICON hIcon=LoadIcon(GetModuleHandle(0),MAKEINTRESOURCE(200));

MessageBox(0,"Click the message box to change the console icon","Test",MB_OK);

    SetConsoleIcon(hIcon);

    MessageBox(0,"Console icon changed","Test",MB_OK);

return 0;
}