Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Pop up message on Tray icon Help needed Pin
KarstenK27-Jul-09 22:29
mveKarstenK27-Jul-09 22:29 
AnswerRe: Pop up message on Tray icon Help needed Pin
David Crow28-Jul-09 3:08
David Crow28-Jul-09 3:08 
Questionavoiding focus to read only edit control Pin
rp_suman27-Jul-09 18:54
rp_suman27-Jul-09 18:54 
AnswerRe: avoiding focus to read only edit control Pin
Adam Roderick J27-Jul-09 19:28
Adam Roderick J27-Jul-09 19:28 
AnswerRe: avoiding focus to read only edit control Pin
«_Superman_»27-Jul-09 19:50
professional«_Superman_»27-Jul-09 19:50 
GeneralRe: avoiding focus to read only edit control Pin
Adam Roderick J27-Jul-09 20:08
Adam Roderick J27-Jul-09 20:08 
QuestionMailBox Pin
Bram van Kampen27-Jul-09 15:28
Bram van Kampen27-Jul-09 15:28 
Questionabout bitmap process, Pin
xuplus27-Jul-09 15:18
xuplus27-Jul-09 15:18 
here is the source code of create a bitmap from memory dc,


CRect rRect;
GetClientRect(rRect);

CDC *pDC = GetDC();
CDC MemDC;
CBitmap *pOldBMP = NULL;

MemDC.CreateCompatibleDC(pDC);
CFont *pOldFont = MemDC.SelectObject(GetFont());

CRect rCaption(0,0,0,0);

MemDC.DrawText(m_strText, rCaption, DT_CALCRECT);
ASSERT( rCaption.Width() >= 0 );
ASSERT( rCaption.Height() >= 0 );
if (rCaption.Height() < 16)
rCaption.bottom = rCaption.top + 16;

rCaption.right += 25;
if (rRect.Width() >= 16 && rCaption.Width() > rRect.Width() - 16)
rCaption.right = rCaption.left + rRect.Width() - 16;

if (m_MemBMP.m_hObject)
{
m_MemBMP.DeleteObject();
}

m_MemBMP.CreateCompatibleBitmap(pDC, rCaption.Width(), rCaption.Height());
pOldBMP = MemDC.SelectObject(&m_MemBMP);


HINSTANCE hInstResource = NULL;
hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(nID), RT_GROUP_ICON);

ASSERT(hInstResource);
HICON hicon = (HICON)::LoadImage(hInstResource, MAKEINTRESOURCE(IDI_ICON1), IMAGE_ICON, NULL, NULL, 0);
ASSERT(hicon);

//MemDC.SetBkMode(TRANSPARENT);
MemDC.FillSolidRect(&rCaption, RGB(0, 0, 122));

DrawState( MemDC.m_hDC, NULL, NULL, (LPARAM)hicon, NULL, 1, 0, 16, 16, DST_ICON | DSS_NORMAL);

// clear all alpha channel data
BITMAP bmMem;
if (m_MemBMP.GetObject(sizeof bmMem, &bmMem) >= sizeof bmMem && bmMem.bmBitsPixel == 32)
{
DWORD dwSize = m_MemBMP.GetBitmapBits(0, NULL);
if (dwSize)
{
LPBYTE pPixels = (LPBYTE)malloc(dwSize);
if (pPixels)
{
if (m_MemBMP.GetBitmapBits(dwSize, pPixels) == dwSize)
{
LPBYTE pLine = pPixels;
int iLines = bmMem.bmHeight;
while (iLines-- > 0)
{
LPDWORD pdwPixel = (LPDWORD)pLine;
for (int x = 0; x < bmMem.bmWidth; x++)
{
*pdwPixel++ &= 0x00FFFFFF; //why need this ???
}
pLine += bmMem.bmWidthBytes;
}
m_MemBMP.SetBitmapBits(dwSize, pPixels);
}
free(pPixels);
}
}
}

rCaption.left += 22;

MemDC.SetTextColor(RGB(0, 125, 0));
MemDC.DrawText(m_strText, rCaption, DT_SINGLELINE | DT_LEFT | DT_END_ELLIPSIS);

ReleaseDC(pDC);
=========
can someone explain the functionality of this sentence:
*pdwPixel++ &amp;= 0x00FFFFFF;

why did need this??
thanks in advance... Sniff | :^)
AnswerRe: about bitmap process, Pin
CPallini27-Jul-09 20:58
mveCPallini27-Jul-09 20:58 
QuestionC++ Vector Pin
resolvequestion27-Jul-09 13:47
resolvequestion27-Jul-09 13:47 
AnswerRe: C++ Vector Pin
«_Superman_»27-Jul-09 17:21
professional«_Superman_»27-Jul-09 17:21 
AnswerRe: C++ Vector Pin
Adam Roderick J27-Jul-09 18:02
Adam Roderick J27-Jul-09 18:02 
QuestionConversion to VS2008 Pin
thecodedemon27-Jul-09 13:04
thecodedemon27-Jul-09 13:04 
QuestionRe: Conversion to VS2008 Pin
Adam Maras27-Jul-09 13:43
Adam Maras27-Jul-09 13:43 
AnswerRe: Conversion to VS2008 Pin
Joe Woodbury27-Jul-09 14:56
professionalJoe Woodbury27-Jul-09 14:56 
GeneralRe: Conversion to VS2008 Pin
thecodedemon28-Jul-09 4:04
thecodedemon28-Jul-09 4:04 
GeneralRe: Conversion to VS2008 Pin
Joe Woodbury28-Jul-09 5:27
professionalJoe Woodbury28-Jul-09 5:27 
GeneralRe: Conversion to VS2008 Pin
thecodedemon28-Jul-09 6:03
thecodedemon28-Jul-09 6:03 
GeneralRe: Conversion to VS2008 Pin
Joe Woodbury28-Jul-09 6:19
professionalJoe Woodbury28-Jul-09 6:19 
QuestionDate-Time Control selection issue Pin
kasi1427-Jul-09 12:04
kasi1427-Jul-09 12:04 
QuestionUltimate Grid in an ActiveX - TOOL TIPS not working.... Pin
JTemprile27-Jul-09 11:20
JTemprile27-Jul-09 11:20 
AnswerRe: Ultimate Grid in an ActiveX - TOOL TIPS not working.... Pin
Chetan Sheladiya12-Apr-11 2:46
professionalChetan Sheladiya12-Apr-11 2:46 
QuestionTreeview selected item background [Solved] Pin
Rozis27-Jul-09 10:03
Rozis27-Jul-09 10:03 
AnswerRe: Treeview selected item background Pin
Code-o-mat27-Jul-09 11:44
Code-o-mat27-Jul-09 11:44 
GeneralRe: Treeview selected item background Pin
Rozis28-Jul-09 0:02
Rozis28-Jul-09 0:02 

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.