RE: [GD-Windows] Icon for game window
Brought to you by:
vexxed72
From: Roland <ro...@wi...> - 2002-01-07 21:35:54
|
Some more tips for icon handling: Icons can store multiple resolutions of the image in one file. Usually Windows finds the correct resolution to display, but sometimes this fails: In my particular case it fails whenever one creates a MFC dialog-based app. The wizard constructs code like this (in CXYZDlg::OnInitDialog()): // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon The 'big icon' is displayed in the little ALT-TAB selection window. The 'small icon' is painted in the title bar and in the task bar entry. The problem is that this call always loads the big resolution of the icon. This looks good in the ALT-TAB case, but the title bar and task bar icon is resized (instead of taking the nicer-looking smaller resolution). My usual workaround is as follows: SetIcon(m_hIcon, TRUE); // Set big icon SetIcon((HICON) LoadImage( AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR), FALSE); // Set small icon and voila: the small icon looks clean and nifty... Isn't directly related to your problem, though.... roland, fighting-for-nice-icons > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On > Behalf Of > Brian Hook > Sent: Monday, January 07, 2002 9:51 AM > To: gam...@li... > Subject: RE: [GD-Windows] Icon for game window > > > A-ha! I was doing that, however I botched up the call to > LoadIcon by > passing NULL as the first parameter instead of hInstance. Doh. > > Thanks! > > Brian > > > > -----Original Message----- > > From: gam...@li... > > [mailto:gam...@li...] On > > Behalf Of Andrew Grant > > Sent: Monday, January 07, 2002 9:45 AM > > To: gam...@li... > > Subject: RE: [GD-Windows] Icon for game window > > > > > > set WNDCLASS.hIcon before you register the class for your > main window. > > > > Andrew Grant > > Hothouse Creations > > > > > > > > > -----Original Message----- > > > From: Brian Hook [mailto:bri...@py...] > > > Sent: 07 January 2002 17:34 > > > To: 'Gamedevlists-Windows@Lists. Sourceforge. Net' > > > Subject: [GD-Windows] Icon for game window > > > > > > > > > What magical bit of tomfoolery do I need to do to have my > > > application's > > > icon show up in the caption bar? I'm already using > > LoadIcon() to load > > > the correct icon, and it shows up correctly in Explorer > > when browsing > > > directories, just not in the caption. > > > > > > Thanks, > > > > > > Brian > > > > > > > > > _______________________________________________ > > > Gamedevlists-windows mailing list > > > Gam...@li... > > > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > > > > > > > > This email is covered by the following disclaimer, please > > read before accepting this email. > http://www.hothouse.org/disclaimer/ > > > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows |