Category: WTL

Windows Template Library related

How to intercept paste from clipboard into standard EDIT control with ATL and WTL

This sample project features subclassing EDIT control to intercept paste from clipboard and handle it programmatically. The sample fetches text from clipboard, converts it to upper case and replaces control’s selection with this text. There may be more specific handling, such as, for example, recognizing URL being pasted, splitting it into parts and filling multiple…

Read the full article

How to customize OLE property frame window with ATL and WTL

Window API provides useful functions OleCreatePropertyFrame and OleCreatePropertyFrameIndirect, which allow easily to pop up object’s property pages, OLE property pages. The frame, however, is not customizable, does not even allows centering relative to parent’s window. COlePropertyFrameDialogT template class is to be a solution for this problem. Additionally the template offers useful methods to discover available…

Read the full article

CHyperStatic: a hypertext static control in ATL and WTL

As well known, WTL provides CHyperLinkImpl custom control implementation to use clickable hyperlink controls. Also control uses a few styles (underlining, tags, command vs. notify notifications), the main implementation is limited: control frequently requires static text, tooltip text and location for ShellExecute; you cannot embed all three strings into dialog template control’s window text so…

Read the full article

How to add features to standard message boxes in ATL and WTL

MessageBox function is easy to use but it sometimes lacks features. They can be added through a hook, however. This sample demonstrates three features for message boxes: AtlMessageBoxEx shows message box centered by parent window AtlTimedMessageBoxEx shows message box with countdown timer to close AtlOptionalMessageBoxEx shows message box with checkbox to suppress the box in…

Read the full article

How to use native window classes (controls) in resource dialog templates in ATL and WTL

Having custom controls implemented as window classes, it is convenient to use them directly in resource dialog templates. Visual Studio resource editor allow to add custom control item to dialog. This custom control has a Class property which defines window class name of the control. Should native C++ implementation of window class be registered, it…

Read the full article