Click here to Skip to main content
15,886,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Data Conversion Pin
Hans Ruck27-Jun-02 23:07
Hans Ruck27-Jun-02 23:07 
Generalhelp please i can`t invalidate MFC views from dll thread Pin
Alexey Kourakolov27-Jun-02 22:19
Alexey Kourakolov27-Jun-02 22:19 
GeneralRe: help please i can`t invalidate MFC views from dll thread Pin
Prem Kumar28-Jun-02 2:43
Prem Kumar28-Jun-02 2:43 
QuestionAny Menu designer & Screen designer sample ? Pin
27-Jun-02 21:50
suss27-Jun-02 21:50 
GeneralMoving Image Pin
Shibu.V.Nair27-Jun-02 21:36
Shibu.V.Nair27-Jun-02 21:36 
GeneralRe: Moving Image Pin
Christian Graus27-Jun-02 22:13
protectorChristian Graus27-Jun-02 22:13 
GeneralMinimizing Dialog Pin
Shibu.V.Nair27-Jun-02 21:30
Shibu.V.Nair27-Jun-02 21:30 
GeneralRe: Minimizing Dialog Pin
benjymous28-Jun-02 0:34
benjymous28-Jun-02 0:34 
Here's how to give a sub-dialog it's own icon

in the constructor of your sub dialog class
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);


and in the dialog's ::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


Override the dialog's ::OnPaint
// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.

void CMyDialog::OnPaint() 
{
	if (IsIconic())
	{
		CPaintDC dc(this); // device context for painting

		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

		// Center icon in client rectangle
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		// Draw the icon
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialog::OnPaint();
	}
}


And finally, as a protected member of the dialog class:
HICON     m_hIcon;


All of this will have been done automatically for your main dialog by the MFC AppWizard

--
Help me! I'm turning into a grapefruit!
GeneralRe: Minimizing Dialog Pin
Fredrik Skog28-Jun-02 0:38
Fredrik Skog28-Jun-02 0:38 
GeneralRe: Minimizing Dialog Pin
28-Jun-02 3:41
suss28-Jun-02 3:41 
GeneralMs Word Automation PageWidth HiMetric Pin
Braulio Dez27-Jun-02 21:22
Braulio Dez27-Jun-02 21:22 
GeneralRe: Ms Word Automation PageWidth HiMetric Pin
Mike Nordell28-Jun-02 9:08
Mike Nordell28-Jun-02 9:08 
GeneralRe: Ms Word Automation PageWidth HiMetric Pin
Braulio Dez30-Jun-02 21:56
Braulio Dez30-Jun-02 21:56 
Generalcrypted CFile, used with CArchive Pin
eXplodus27-Jun-02 20:51
eXplodus27-Jun-02 20:51 
GeneralVERY urgent(VC++) !!!!!!!! Pin
shanker27-Jun-02 20:48
shanker27-Jun-02 20:48 
GeneralSource of spreadsheet program Pin
ivex27-Jun-02 20:06
ivex27-Jun-02 20:06 
GeneralSet Title in MDIChildFrame Pin
27-Jun-02 20:04
suss27-Jun-02 20:04 
GeneralRe: Set Title in MDIChildFrame Pin
Bill S27-Jun-02 20:18
professionalBill S27-Jun-02 20:18 
GeneralRe: Set Title in MDIChildFrame Pin
louise27-Jun-02 21:21
louise27-Jun-02 21:21 
GeneralWhy is this not 512 bytes! Pin
clintsinger27-Jun-02 18:09
clintsinger27-Jun-02 18:09 
GeneralRe: Why is this not 512 bytes! Pin
Joaquín M López Muñoz27-Jun-02 20:03
Joaquín M López Muñoz27-Jun-02 20:03 
GeneralRe: Why is this not 512 bytes! Pin
clintsinger28-Jun-02 6:46
clintsinger28-Jun-02 6:46 
GeneralGot it! Pin
clintsinger28-Jun-02 7:28
clintsinger28-Jun-02 7:28 
Questionhow to handle HANDLE from CreateEvent() after used it? Pin
zecodela27-Jun-02 18:07
zecodela27-Jun-02 18:07 
AnswerRe: how to handle HANDLE from CreateEvent() after used it? Pin
Prem Kumar27-Jun-02 19:43
Prem Kumar27-Jun-02 19:43 

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.