Click here to Skip to main content
15,891,529 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Double data type validation Pin
Navin25-Aug-03 15:00
Navin25-Aug-03 15:00 
GeneralRe: Double data type validation Pin
Anonymous25-Aug-03 20:20
Anonymous25-Aug-03 20:20 
GeneralRe: Double data type validation Pin
Abin26-Aug-03 3:10
Abin26-Aug-03 3:10 
Generalsetting the application icon at runtime Pin
Jim Crafton25-Aug-03 13:58
Jim Crafton25-Aug-03 13:58 
GeneralRe: setting the application icon at runtime Pin
Navin25-Aug-03 14:51
Navin25-Aug-03 14:51 
GeneralRe: setting the application icon at runtime Pin
Jim Crafton25-Aug-03 16:38
Jim Crafton25-Aug-03 16:38 
GeneralRe: setting the application icon at runtime Pin
Toni7825-Aug-03 20:36
Toni7825-Aug-03 20:36 
GeneralRe: setting the application icon at runtime Pin
DaFrawg29-Sep-03 2:27
DaFrawg29-Sep-03 2:27 
My first working program was able to do that. It's not really hard.

I think it was SetIcon(HICON, BOOL). If you generated an MFC-based project, you'll find an example at the end of YourProjectDlg::InitDialog(), just before the TODO remark.

Somewhere in the code of your dialog (but I think it is also possible in SDIs or MDIs, but not how;P)(as long as it's in a function like YouProjectDlg::MemberFunction(...)) you put the following code:

m_hIcon = AfxGetApp->LoadIcon(IDI_Your_Icon); //Store the handle to the icon<br />
SetIcon(m_hIcon, TRUE);  //Set the big (?) icon<br />
SetIcon(m_hIcon, FALSE); //Set the small (??) icon


I just copied it from OnInitDialog. I don't know what the function of the double execution of SetIcon is, but 'ey, it works, and that's what you want, don't you?

If you just want to show the small version of the icon (16x16), you should leave SetIcon(m_hIcon, FALSE);. (Why that one? That one actually means "Set the NON-big version of m_hIcon", since it's something like SetIcon (HICON TheIcon, BOOL BigIcon))

I stored the icon handle into m_hIcon, because that's the standard member variable to store the handle of the dialog's current icon (yes, of a dialog, also here I don't know anything about SDI/MDI stuff). But I don't think it will be harmful to use a local variable for that.
QuestionHow to include dialog in the view Pin
Binayak25-Aug-03 13:20
Binayak25-Aug-03 13:20 
GeneralControl Bars Pin
Xakep25-Aug-03 12:59
Xakep25-Aug-03 12:59 
GeneralRe: Control Bars Pin
Thomas Lau25-Aug-03 16:22
Thomas Lau25-Aug-03 16:22 
GeneralRe: Control Bars Pin
Mike Dimmick25-Aug-03 22:42
Mike Dimmick25-Aug-03 22:42 
GeneralClosing the handle of a dynamically spawned thread Pin
Kuniva25-Aug-03 12:17
Kuniva25-Aug-03 12:17 
GeneralRe: Closing the handle of a dynamically spawned thread Pin
Mike Dimmick25-Aug-03 22:43
Mike Dimmick25-Aug-03 22:43 
GeneralDialog prompts in German - would like to restore to English Pin
Peter Maton25-Aug-03 11:15
Peter Maton25-Aug-03 11:15 
GeneralRe: Dialog prompts in German - would like to restore to English Pin
Peter Maton26-Aug-03 13:08
Peter Maton26-Aug-03 13:08 
Generalcolor table of bitmap Pin
includeh1025-Aug-03 10:34
includeh1025-Aug-03 10:34 
GeneralRe: color table of bitmap Pin
Joaquín M López Muñoz25-Aug-03 10:42
Joaquín M López Muñoz25-Aug-03 10:42 
GeneralSimple question. Pin
Jon Newman25-Aug-03 10:03
Jon Newman25-Aug-03 10:03 
GeneralRe: Simple question. Pin
Joaquín M López Muñoz25-Aug-03 10:39
Joaquín M López Muñoz25-Aug-03 10:39 
GeneralRe: Simple question. Pin
Jon Newman25-Aug-03 10:42
Jon Newman25-Aug-03 10:42 
GeneralTemplate for experts!! help Pin
berserker_r25-Aug-03 9:40
berserker_r25-Aug-03 9:40 
GeneralRe: Template for experts!! help Pin
Anonymous25-Aug-03 10:19
Anonymous25-Aug-03 10:19 
GeneralRe: Template for experts!! help Pin
Joaquín M López Muñoz25-Aug-03 10:27
Joaquín M López Muñoz25-Aug-03 10:27 
Questionhow to show data in internet explorer Pin
Binayak25-Aug-03 8:20
Binayak25-Aug-03 8:20 

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.