bitbucket: C++ MFC ATL WTL Win32 COM ActiveX Samples Tutorials Source Code Controls

BitBucket HowTo's


These articles demonstrate various odds and ends in Windows programming. Most of them come with a sample applicaiton (or, at least, a sample code snippet). In most cases, you can#t plug them 1:1 into your project without understanding what's going on. 


Checkboxes in a tree control shows how to add normal and three-state checkboxes to a tree control, and how to get notified when the checkbox changes. The sample project uses MFC, but the technique can easily be adapted to a Win32 or an ATL/WTL application.

Resize ActiveX controls fixes an issue with certain ATL ActiveX controls in an MFC container. Symptoms: the control seems to resize correctly, but when you click on it, it jumps back to it's original size.

AtlAdviseSinkMap_Ex - The sample - showing how to host the WebBrowser control, and intercepting OnBeforeNavigate events - might be mreo interesting than the core of the article itself: Remove an extra window layer when hosting ActiveX controls.

MDI Close All Windows is a snippet that closes all child windows in an MDI application.

Proportional Resize - Keep the width:heigth ratio of a window the same when it's resized.