Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: error C2664: 'strcpy' : cannot convert parameter 1 from 'union tagCY' to 'char *' Pin
Nibu babu thomas5-Nov-06 18:32
Nibu babu thomas5-Nov-06 18:32 
AnswerRe: error C2664: 'strcpy' : cannot convert parameter 1 from 'union tagCY' to 'char *' Pin
Hamid_RT5-Nov-06 19:33
Hamid_RT5-Nov-06 19:33 
AnswerRe: error C2664: 'strcpy' : cannot convert parameter 1 from 'union tagCY' to 'char *' Pin
David Crow6-Nov-06 4:36
David Crow6-Nov-06 4:36 
QuestionInsert data Pin
With_problem5-Nov-06 17:26
With_problem5-Nov-06 17:26 
QuestionOpenPrinter error Pin
Archyami5-Nov-06 17:09
Archyami5-Nov-06 17:09 
AnswerRe: OpenPrinter error Pin
Waldermort5-Nov-06 18:11
Waldermort5-Nov-06 18:11 
AnswerRe: OpenPrinter error Pin
Hamid_RT5-Nov-06 18:39
Hamid_RT5-Nov-06 18:39 
GeneralOwner drawn status bar and the sizegrip [modified] Pin
PJ Arends5-Nov-06 16:09
professionalPJ Arends5-Nov-06 16:09 
I am having a small problem with an owner drawn status bar pane and the resizing size grip that is located in the bottom corner of my main window. Normally when one resizes a window and makes it smaller to the point where the first message pane in the status bar can no longer be made any smaller the size grip will be drawn over top of the panes under it, erasing the pane so that it does not show through the size grip. But with my owner drawn pane the erasing does not happen, the size grip is simply drawn over it. You can see what I mean by looking at the picture I posted here[^].

The picture consists of three images, the top is a normal status bar with the size grip on the right. The middle one shows how the size grip draws over a pane, erasing the pane so it does not show through the size grip. The bottom is what I am getting with my owner drawn pane. I want my custom pane to react to the size grip the same way the default panes do.

Here is the relevant (I hope) code for my custom pane:
BOOL CMyStatusBar::Create(CWnd *pParent)
{
    BOOL ret = CStatusBar::CreateEx(pParent, SBARS_SIZEGRIP); // skipping SBARS_SIZEGRIP makes no diff
 
[snipped]

    return ret;
}

void CMyStatusBar::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
    if (2 == lpDrawItemStruct->itemID)
    {
        HDC hdc = lpDrawItemStruct->hDC;
        CRect rc(lpDrawItemStruct->rcItem);
 
[snipped]
 
        // BackgroundDC is the double buffered dc containing the panes image
        TRACE(_T("rc.Width() is %d\n"), rc.Width());
        BitBlt(hdc, rc.left, rc.top, rc.Width(), rc.Height(), BackGroundDC, 0, 0, SRCCOPY);
    }
}
The problem is that the width of the rectangle supplied to DrawItem() extends right up to the right hand border of the status bar. It is not truncated because of the presence of the size grip.

Is there something I am missing? Any ideas or help would be appreciated.

ThanksSmile | :)

[edit]
I should mention I am using MFC8.0 on XP SP2 for this.
[/edit]
Last modified: 22mins after originally posted --



You may be right
I may be crazy
-- Billy Joel --


Within you lies the power for good, use it!!!

GeneralRe: Owner drawn status bar and the sizegrip Pin
Nibu babu thomas5-Nov-06 18:15
Nibu babu thomas5-Nov-06 18:15 
GeneralRe: Owner drawn status bar and the sizegrip Pin
Waldermort5-Nov-06 18:21
Waldermort5-Nov-06 18:21 
GeneralRe: Owner drawn status bar and the sizegrip Pin
PJ Arends5-Nov-06 21:51
professionalPJ Arends5-Nov-06 21:51 
QuestionFTP REST command Pin
rayong5-Nov-06 6:53
rayong5-Nov-06 6:53 
AnswerRe: FTP REST command Pin
kakan5-Nov-06 19:21
professionalkakan5-Nov-06 19:21 
GeneralRe: FTP REST command Pin
rayong5-Nov-06 22:23
rayong5-Nov-06 22:23 
QuestionVS2005 Preprocessor quirks [modified] Pin
#realJSOP5-Nov-06 3:41
professional#realJSOP5-Nov-06 3:41 
AnswerRe: VS2005 Preprocessor quirks Pin
Sceptic Mole5-Nov-06 8:17
Sceptic Mole5-Nov-06 8:17 
GeneralRe: VS2005 Preprocessor quirks Pin
#realJSOP5-Nov-06 23:52
professional#realJSOP5-Nov-06 23:52 
AnswerRe: Modal floating controlbar Pin
Nibu babu thomas5-Nov-06 18:12
Nibu babu thomas5-Nov-06 18:12 
GeneralRe: Modal floating controlbar Pin
Nibu babu thomas13-Nov-06 21:22
Nibu babu thomas13-Nov-06 21:22 
GeneralRe: Modal floating controlbar Pin
Nibu babu thomas14-Nov-06 16:26
Nibu babu thomas14-Nov-06 16:26 
QuestionRussian Project [modified] Pin
Hadi Dayvary4-Nov-06 23:59
professionalHadi Dayvary4-Nov-06 23:59 
AnswerRe: Russian Project Pin
A_Fa5-Nov-06 0:10
A_Fa5-Nov-06 0:10 
AnswerRe: Russian Project Pin
Waldermort5-Nov-06 0:11
Waldermort5-Nov-06 0:11 
GeneralRe: Russian Project Pin
Hadi Dayvary5-Nov-06 0:44
professionalHadi Dayvary5-Nov-06 0:44 
GeneralRe: Russian Project Pin
Waldermort5-Nov-06 1:29
Waldermort5-Nov-06 1:29 

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.