C language > Expert questions

Would like to change default icon in Console Window. Only lead I have is C++ !

<< < (3/3)

TimoVJL:
Yes, it won't work in Windows 10.

replace
--- Code: ---#pragma lib "user32.lib"
--- End code ---
with
--- Code: ---#pragma comment(lib, "user32.lib")
--- End code ---

/Ze is for PellesC msvc compability mode

EDIT: for Windows 10
--- Code: ---#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#pragma comment(lib, "user32.lib") // LoadIcon

int main(int argc, char **argv)
{
HWND hWnd = GetConsoleWindow();
HICON hIcon = LoadIcon(0, IDI_EXCLAMATION);
SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
// SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
return 0;
}
--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version