Tech Support > Microsoft Windows > Development Resources > Dialogs again
Dialogs again
Posted by Allan Bruce on July 17th, 2003


In my dialog box, I am redrawing a rectangel based on the position of
sliders. I use this code to see if the sliders have moved

case WM_VSCROLL :
GetWindowRect(hDlg, &rect);
InvalidateRect(hDlg, &rect, FALSE);
return TRUE;

This works fine unless the user moves the dialog box then the redrawing
doesnt work. How can I get around this (without making the dialog box
non-movable).
Also, is there a WM_ message I can send to change the title of the dialog
box?
Thanks
Allan


Posted by Sten Westerback on July 17th, 2003



"Allan Bruce" <allanmb@TAKEAWAYf2s.com> wrote in message
news:bf5kbp$lb4$1@news.freedom2surf.net...
You could memorize WM_SIZE information.. but you should
use GetClientRect()... or just invalidate the whole window
by specifying NULL instead of &rect.

There is... but mostly one uses the API SetWindowText().

..- Sten



Posted by Damian Driscoll on July 17th, 2003


Allan Bruce wrote:

This doesn't make sense to me. GetWindowRect returns a rectangle in screen
coordinates and InvalidateRect expects a rectangle in client coordinates so
unless the dialog box is in the top left of the screen it's not going to
work. Use GetClientRect instead.

WM_SETTEXT or call SetWindowText()

Damian

Posted by Tim Robinson on July 17th, 2003


"Allan Bruce" <allanmb@TAKEAWAYf2s.com> wrote in message
news:bf5kbp$lb4$1@news.freedom2surf.net...
InvalidateRect(hDlg, NULL, FALSE);

--
Tim Robinson (MVP, Windows SDK)
http://www.themobius.co.uk/




Similar Posts