Click here to Skip to main content
13,349,033 members (71,090 online)
Click here to Skip to main content
Add your own
alternative version


78 bookmarked
Posted 23 May 2007

Pretty WinAPI Class

Rate this:
Please Sign up or sign in to vote.
New library version that is not WTL/MFC dependent

Screenshot - DevStudioSmall.jpg

Screenshot - OutlookDemoSmall.jpg

Screenshot - MDISmall.jpg


When I developed GuiToolkit, lots of people wrote me asking for a new version of the library that was not WTL/MFC dependent. In the beginning I thought the idea was preposterous, but after writing some lines I found it interesting and, as you can see, I don't know when I wrote those loads of code. This library is not an alternative to MFC, MTL, etc. Thinking of it that way would be absurd. It is simply a curiosity that may help you understand wrappers. I tried to make the code simple enough that anyone can understand it. Nevertheless, I don't guarantee that it is well written. As always, it can be a terrible or good programming example.

What I expect from you

First of all, I want to thank you for taking your time checking the code or playing a bit with the examples. If you are interested in the project, you can send me new classes or corrections to the code. This time, the entire code is my responsibility except for one array control class published in CodeProject. This one gives me the opportunity to reply to messages.


To develop it, I did not use the formal architecture. I just needed to think about a base scheme and create classes around it from there. As you can see when checking the code, I have a big MFC dependence. That is why some classes have similar names. I designed a similar scheme, at least in the appearance, based on macros. CWin is the fundamental library class. Its function is to surround the Windows API base and the WndProc function. CWin inherits the CMsg message structure; see the file CMacrodefine.h. It contains one NewMsgProc virtual function that is replaced later by the macros that invoke message processing functions. The library is logically arranged by a group of base classes. These classes surround the Windows fundamental controls and other extensions of advanced components under the name of swcext. Unfortunately, I can't make a detailed description so I'm presenting a quick reference to the fundamental files:

  • CApp.h: Class application wrapper, its function is to start the code execution.
  • CCommonCtrl.h: Common Windows controls wrapper, toolbox and status bar decorations.
  • CDialogControl.h: Common dialog box wrapper and base dialog box class.
  • CFrame.h: Wrapper of the base frame for the management of SDI and MDI windows, Docking Bar and the hook menu class.
  • CGdi.h: GDI functions wrapper and window decoration classes.
  • CMenuSpawn.h: Wrapper of the menu extension with icon support and a modern look.

Library features

Here's a list of some main features of this library:

  • Modern look in the Visual Studio 2005 style.
  • The decorated menu is included in the fundamental class that administrates MDI and SDI.
  • All common controls are sub-classed to allow easy message manipulation.
  • LINK_Control function that allows easy message manipulation, text box message manipulation, etc.
  • It doesn't require aditional DLLs.
  • Small executable files.
  • Docking bars included in the main frame.
  • Detachable docking tabs.
  • MDI tabs.
  • The tabs can be moved and docked in another window.
  • Advanced extensions like Comboboxext, Outlook bar, Splitter, List header subclass, Toolbutton extension, Worktab, Visual Studio Toolbox class.
  • Easy migration of GuiToolkit classes.
  • Similar MFC coding style; it is not a companion.
  • Toolbar and Menus with true color support.
  • Toolbars Combobox buttons.

It is free, so use it as you please. I would like you to give me some credit in your developments, though. As you can see, it is a job that consumed a lot of my time and it is not easy to make something from zero. Ideas are always welcome.

What it does not include

I tried to eliminate all of the resource liberation and memory bugs but, as all software comes equipped with its own bugs, please let me know if you find others. Here's a list of some known problems and additional components that I hope to have available in the next version:

  • It does not include a string management class like CString; please suggest one or develop your own.
  • It does not work under Windows 98, as it looks like the hook and a retrocall problem cause a Windows freeze. However, I'm not dedicating time to a dead OS.
  • There is no documentation. I hope to write some articles on my website about the library, but it is possible that you'd prefer me to invest that time developing code or additional components.
  • There is no support; I'm sorry.
  • The autohidden classes of the docking windows are already designed and included, but are not developed.
  • The windows don't have memory (persistent); nevertheless the base code is already developed and needs to be finished.
  • Simple horizontal and vertical docking in Left, Right and Bottom, but why not Top? Good question.
  • In release mode, compile only in level Minimize Size (/01).

Webpages of interest

Please refer to the following webpages for more information:


  • 23 May, 2007 - Version 0.1 released


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

My name is Francisco Campos, A developer as you.I have the title of Engineer of Systems of the Universidad Autonoma de Colombia.My real Job Information Security officer, experience in security assessment, applications, and other related subjects.

At the moment I live in Bogotá Colombia with my wife Zoraida and my three children Carolina, Andrés and Diego. /

You may also be interested in...

Comments and Discussions

GeneralToolbars [modified] Pin
Pandele Florin16-Nov-07 6:01
memberPandele Florin16-Nov-07 6:01 

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
Web03 | 2.8.180111.1 | Last Updated 23 May 2007
Article Copyright 2007 by Francisco Campos Gualdron
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid