Click here to Skip to main content
15,922,650 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DestroyWindow() Pin
Chris Meech20-Mar-03 5:39
Chris Meech20-Mar-03 5:39 
GeneralRe: DestroyWindow() Pin
ns20-Mar-03 5:45
ns20-Mar-03 5:45 
GeneralRe: DestroyWindow() Pin
Ravi Bhavnani20-Mar-03 5:30
professionalRavi Bhavnani20-Mar-03 5:30 
GeneralHooks ansd services Pin
FlorianS20-Mar-03 4:57
FlorianS20-Mar-03 4:57 
Generalsorting a database physically after adding records Pin
ns20-Mar-03 2:16
ns20-Mar-03 2:16 
GeneralStandard C++ question... Pin
Member 1026380920-Mar-03 2:15
Member 1026380920-Mar-03 2:15 
GeneralRe: Standard C++ question... Pin
jhwurmbach20-Mar-03 2:26
jhwurmbach20-Mar-03 2:26 
GeneralRe: Standard C++ question... Pin
Member 1026380920-Mar-03 2:52
Member 1026380920-Mar-03 2:52 
Generaltoolbar problem Pin
benben20-Mar-03 2:05
benben20-Mar-03 2:05 
QuestionAnybody seen this MFC error yet? Pin
Harald Krause20-Mar-03 1:45
Harald Krause20-Mar-03 1:45 
AnswerRe: Anybody seen this MFC error yet? Pin
jhwurmbach20-Mar-03 2:16
jhwurmbach20-Mar-03 2:16 
GeneralRe: Anybody seen this MFC error yet? Pin
Yuri Kreinin20-Mar-03 6:28
Yuri Kreinin20-Mar-03 6:28 
Generalactive screensaver Programmatically Pin
JoeZhang20-Mar-03 0:36
JoeZhang20-Mar-03 0:36 
GeneralRe: active screensaver Programmatically Pin
_Theo_20-Mar-03 1:35
_Theo_20-Mar-03 1:35 
GeneralMSN like Emoticon list Pin
Ph@ntom19-Mar-03 23:57
Ph@ntom19-Mar-03 23:57 
GeneralRe: MSN like Emoticon list Pin
_Theo_20-Mar-03 1:38
_Theo_20-Mar-03 1:38 
GeneralRichEdit20A Pin
Ph@ntom19-Mar-03 23:55
Ph@ntom19-Mar-03 23:55 
GeneralSetWindowsHookEx and WM_NOTIFY problems Pin
Ceri19-Mar-03 23:44
Ceri19-Mar-03 23:44 
GeneralRe: SetWindowsHookEx and WM_NOTIFY problems Pin
Chopper19-Mar-03 23:50
Chopper19-Mar-03 23:50 
GeneralRe: SetWindowsHookEx and WM_NOTIFY problems Pin
Ceri19-Mar-03 23:51
Ceri19-Mar-03 23:51 
GeneralRe: SetWindowsHookEx and WM_NOTIFY problems Pin
Chopper19-Mar-03 23:59
Chopper19-Mar-03 23:59 
GeneralRe: SetWindowsHookEx and WM_NOTIFY problems Pin
Ceri20-Mar-03 0:00
Ceri20-Mar-03 0:00 
GeneralGetting rid of the scrollbars in a HTMLView... Pin
Joan M19-Mar-03 23:36
professionalJoan M19-Mar-03 23:36 
Question<p class="body">How to draw parts of a Windows XP icon??? Pin
Chopper19-Mar-03 23:20
Chopper19-Mar-03 23:20 
Hi All,

I have a Windows XP 48x48 icon with shadow, and I need to draw only part of this icon. The standard DrawIconEx function allows to draw only the whole icon. I figured there was one way of drawing parts of the icon by using function MaskBlt. However, I cannot get the proper drawing result. The best solution I’ve come up so far is the following function:
<br />
void DrawIcon(HDC dc, HICON hIcon, int x, int y, int cx, int cy)<br />
{<br />
  	HDC memDC = CreateCompatibleDC(dc);<br />
	ICONINFO IconInfo;<br />
	GetIconInfo(hIcon, &IconInfo);<br />
	HGDIOBJ old = SelectObject(memDC, IconInfo.hbmColor);<br />
	MaskBlt(dc, x, y, cx, cy, memDC, 0, 0, IconInfo.hbmMask, 0, 0, MAKEROP4(SRCINVERT, SRCCOPY));<br />
	SelectObject(memDC, old);<br />
	DeleteDC(memDC);<br />
}<br />


Body of the icon is drawn correctly, and the transparency is there too. The problem of this function is that when drawing shadows of the icon it draws just black dots instead. Experimenting with all possible combinations of parameters for macro MAKEROP4 didn’t bring any good result.

Please, help me out, anybody!!! How to draw parts of a Windows XP 48x48 icon correctly????



Regards,
Vitaly
QuestionUsing the perfmon tool I've seen that my application acumulates handlers, is it bad? Pin
Joan M19-Mar-03 23:01
professionalJoan M19-Mar-03 23:01 

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.