Click here to Skip to main content
13,260,383 members (43,547 online)
Click here to Skip to main content
Add your own
alternative version


20 bookmarked
Posted 17 Aug 2003

Auto Completion ComboBox for WTL

, 17 Aug 2003
Rate this:
Please Sign up or sign in to vote.
Implementation of Auto Completion ComboBox for WTL
<!-- Article image -->

Sample Image - wtlautocompletecombo.jpg

<!-- Add the rest of your HTML here -->


This article assumes the reader has a basic understanding of C++, Win32 Programming and WTL.

This is an implementation auto completion ComboBox for WTL. This is actually a port of an MFC version found here which Chris Maunder developed.


There's not much to say about an auto completion ComboBox, except that the combo style usually includes CBS_DROPDOWN. It's up to the developer to serialize the contents of the ComboBox (which means loading/saving to a registry, file or database). To help you implement the auto completion dialog in your projects I have labeled code lines that are needed with // _AC_INSERT_ comments.

Using the code

Using the code in your project is pretty simple, the first the step is to edit the header file of your dialog or window class and include the line #include <span class="code-string">"AutoCombo.h"</span>.

The next step is to insert the line CAutoCombo m_cboAuto; as a member variable of your dialog or window class.

To ensure combo messages are handled in the inherited auto completion combo class we must reflect any notifications to other controls, see the following code snippet.

... Some other code
... Some other code

One thing to note here is if there are any ATL_ message macros, the REFLECT_NOTIFICATIONS() must be at the beginning of ATL_ message macros.

Finally subclass the combo control by adding the following line when the dialog box is initialised or the window is created (usually handled  in a WM_INITDIALOG handler or WM_CREATE handler.


V1.0 Article creation.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Software Developer (Senior) Software Kinetics
United Kingdom United Kingdom

Software Kinetics
are experts in developing customised and bespoke applications and have expertise in the development of desktop, mobile and internet applications on Windows.

We specialise in:

  • User Interface Design
  • Desktop Development
  • Windows Phone Development
  • Windows Presentation Framework
  • Windows Forms
  • Windows Communication Framework
  • Windows Services
  • Network Applications
  • Database Applications
  • Web Development
  • Web Services
  • Silverlight

Visit Software Kinetics

You may also be interested in...

Comments and Discussions

GeneralMy vote of 4 Pin
zighouse21-May-12 19:29
memberzighouse21-May-12 19:29 
Good, if it droped the list down while editing, it would be better.
GeneralPreTranslateMessage Pin
berupon6-May-06 6:06
memberberupon6-May-06 6:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171114.1 | Last Updated 18 Aug 2003
Article Copyright 2003 by NormDroid
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid