Does CWnd::GetClientRect() include the toolbar region?
Whenever i use InvalidateRect(), i pass the entire client region for repaint, inorder to retain the client window contents :

InvalidateRect(NULL);

But this affects my toolbars ( my application has two toolbars. ) - they disappear. I think it is because of InvalidateRect().

I am looking forward for a sound solution.

>>Does CWnd::GetClientRect() include the toolbar region?
Not sure if it does or not. Try using CWnd::GetWindowRect() and see if that fixes the problem.

>>Does CWnd::GetClientRect() include the toolbar region?
Not sure if it does or not. Try using CWnd::GetWindowRect() and see if that fixes the problem.

i think GetWindowRect() actually uses a rectangle based on screen co-ordinates. But my toolbars are also dockable on either sides, thus changing the co-ordinates. So i dont think GetWindowRect() can be useful to me.
Please see if you have a better solution. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.