Click here to Skip to main content
15,905,782 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
AnswerRe: Using the perfmon tool I've seen that my application acumulates handlers, is it bad? Pin
Alin Negru20-Mar-03 1:07
Alin Negru20-Mar-03 1:07 
GeneralRe: Using the perfmon tool I've seen that my application acumulates handlers, is it bad? Pin
Joan M20-Mar-03 3:37
professionalJoan M20-Mar-03 3:37 
GeneralPre-Compile Actions Pin
Yaron Nir19-Mar-03 21:20
Yaron Nir19-Mar-03 21:20 
GeneralRe: Pre-Compile Actions Pin
Pavel Klocek19-Mar-03 22:35
Pavel Klocek19-Mar-03 22:35 
GeneralRe: Pre-Compile Actions Pin
Yaron Nir19-Mar-03 22:38
Yaron Nir19-Mar-03 22:38 
GeneralRe: Pre-Compile Actions Pin
Pavel Klocek19-Mar-03 22:58
Pavel Klocek19-Mar-03 22:58 
GeneralRe: Pre-Compile Actions Pin
Hans Ruck19-Mar-03 23:59
Hans Ruck19-Mar-03 23:59 
Questionhow to build c++/MFC program for Data Encryption Standard(DES) Pin
pytongz19-Mar-03 20:57
pytongz19-Mar-03 20:57 
AnswerRe: how to build c++/MFC program for Data Encryption Standard(DES) Pin
r i s h a b h s20-Mar-03 20:00
r i s h a b h s20-Mar-03 20:00 
General.OutLook & Mapi problem Pin
chepuri_uk19-Mar-03 20:26
chepuri_uk19-Mar-03 20:26 
GeneralToolBar related problem. HELP Required. Pin
Farrukh4u19-Mar-03 20:14
Farrukh4u19-Mar-03 20:14 
QuestionAnybody can tell me Where can I download or install the latest version of Window Media Player Control (msdxm.ocx)? Pin
DengJW19-Mar-03 19:40
DengJW19-Mar-03 19:40 
AnswerRe: Anybody can tell me Where can I download or install the latest version of Window Media Player Control (msdxm.ocx)? Pin
Michael Dunn19-Mar-03 19:43
sitebuilderMichael Dunn19-Mar-03 19:43 
GeneralRe: Anybody can tell me Where can I download or install the latest version of Window Media Player Control (msdxm.ocx)? Pin
DengJW19-Mar-03 19:52
DengJW19-Mar-03 19:52 
GeneralRe: Anybody can tell me Where can I download or install the latest version of Window Media Player Control (msdxm.ocx)? Pin
benjymous20-Mar-03 0:29
benjymous20-Mar-03 0:29 
GeneralGetWindowsVersion().... Pin
JoeSox19-Mar-03 19:34
JoeSox19-Mar-03 19:34 

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.