Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why StatusBar is painted in two locations?... 1

Status
Not open for further replies.

XPPROGRAMMER

Programmer
Nov 15, 2004
44
US
Hello Everyone,

I can use your kind help with this problem --- I have
a StatusBar in my GUI window which gets painted at the
bottom of that window when the program runs. However,
when the window gets maximized, sized or re-sized, the
StatusBar would be painted in two or three locations,
the bottom of the window and in the middle as well. I am
using win32 API createwindowEx to paint the SatusBar.
can you please tell me what I am doing wrong.
thanks for the help.
 
Without examining your code, I would guess that you are creating another status bar every time the window repaints;
try moving the call to CreateWindowEx for the status bar to your parent window's initialization function and call the repaint function for the status bar when the window repaints.
Also, if you are creating the status bar as a child window, the parent's repaint function should repaint the Status bar automatically; however if you have overridden the parent's repaint, all bets are off and I would code in the call to the statusbar's repaint.
 
Hi Prattaratt,

thanks for the feedback and the helpful tips. I have
discovered that I needed to use the win32 api function
"movewindow" to move the statusbar to the bottom of the
screen when the window procedure receives the wm_size
message. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top