Click here to Skip to main content
15,913,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Serialization MFC Pin
002comp2-May-12 18:28
002comp2-May-12 18:28 
AnswerRe: Serialization MFC Pin
Chris Meech2-May-12 6:48
Chris Meech2-May-12 6:48 
QuestionRe: Serialization MFC Pin
David Crow2-May-12 7:26
David Crow2-May-12 7:26 
AnswerRe: Serialization MFC Pin
Chris Meech2-May-12 7:33
Chris Meech2-May-12 7:33 
AnswerRe: Serialization MFC Pin
dliviu3-May-12 0:07
dliviu3-May-12 0:07 
AnswerRe: Serialization MFC [ Diff between COleserverDoc and CDocument] Pin
002comp3-May-12 0:26
002comp3-May-12 0:26 
QuestionRe: Serialization MFC [ Diff between COleserverDoc and CDocument] Pin
David Crow6-May-12 15:42
David Crow6-May-12 15:42 
QuestionStart Menu Banner - Redraw or Refresh Problem Pin
EshwarTamil2-May-12 0:05
EshwarTamil2-May-12 0:05 
I am building Windows CE 6.0 R3 image for VIA board.I have added Start Menu Banner(.bmp) displaying Windows CE to the Start Menu.

When i am scrolling the mouse or keyboard over the start menu, The banner gets erased.Its not refreshed.
I have tried the functions like RedrawWindow(),Invalidate(). but i can't be able to solve the problem. Here is the code related to draw start menu, can any one help me to redraw the start menu banner,

C++
int StartMenu_DrawMenuItem(DRAWITEMSTRUCT *lpdis)
 { 
  LPSTMENUDATA lpst; 
  RECT rc; //HWND hwnd; 
  HICON hicon; 
  CStringRes szMenu(g_hInstance);

 if (!lpdis)
 {
  ASSERT(lpdis);
  return FALSE;
 }

 lpst = (LPSTMENUDATA)lpdis->itemData;
 if (!lpst)
{
 ASSERT(lpst);
 return FALSE;
}
// ASSERT(lpst->szDisplay);
CopyRect(&rc, &lpdis->rcItem);
if (lpst->idMenuCmd <= IDM_START_LAST_BANNER)
{
 rc.left += sizeSTPegasus.cx; // This is for the start menu banner.
}
 //This following lines are added by SGP for startmenu banner problem
 if (lpst->idMenuCmd == IDM_START_LOGOFF || lpst->idMenuCmd == IDM_START_SHUTDOWN)
 {
  rc.left += sizeSTPegasus.cx;
 }
// added upto this by SGP for startmenu banner problem

 switch (lpdis->itemAction)
 {
   case ODA_DRAWENTIRE:
   if (idFirstMenu == lpst->idMenuCmd)
   {
    CopyRect(&rcMenu, &lpdis->rcItem);
    rcMenu.right = rcMenu.left + sizeSTPegasus.cx; // sizeSTPegasus.cx --> bitmap image width
   }
  else if  (idLastMenu == lpst->idMenuCmd)
  {
    rcMenu.bottom = lpdis->rcItem.bottom;

    if (hbmSTPegasus) // hdmSTPegasus --> Bitmap image 
    {
        HDC hdcmem = CreateCompatibleDC(lpdis->hDC);
        if (hdcmem)
        {
            SelectObject(hdcmem, hbmSTPegasus);


            FillRect(lpdis->hDC, &rcMenu,
                     GetSysColorBrush(COLOR_ACTIVECAPTION));

            BitBlt(lpdis->hDC, 0, rcMenu.bottom - sizeSTPegasus.cy,
                   sizeSTPegasus.cx, sizeSTPegasus.cy, hdcmem, 0, 0,
                   SRCCOPY);
            //RedrawWindow(lpdis->hwndItem,NULL,NULL,RDW_INVALIDATE|RDW_UPDATENOW);
            DeleteDC(hdcmem);
        }
    }
}
// drop into color selects...
case ODA_SELECT: // Problem occurs here. when i am selecting menu's the bitmap image in the left side of the menu(start menu Banner) gets erased
if ((lpdis->itemState & ODS_SELECTED) && lpst->idMenuCmd)
{   
 HBRUSH hbrush = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
 SetTextColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
 FillRect(lpdis->hDC, &rc, hbrush);
//RedrawWindow(lpdis->hwndItem,NULL,NULL,RDW_INVALIDATE|RDW_UPDATENOW);                             DeleteObject((HGDIOBJ)hbrush);                   
}
else
{
    HBRUSH hbrush = CreateSolidBrush(GetSysColor(COLOR_MENU));
    SetTextColor(lpdis->hDC, GetSysColor(COLOR_MENUTEXT));
    FillRect(lpdis->hDC, &rc, hbrush);
    DeleteObject((HGDIOBJ)hbrush);
}
break;

default:
  break;

-- Eshwar

Questionproject Pin
silverbuyer1-May-12 18:36
silverbuyer1-May-12 18:36 
QuestionVisual Studio 2005 MFC Combo Box Pin
begin811-May-12 12:56
begin811-May-12 12:56 
AnswerRe: Visual Studio 2005 MFC Combo Box Pin
_AnsHUMAN_ 1-May-12 18:05
_AnsHUMAN_ 1-May-12 18:05 
GeneralRe: Visual Studio 2005 MFC Combo Box Pin
begin812-May-12 3:20
begin812-May-12 3:20 
QuestionRe: Visual Studio 2005 MFC Combo Box Pin
David Crow2-May-12 4:43
David Crow2-May-12 4:43 
GeneralRe: Visual Studio 2005 MFC Combo Box Pin
_AnsHUMAN_ 2-May-12 18:50
_AnsHUMAN_ 2-May-12 18:50 
AnswerRe: Visual Studio 2005 MFC Combo Box Pin
Richard MacCutchan1-May-12 21:16
mveRichard MacCutchan1-May-12 21:16 
GeneralRe: Visual Studio 2005 MFC Combo Box Pin
begin812-May-12 3:23
begin812-May-12 3:23 
GeneralRe: Visual Studio 2005 MFC Combo Box Pin
Richard MacCutchan2-May-12 6:24
mveRichard MacCutchan2-May-12 6:24 
GeneralRe: Visual Studio 2005 MFC Combo Box Pin
begin812-May-12 14:20
begin812-May-12 14:20 
GeneralRe: Visual Studio 2005 MFC Combo Box Pin
begin812-May-12 14:53
begin812-May-12 14:53 
GeneralRe: Visual Studio 2005 MFC Combo Box Pin
Richard MacCutchan2-May-12 22:03
mveRichard MacCutchan2-May-12 22:03 
QuestionLine breaks in (Rich) edit control Pin
ForNow1-May-12 11:22
ForNow1-May-12 11:22 
AnswerRe: Line breaks in (Rich) edit control Pin
Code-o-mat1-May-12 21:26
Code-o-mat1-May-12 21:26 
GeneralRe: Line breaks in (Rich) edit control Pin
ForNow2-May-12 0:07
ForNow2-May-12 0:07 
GeneralRe: Line breaks in (Rich) edit control Pin
Code-o-mat2-May-12 0:12
Code-o-mat2-May-12 0:12 
Questionboost serialization/deserialization strange problem Pin
dliviu30-Apr-12 22:03
dliviu30-Apr-12 22:03 

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.