Click here to Skip to main content
15,889,216 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Scrollbar problem Pin
Nelek20-May-07 20:50
protectorNelek20-May-07 20:50 
GeneralRe: Scrollbar problem Pin
Aint20-May-07 22:02
Aint20-May-07 22:02 
QuestionCString to const *char or clr Pin
Star0920-May-07 16:49
Star0920-May-07 16:49 
AnswerRe: CString to const *char or clr Pin
Christian Graus20-May-07 18:37
protectorChristian Graus20-May-07 18:37 
AnswerRe: CString to const *char or clr Pin
Manoj Kumar Rai20-May-07 20:17
professionalManoj Kumar Rai20-May-07 20:17 
AnswerRe: CString to const *char or clr Pin
prasad_som20-May-07 20:23
prasad_som20-May-07 20:23 
AnswerRe: CString to const *char or clr Pin
prasad_som20-May-07 20:20
prasad_som20-May-07 20:20 
QuestionCustom Caption in XP Pin
maxus9920-May-07 15:53
maxus9920-May-07 15:53 
HELP! Caption bar buttons don't work on XP display. The minimize/restore/close buttons appear very big on XP and hence when you click on the upper left corner of the minimize button on XP, nothing happens. YOu have to move the mouse the lower right corner of the minimize button to get it to work. Could someone please tell me what i need to do to get the captionbar buttons to work on XP display. Thanx in advance.

////////////////
// Draw min, max/restore, close buttons.
// Returns total width of buttons drawn.
//
int CCaptionPainter:rawButtons(const PAINTCAP& pc)
{
ASSERT(m_pWndHooked);
CWnd& wnd = *m_pWndHooked;
DWORD dwStyle = wnd.GetStyle();
if (!(dwStyle & WS_CAPTION))
return 0;

ASSERT(pc.m_pDC);
CDC& dc = *pc.m_pDC;

int cxIcon = GetSystemMetrics(SM_CXSIZE);
int cyIcon = GetSystemMetrics(SM_CYSIZE);

// Draw caption buttons. These are all drawn inside a rectangle
// of dimensions SM_CXSIZE by SM_CYSIZE
CRect rc(0, 0, cxIcon, cyIcon);
rc += CPoint(pc.m_szCaption.cx-cxIcon, 0); // move right

// Close box has a 2 pixel border on all sides but left, which is zero
rc.DeflateRect(0,2);
rc.right -= 2;
dc.DrawFrameControl(&rc, DFC_CAPTION, DFCS_CAPTIONCLOSE);

// Max/restore button is like close box; just shift rectangle left
// Also does help button, if any.
BOOL bMaxBox = dwStyle & WS_MAXIMIZEBOX;
if (bMaxBox || (wnd.GetExStyle() & WS_EX_CONTEXTHELP)) {
rc -= CPoint(cxIcon, 0);
dc.DrawFrameControl(&rc, DFC_CAPTION,
bMaxBox ? (wnd.IsZoomed() ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMAX) :
DFCS_CAPTIONHELP);
}

// Minimize button has 2 pixel border on all sides but right.
if (dwStyle & WS_MINIMIZEBOX) {
rc -= CPoint(cxIcon-2,0);
dc.DrawFrameControl(&rc, DFC_CAPTION, DFCS_CAPTIONMIN);
}
return pc.m_szCaption.cx - rc.left - 2;
}

AnswerRe: Custom Caption in XP Pin
Hamid_RT20-May-07 18:48
Hamid_RT20-May-07 18:48 
GeneralRe: Custom Caption in XP Pin
maxus9921-May-07 3:19
maxus9921-May-07 3:19 
QuestionSQL transaction rollback problem Pin
Moonis Ahmed20-May-07 15:12
Moonis Ahmed20-May-07 15:12 
AnswerRe: SQL transaction rollback problem Pin
zhang80060520-May-07 19:37
zhang80060520-May-07 19:37 
GeneralRe: SQL transaction rollback problem Pin
Moonis Ahmed20-May-07 19:50
Moonis Ahmed20-May-07 19:50 
GeneralRe: SQL transaction rollback problem Pin
Moonis Ahmed22-May-07 22:55
Moonis Ahmed22-May-07 22:55 
Questiondirect3d in layered wnd Pin
johny_d20-May-07 10:26
johny_d20-May-07 10:26 
QuestionHow to get hWnd in MFC? Pin
bankai12320-May-07 7:40
bankai12320-May-07 7:40 
AnswerRe: How to get hWnd in MFC? Pin
Hamid_RT20-May-07 7:57
Hamid_RT20-May-07 7:57 
AnswerRe: How to get hWnd in MFC? Pin
prasad_som20-May-07 20:16
prasad_som20-May-07 20:16 
QuestionPolygons / PtInRegion Pin
m.dietz20-May-07 6:49
m.dietz20-May-07 6:49 
Question_CrtSetBreakAlloc does nothing! Pin
dum20-May-07 6:37
dum20-May-07 6:37 
AnswerRe: _CrtSetBreakAlloc does nothing! Pin
Mark Salsbery20-May-07 7:09
Mark Salsbery20-May-07 7:09 
GeneralRe: _CrtSetBreakAlloc does nothing! Pin
dum20-May-07 8:50
dum20-May-07 8:50 
GeneralRe: _CrtSetBreakAlloc does nothing! Pin
Mark Salsbery20-May-07 9:04
Mark Salsbery20-May-07 9:04 
QuestionRe: _CrtSetBreakAlloc does nothing! Pin
dum20-May-07 9:47
dum20-May-07 9:47 
AnswerRe: _CrtSetBreakAlloc does nothing! Pin
Mark Salsbery20-May-07 11:00
Mark Salsbery20-May-07 11:00 

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.