Click here to Skip to main content
15,920,956 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How do I change cursors? Pin
Michael Dunn16-Sep-02 11:16
sitebuilderMichael Dunn16-Sep-02 11:16 
Generalprint pdf without Acrobat. Pin
pnpfriend16-Sep-02 7:32
pnpfriend16-Sep-02 7:32 
GeneralRe: print pdf without Acrobat. Pin
l a u r e n16-Sep-02 10:46
l a u r e n16-Sep-02 10:46 
GeneralRe: print pdf without Acrobat. Pin
Anonymous16-Sep-02 13:39
Anonymous16-Sep-02 13:39 
GeneralPlacing Icons on a CStatic-derived class Pin
MightyThor16-Sep-02 7:23
MightyThor16-Sep-02 7:23 
GeneralRe: Placing Icons on a CStatic-derived class Pin
Joaquín M López Muñoz16-Sep-02 9:27
Joaquín M López Muñoz16-Sep-02 9:27 
GeneralRe: Placing Icons on a CStatic-derived class Pin
MightyThor16-Sep-02 10:10
MightyThor16-Sep-02 10:10 
GeneralRe: Placing Icons on a CStatic-derived class Pin
MightyThor17-Sep-02 7:00
MightyThor17-Sep-02 7:00 
I solved my problem. In case, in the future someone faces the same problem i decided to write how i solved it:

Instead of using DrawIcon method of CDC, i used DrawIconEx.

if( m_hIcon )
{
::DrawIconEx(	dc.m_hDC, 
		( rect.Width() / 2 - m_nIconWidth / 2 ), 
		( rect.Height() / 2 - m_nIconHeight / 2), 
 	        m_hIcon,
		m_nIconWidth, 
		m_nIconHeight, 
		NULL, 
		NULL,
		DI_IMAGE );
}
else
{	
   if( str )
   {
	dc.DrawText( str, str.GetLength(), rect, DT_CENTER  
             | DT_VCENTER | DT_SINGLELINE );
   }
}


and SetIcon function

void CTableTextStatic::SetIcon(HICON hIcon, int width, int height)
{
	m_hIcon = hIcon;
	m_nIconWidth = width;
	m_nIconHeight = height;
}


This way, i can specify any size for icon and it resizes( stretches or compresses) the icon automatically. And it draws centered.
QuestionHow to use webdings on a button Pin
Max Santos16-Sep-02 6:55
Max Santos16-Sep-02 6:55 
Generalwindows messages Pin
Zizilamoroso16-Sep-02 6:28
Zizilamoroso16-Sep-02 6:28 
GeneralRe: windows messages Pin
Mike Nordell16-Sep-02 6:33
Mike Nordell16-Sep-02 6:33 
GeneralRe: windows messages Pin
Zizilamoroso16-Sep-02 6:45
Zizilamoroso16-Sep-02 6:45 
GeneralRe: windows messages Pin
Pavel Klocek16-Sep-02 8:14
Pavel Klocek16-Sep-02 8:14 
GeneralProblem with "User breakpoint" and RtlFreeHeap. All help appreciated. Pin
16-Sep-02 6:20
suss16-Sep-02 6:20 
Generalpositioning problems Pin
ns16-Sep-02 5:41
ns16-Sep-02 5:41 
GeneralRe: positioning problems Pin
Bill Wilson16-Sep-02 5:51
Bill Wilson16-Sep-02 5:51 
GeneralRe: positioning problems Pin
Max Santos16-Sep-02 6:14
Max Santos16-Sep-02 6:14 
QuestionReuse CFormview derived class as dialog? Pin
Aaron Schaefer16-Sep-02 5:23
Aaron Schaefer16-Sep-02 5:23 
AnswerRe: Reuse CFormview derived class as dialog? Pin
Pavel Klocek16-Sep-02 8:24
Pavel Klocek16-Sep-02 8:24 
GeneralSingle computer identification Pin
doctorpi16-Sep-02 5:14
doctorpi16-Sep-02 5:14 
GeneralRe: Single computer identification Pin
Max Santos16-Sep-02 6:52
Max Santos16-Sep-02 6:52 
GeneralRe: Single computer identification Pin
Renjith Ramachandran16-Sep-02 7:47
Renjith Ramachandran16-Sep-02 7:47 
GeneralRe: Single computer identification Pin
TyMatthews16-Sep-02 10:49
TyMatthews16-Sep-02 10:49 
GeneralURGENT required help on Multiple Dialog & SetTimer problem! Pin
16-Sep-02 4:52
suss16-Sep-02 4:52 
GeneralRe: URGENT required help on Multiple Dialog & SetTimer problem! Pin
Renjith Ramachandran16-Sep-02 8:18
Renjith Ramachandran16-Sep-02 8:18 

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.