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

C / C++ / MFC

 
Generalpainting background while resizing..... Pin
Neha19-Nov-02 23:58
Neha19-Nov-02 23:58 
GeneralRe: painting background while resizing..... Pin
Rickard Andersson2020-Nov-02 1:23
Rickard Andersson2020-Nov-02 1:23 
GeneralRe: painting background while resizing..... Pin
Gary R. Wheeler20-Nov-02 13:57
Gary R. Wheeler20-Nov-02 13:57 
GeneralRe: painting background while resizing..... Pin
Anonymous20-Nov-02 20:39
Anonymous20-Nov-02 20:39 
GeneralRe: painting background while resizing..... Pin
KarstenK20-Nov-02 1:24
mveKarstenK20-Nov-02 1:24 
GeneralRe: painting background while resizing..... Pin
georgiek5020-Nov-02 2:21
georgiek5020-Nov-02 2:21 
GeneralRe: painting background while resizing..... Pin
KarstenK20-Nov-02 2:41
mveKarstenK20-Nov-02 2:41 
GeneralRe: painting background while resizing..... Pin
georgiek5020-Nov-02 8:38
georgiek5020-Nov-02 8:38 
I tried all of the above yet with no luck. Should I be disabling the background painting in the WM_PAINT message of WM_SIZE? If so what is the code for this? Maybe some code helps:

Here's my paint message:

case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rectClient);

// Set Text Attributes
SetTextColor(hdc, RGB(0, 0, 225));
SetBkMode(hdc, TRANSPARENT);
SelectObject(hdc, GetStockObject(SYSTEM_FIXED_FONT));

// Draw the Text
DrawText(hdc, szHeading, strlen(szHeading), &rectClient, DT_TOP |
DT_CENTER);

// Draw Horizontal Line
MoveToEx(hdc, 0, 35, NULL);
LineTo(hdc, rectClient.right, 35);

// Draw Vertical Line
MoveToEx(hdc, rectClient.right / 2, 35, NULL);
LineTo(hdc, rectClient.right / 2, rectClient.bottom - 100);

MoveToEx(hdc, 0, rectClient.bottom - 100, NULL);
LineTo(hdc, rectClient.right, rectClient.bottom - 100);

EndPaint(hwnd, &ps);

return 0;

And here is my sizing and colorlistbox message

case WM_SIZE:
cxClient = LOWORD(lParam);
cyClient = HIWORD(lParam);

MoveWindow(hwndLocalList, 5, 70, (cxClient / 2) - 10, cyClient - 165, FALSE);
MoveWindow(hwndHostList, (cxClient / 2) + 5, 70, (cxClient / 2) - 10,
cyClient - 165, FALSE);

return 0;

case WM_CTLCOLORLISTBOX:
SetTextColor( (HDC) wParam, RGB(255, 255, 255));
SetBkColor( (HDC) wParam, crBlue);
SelectObject( (HDC) wParam, GetStockObject(SYSTEM_FIXED_FONT));

return (LRESULT) hBlueBrush;

their wndclass.style is CS_VREDRAW | CS_HDREDRAW

Do you see what is wrong with the code?
GeneralWH_JOURNALRECORD and WH_JOURNALPLAYBACK Pin
w200219-Nov-02 23:53
w200219-Nov-02 23:53 
GeneralCWebBrowser2 Control Question Pin
Anonymous19-Nov-02 23:49
Anonymous19-Nov-02 23:49 
GeneralRe: CWebBrowser2 Control Question Pin
Shaun Wilde20-Nov-02 1:22
Shaun Wilde20-Nov-02 1:22 
GeneralRe: CWebBrowser2 Control Question Pin
Anonymous22-Nov-02 2:44
Anonymous22-Nov-02 2:44 
GeneralRe: CWebBrowser2 Control Question Pin
Shaun Wilde22-Nov-02 5:25
Shaun Wilde22-Nov-02 5:25 
General::Postmessage(...) Pin
Raphael Kindt19-Nov-02 23:43
Raphael Kindt19-Nov-02 23:43 
GeneralRe: ::Postmessage(...) Pin
Hans Ruck20-Nov-02 1:03
Hans Ruck20-Nov-02 1:03 
GeneralIn what situation the winsock overlapped operation will return without complete the task Pin
Kerry Chou19-Nov-02 23:31
Kerry Chou19-Nov-02 23:31 
GeneralRe: In what situation the winsock overlapped operation will return without complete the task Pin
Jon Hulatt20-Nov-02 1:43
Jon Hulatt20-Nov-02 1:43 
QuestionHow to Get LPDRAWITEMSTRUCT from CWnd pointer? Pin
RuiSantiago19-Nov-02 23:31
RuiSantiago19-Nov-02 23:31 
AnswerRe: How to Get LPDRAWITEMSTRUCT from CWnd pointer? Pin
RuiSantiago20-Nov-02 1:47
RuiSantiago20-Nov-02 1:47 
GeneralMyPen.CreatePen(PS_COSMETIC|PS_ALTERNATE, 1, &logbr) fails in Win98 Pin
Daed19-Nov-02 22:31
Daed19-Nov-02 22:31 
GeneralRe: MyPen.CreatePen(PS_COSMETIC|PS_ALTERNATE, 1, &logbr) fails in Win98 Pin
KarstenK20-Nov-02 1:23
mveKarstenK20-Nov-02 1:23 
GeneralDocking bars and statusbar problem Pin
BishGada19-Nov-02 22:17
BishGada19-Nov-02 22:17 
GeneralRe: Docking bars and statusbar problem Pin
KaЯl20-Nov-02 0:09
KaЯl20-Nov-02 0:09 
GeneralRe: Docking bars and statusbar problem Pin
BishGada20-Nov-02 1:52
BishGada20-Nov-02 1:52 
GeneralRe: Docking bars and statusbar problem Pin
KaЯl20-Nov-02 2:16
KaЯl20-Nov-02 2:16 

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.