Click here to Skip to main content
15,887,381 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Setting a Program Icon Pin
Bob X9-Jun-06 7:56
Bob X9-Jun-06 7:56 
QuestionRe: Setting a Program Icon Pin
David Crow9-Jun-06 8:09
David Crow9-Jun-06 8:09 
GeneralRe: Setting a Program Icon Pin
Bob X9-Jun-06 8:35
Bob X9-Jun-06 8:35 
GeneralRe: Setting a Program Icon Pin
David Crow9-Jun-06 8:47
David Crow9-Jun-06 8:47 
GeneralRe: Setting a Program Icon Pin
Bob X9-Jun-06 11:37
Bob X9-Jun-06 11:37 
AnswerRe: Setting a Program Icon Pin
Red Stateler9-Jun-06 7:19
Red Stateler9-Jun-06 7:19 
GeneralRe: Setting a Program Icon Pin
Bob X9-Jun-06 7:39
Bob X9-Jun-06 7:39 
AnswerRe: Setting a Program Icon Pin
Eric Dahlvang9-Jun-06 8:25
Eric Dahlvang9-Jun-06 8:25 
see here[^]
4.16: How do I set the icon that's displayed in the caption of a frame window or dialog? 

You first load the icon from your program's resources, then set it as the window's current icon. 
You should set both the large (32x32) and small (16x16) icons; the large icon is used in the 
Alt+Tab window, and the small icon is used in the caption bar and the Taskbar.

Note that the code generated by the MFC AppWizard is buggy and does not properly set the small icon. 
The LoadIcon() function can only load 32x32 icons; to load 16x16 icons, use LoadImage().

// MFC:
HICON hLargeIcon = AfxGetApp()->LoadIcon ( IDI_NEW_ICON );
HICON hSmallIcon = (HICON) ::LoadImage ( AfxGetResourceHandle(), 
                                         MAKEINTRESOURCE(IDI_NEW_ICON),
                                         IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR );

  wndYourWindow.SetIcon ( hLargeIcon, TRUE );
  wndYourWindow.SetIcon ( hSmallIcon, FALSE );

// Win32 API:
HICON hLargeIcon = LoadIcon ( hinstYourModuleInstance,
                              MAKEINTRESOURCE(IDI_NEW_ICON) );
HICON hSmallIcon = (HICON) LoadImage ( hinstYourModuleInstance,
                                       MAKEINTRESOURCE(IDI_NEW_ICON),
                                       IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR );
 
  SendMessage ( hwndYourWindow, WM_SETICON, ICON_BIG, hLargeIcon );
  SendMessage ( hwndYourWindow, WM_SETICON, ICON_SMALL, hSmallIcon );


----------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters

QuestionOpen file using IE [VC++ 2005] Pin
jantimmerman7-Jun-06 23:33
jantimmerman7-Jun-06 23:33 
AnswerRe: Open file using IE [VC++ 2005] [modified] Pin
2bee 7-Jun-06 23:58
2bee 7-Jun-06 23:58 
GeneralRe: Open file using IE [VC++ 2005] [modified] Pin
jantimmerman8-Jun-06 0:12
jantimmerman8-Jun-06 0:12 
Questionmfc -> __gc problem [modified] Pin
CluelssHack7-Jun-06 6:29
CluelssHack7-Jun-06 6:29 
QuestionHow to code DriveInfo class Pin
dragon527-Jun-06 6:11
dragon527-Jun-06 6:11 
AnswerRe: How to code DriveInfo class Pin
Milton Karimbekallil9-Jun-06 22:33
Milton Karimbekallil9-Jun-06 22:33 
GeneralRe: How to code DriveInfo class Pin
dragon5210-Jun-06 1:39
dragon5210-Jun-06 1:39 
GeneralRe: How to code DriveInfo class Pin
Milton Karimbekallil14-Jun-06 6:40
Milton Karimbekallil14-Jun-06 6:40 
GeneralRe: How to code DriveInfo class Pin
dragon5217-Jun-06 17:51
dragon5217-Jun-06 17:51 
QuestionCreating an array inside a struct Pin
pShay7-Jun-06 2:54
pShay7-Jun-06 2:54 
QuestionVC++ PROMBLEM Pin
p_5-Jun-06 19:15
p_5-Jun-06 19:15 
GeneralRe: VC++ PROMBLEM Pin
Bob X7-Jun-06 13:50
Bob X7-Jun-06 13:50 
GeneralRe: VC++ PROMBLEM Pin
toxcct7-Jun-06 21:34
toxcct7-Jun-06 21:34 
AnswerRe: VC++ PROMBLEM Pin
Paul Conrad14-Jun-06 5:30
professionalPaul Conrad14-Jun-06 5:30 
QuestionRunning an executable through C++.Net code Pin
Bob X5-Jun-06 7:24
Bob X5-Jun-06 7:24 
AnswerRe: Running an executable through C++.Net code [modified] Pin
2bee 5-Jun-06 10:23
2bee 5-Jun-06 10:23 
GeneralRe: Running an executable through C++.Net code [modified] Pin
Bob X6-Jun-06 16:57
Bob X6-Jun-06 16:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.