Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29278 Discussions

Advice please on handling multiple toolbars

michael_green
Beginner
353 Views
Hi All,
I'm having much trouble handling 4 different toolbars in the one application - inexperience showing through here. The application (a geographical information system) operates in 4 different modes with a dedicated toolbar for each of its 4 main screens.
I switch between toolbars using ShowWindow(hTB,SW_HIDE) and ShowWindow(hTB,SW_SHOW). These calls seem to issue their own WM_PAINT messages which cause the screen refeshing functions that I call with InvalidateRect to execute twice. Normally this might not matter much, but because I am displaying dense geographical information it can take 5 or 6 seconds to display it all - to have to go throught it all twice while the toolbar changes over is too much.
The problem does not occur if I don't call ShowWindow(hTB,SW_HIDE), but then I don't get the correct toolbar - the old one is still on display. If I call it but disable my call to InvalidateRect, the screen does not get refreshed at all.
What am I doing wrong?
With many thanks in advance,
Mike
0 Kudos
1 Reply
anthonyrichards
New Contributor III
353 Views
It sounds like you need only repaint the area of the main window that is covered by the current toolbar, which is about to be deleted. Isn't this automatically done by Windows? What happens if you display another application's window so that it obscurs part of your window and then you minimise the obscuring window?
0 Kudos
Reply