23. I've created a 16x16 icon for my app. Why does Windows insist on squishing up the 32x32 version ?
You've created an MFC app. Taking a dialog-based app as an example, look at the source for your main window(dialog) and check out the constructor. You'll see this:
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
But LoadIcon can only load icons which are SM_CXICON x SM_CYICON pixels big, which is nearly always the 32x32 version. When it needs a 16x16 version, such as for your titlebar, it squishes that up. Yuck. Instead, replace the code above with this :
23. I've created a 16x16 icon for my app. Why does Windows insist on squishing up the 32x32 version ?
You've created an MFC app. Taking a dialog-based app as an example, look at the source for your main window(dialog) and check out the constructor. You'll see this:
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
But LoadIcon can only load icons which are SM_CXICON x SM_CYICON pixels big, which is nearly always the 32x32 version. When it needs a 16x16 version, such as for your titlebar, it squishes that up. Yuck. Instead, replace the code above with this :
use GetModuleFileName to retrieve file name of the host application,
The GetModuleHandle function retrieves a module handle for the specified module if the file has been mapped into the address space of the calling process.