Question : Draw a scroll bar into non-client area

How can I draw a standard scrollbar in the non-client area of my CWnd derived class ?
I try to create a scrollbar child control but it is never refreshed.
I don't want to draw the entire scoll bar myself in the OnNcPaint handler...

Answer : Draw a scroll bar into non-client area

I asked the same question.  It is at:
http://www.experts-exchange.com/topics/comp/os-ms-windows/programming/owl/Q.10051718

The summary:
First of all, a child window is confined to its parent windows CLIENT area.  So a child window definitly will not work.

There are three ways around this.  

First, you might be able to get around this using a pop-up window.  That is, a window that doesn't specify the WS_CHILD and that specifies the other window as an owner.  You would have to move and size this pop-up window whenever the owner window is moved or sized.  Big pain in the ass.

Second, rather than increasing the size of the non-client area, you could put the control in the client area and draw things so that it appears to be in the non-client area.  This may not be possible depending on the geometry of the situation however.

Third, impliment them "brute force".  You draw the button "manually" when the window gets the non-client paint message.  You indicate a hit on the button by handling the non-client hit test message.  You react to the button being pressed on a non-client mouse down message witht he appropriate hit test value.  

Random Solutions  
 
programming4us programming4us