PE Resource Update
-
Hi everyone, Does anyone have an Idea for changing the default icon of an EXE. I have found some piece of code for changing dialog boxes and string tables. But their methods don't work for icons. regards.
If you're registering the window class by your self (i guess you do), you can specify the icon in
WNDCLASS
before registering the window class.wndclass.hIcon = LoadIcon (MAKEINTRESOURCE(ID_ICON), IDI_APPLICATION) ;
Or Whenever you want (after your window has been created), you can load it to your window by
SetClassLong
:HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON));
SetClassLong(hWnd, GCL_HICON, (LONG)hIcon);cheers !
"If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"
-
If you're registering the window class by your self (i guess you do), you can specify the icon in
WNDCLASS
before registering the window class.wndclass.hIcon = LoadIcon (MAKEINTRESOURCE(ID_ICON), IDI_APPLICATION) ;
Or Whenever you want (after your window has been created), you can load it to your window by
SetClassLong
:HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON));
SetClassLong(hWnd, GCL_HICON, (LONG)hIcon);cheers !
"If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"
Thanks for your favor, But I think you didn't get what I mean. I aim to change the Icon of an EXE as what is shown in windows explorer, Not the Icon of Window of the program. This Icon is one of program resources but when I work with UpdateResource function for changing it, the process fails. thanks.