Monthly Archives: January 2007 - Page 3

How to create cursors on runtime in ATL and WTL

This sample projects shows how to create a cursor on runtime using CreateIconIndirect API as well as compose a new cursor out of the two cursor images, base and overlay image. A new cursor is composed out of system IDC_ARROW cursor and an application cursor resource.

Keywords: HCURSOR, GetIconInfo, CreateIconIndirect.

Visual C++.NET 2005 source code can be downloaded here, compiled binary – here.

CColorComboBox: a fancy color combo box control in ATL and WTL

CColorComboBox is a customized combo box control which offers color selection using a set of predefined colors as well as opportunity to choose custom color using common color dialog.

image001.png

Read more »

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 controls with URL parts (protocol, host, port, query etc.)

Keywords: CContainedWindow, ALT_MSG_MAP, WM_PASTE, CF_TEXT, GetClipboardData

Visual C++.NET 2003 source code can be downloaded here, compiled binary – here.