Change Icon of exe
-
Does anyone know of any articals or examples that show how to change the defualt icon of an exe? (if you say the words "resource editor" i will come to your house, chop your legs off, set your house on fire and watch as you drag your bloody stumps out door, nah im just keeding)
-
Does anyone know of any articals or examples that show how to change the defualt icon of an exe? (if you say the words "resource editor" i will come to your house, chop your legs off, set your house on fire and watch as you drag your bloody stumps out door, nah im just keeding)
-
well i would prefer that it not use mfc so i could use in other non-mfc projects too, but i will be using MFC to make that app yes,
Well, not using MFC, you can set your icon when you register your window class with WNDCLASSEX
WNDCLASSEX wc; wc.hIcon = LoadIcon(HandleToYourInstance, "IDI_YOURAPPICON");
There are a couple other things in WNDCLASSEX that you can set to customize your program. In MFC, go to your CWnd class's constructor and initialize the m_hIcon member:m_hIcon = AfxGetApp()->LoadIcon(IDI_YOURAPPICON);
Voila. augy -
Well, not using MFC, you can set your icon when you register your window class with WNDCLASSEX
WNDCLASSEX wc; wc.hIcon = LoadIcon(HandleToYourInstance, "IDI_YOURAPPICON");
There are a couple other things in WNDCLASSEX that you can set to customize your program. In MFC, go to your CWnd class's constructor and initialize the m_hIcon member:m_hIcon = AfxGetApp()->LoadIcon(IDI_YOURAPPICON);
Voila. augyIm sorry thats not what i was looking for that is how to change the icon of the window(which i already knew), I want to know how to progmatically change the default icon of an exe, the way a resource hacker would. and when i say the default icon of the exe im talking about the icon that would be showing up in explorer.
-
Im sorry thats not what i was looking for that is how to change the icon of the window(which i already knew), I want to know how to progmatically change the default icon of an exe, the way a resource hacker would. and when i say the default icon of the exe im talking about the icon that would be showing up in explorer.
oooooh. How does explorer decide what icon to display? It will automatically pull the main window's icon out and use that as the display icon, at least if it's compiled in MFC (or MFC is packaging the EXE with explorer information in it). Short answer: no f*ing idea. augy
-
Does anyone know of any articals or examples that show how to change the defualt icon of an exe? (if you say the words "resource editor" i will come to your house, chop your legs off, set your house on fire and watch as you drag your bloody stumps out door, nah im just keeding)
To change icon of an exe, you need to overwrite it's icon resource. But first you need to determine default icon, to do that you need programs like Resource Hacker. Once you have found ID of default icon, you can easily update resource. Just follow this article and MSDN.:cool: ARSALAN MALIK
-
Does anyone know of any articals or examples that show how to change the defualt icon of an exe? (if you say the words "resource editor" i will come to your house, chop your legs off, set your house on fire and watch as you drag your bloody stumps out door, nah im just keeding)
Archer282 wrote: Does anyone know of any articals or examples that show how to change the defualt icon of an exe? Well the "default" icon, the one shown by explorer, is always the first icon in the executable file. So all you have to do is edit the first icon. Is the icon in your executable? If so, use the resource editor. If it's in a separate executable, you'll need to use the
BeginUpdateResource()
etc. methods to access it at runtime.Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"