lwinkenb
asked on
Odd flicker problem
I have a window with 3 controls on it. A richedit control, an editbox control, and a listbox control. None of these controls ever overlap at all.
While resizing the window, the richedit control, and the listbox control flicker very badly, but the editbox control doesn't flicker at all. If I remove the listbox control, then nothing flickers when I'm resizing the window.
If I put all 3 controls in the window, and make the listbox control exactly 50 units in height, then nothing flickers when I resize the window. This is very odd to say the least.
Here is my function which gets called during the WM_SIZING and WM_SIZE messages:
void ResizeControls(HWND hwndChild, RECT *prect)
{
HWND hChildCtrl;
RECT *r = prect;
int cx, cy;
cy = r->bottom - r->top;
cx = r->right - r->left;
/* Get the handle to the listbox window, and set its new position */
hChildCtrl = GetDlgItem(hwndChild,IDC_L IST);
SetWindowPos(hChildCtrl,hw ndChild,r- >right-r-> left-140,5 ,120,r->bo ttom-r->to p-75,SWP_N OZORDER);
/* Get the handle to the rich edit window, and set its new position */
hChildCtrl = GetDlgItem(hwndChild,IDC_R ICHEDIT);
SetWindowPos(hChildCtrl,hw ndChild,0, 0,cx-160,c y-75,SWP_N OZORDER|SW P_NOMOVE);
/* Get the handle to the edit window, and set its new position */
hChildCtrl = GetDlgItem(hwndChild,IDC_E DIT);
SetWindowPos(hChildCtrl,hw ndChild,5, cy - 65,cx-20,25,SWP_NOZORDER);
}
While resizing the window, the richedit control, and the listbox control flicker very badly, but the editbox control doesn't flicker at all. If I remove the listbox control, then nothing flickers when I'm resizing the window.
If I put all 3 controls in the window, and make the listbox control exactly 50 units in height, then nothing flickers when I resize the window. This is very odd to say the least.
Here is my function which gets called during the WM_SIZING and WM_SIZE messages:
void ResizeControls(HWND hwndChild, RECT *prect)
{
HWND hChildCtrl;
RECT *r = prect;
int cx, cy;
cy = r->bottom - r->top;
cx = r->right - r->left;
/* Get the handle to the listbox window, and set its new position */
hChildCtrl = GetDlgItem(hwndChild,IDC_L
SetWindowPos(hChildCtrl,hw
/* Get the handle to the rich edit window, and set its new position */
hChildCtrl = GetDlgItem(hwndChild,IDC_R
SetWindowPos(hChildCtrl,hw
/* Get the handle to the edit window, and set its new position */
hChildCtrl = GetDlgItem(hwndChild,IDC_E
SetWindowPos(hChildCtrl,hw
}
Try using MoveWindow instead of SetWindowPos.
ASKER
MoveWindow gives me the same problem.
in the dialog properties you can set ClipChildren... Or
OnInitDialog of the Parent window put the code..
ModifyStyle(0, WS_CLIPCHILDREN);
~roshan
OnInitDialog of the Parent window put the code..
ModifyStyle(0, WS_CLIPCHILDREN);
~roshan
ASKER
It's not a dialog, it's actually a child MDI window. The client window already has the style WS_CLIPCHILDREN.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I was able to get a working solution from the information from that link.