// Setting/changing an icon to a window(CLASS)
// From resource HICON hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
// From file: HICON hIcon = LoadImage(hInstance, "filename.ico", IMAGE_ICON, SM_CXICON, SM_CYICON, LR_LOADFROMFILE | LR_DEFAULTSIZE);
SetClassLong(hWnd, GCL_HICON, (LONG)hIcon);
// Or... SendMessage(hWnd, WM_SETICON, WM_SMALL, (LPARAM)hIcon); // The icon on the task-bar SendMessage(hWnd, WM_SETICON, WM_BIG, (LPARAM)hIcon); // The icon on the ALT+TAB dialog box |