Ok - first of all article is very enlightning - I haven't seen anywere such article before (As much as I looked through the internet.).
Several comments thoose:
Microsoft has analogue code at:
your hidden window is called a park window in MFC.
That's ok. Next thing for thoose who will be researching this subject -
scrollbars are not supported. (!) They are really not drawn for some reason , still trying to figure out correct message sending to make them work.
some controls like list view control are combined from 2 controls - e.g. header, and control itself.
WM_PAINT must be sent to both of them (unless there are some other way.) Correct repaint order must be followed.
OffsetWindowOrg with negative values could be replaced with OffsetViewportOrg.
I don't know what second OffsetWindowOrg did - I never figure out it, but to restore offset same x and y must be given with negative values.
in case of border style - SM_CXBORDER,SM_CYBORDER / 0,BF_RECT | BF_FLAT must be used.
(1 pixel black border)
I haven't found thearcticlke at MS, when I createt this, sorry.
You won't get Scrollbars work, cause they are on the nonclient area. You have to send the window a WM_NCPAINT message to get then drawn. Then you also have to copy the NC - Area to the bitmap (so you need a DC to the complete Window, not the ClientArea. I normally draw them by hand, it's not thus dificult.
Where do I use OffsetWindowOrg? I Use SetViewportOrgEx to move the WindowOrigin. I need both, cause I move the Origin right and left.
For the border: My control has a 3D Border, so that is correct. Normaly, you should chage the DrawEdge call, in case of your BorderStyle and Appearance properties. But this was only for showing, how to do it, so I didn't do everything, you normally do in an ActiveX Control.
have fun with this article.
Last Visit: 31-Dec-99 18:00 Last Update: 24-Oct-16 12:43