Click here to Skip to main content
Click here to Skip to main content

Pretty WinAPI Class

, 23 May 2007
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

Introduction

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.

Overview

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:

History

  • 23 May, 2007 - Version 0.1 released

License

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.
 
fcampos@beyondata.com / francisco.camposg@gmail.com

Comments and Discussions

 
QuestionThank you, Francisco PinpremiumDavid O'Neil6-Jul-14 19:57 
GeneralMy vote of 5 PinmemberAgump31-Mar-13 22:49 
GeneralImpressive PinmemberMitch D5-Feb-12 15:34 
GeneralCan't compile Dev-C++ (gcc) version :( Pinmembertootall25-Jan-11 9:43 
GeneralRe: Can't compile Dev-C++ (gcc) version :( PinmemberFrancisco Campos Gualdron15-Mar-12 8:42 
GeneralCompiled Binaries Please PinmemberAlex Essilfie30-Jun-10 2:38 
Generalwm_paint message in loop Pinmemberrgb912-Jan-09 14:00 
GeneralRe: wm_paint message in loop PinmemberFrancisco Campos Gualdron3-Jan-09 2:44 
GeneralNew Version PinmemberFrancisco Campos Gualdron7-Nov-08 20:09 
Hi,
 
On February I'll raise a new release.
 
Regards,
 
Francisco
GeneralRe: New Version Pinmembermaplewang4-Mar-09 1:13 
GeneralToolbars [modified] PinmemberPandele Florin16-Nov-07 5:01 
GeneralImpresive effort made useless PinmemberPandele Florin13-Nov-07 6:32 
Generalmemory leak in demo Pinmemberlaocaicai17-Oct-07 4:32 
GeneralGreat job Pinmembermaplewang12-Jul-07 16:01 
QuestionCRect Pinmemberesskar9-Jul-07 23:04 
GeneralGood Job Pinmemberdenisswap1-Jun-07 17:25 
GeneralFYI - VCF, U++ Pinmemberstephen_w_simpson28-May-07 19:54 
GeneralRe: FYI - VCF, U++ PinmemberFrancisco Campos Gualdron29-May-07 2:22 
Generalnice project but.... PinmemberDYH26-May-07 1:02 
GeneralRe: nice project but.... PinmemberFrancisco Campos Gualdron29-May-07 2:24 
GeneralRe: nice project but.... PinmemberJim Crafton13-Nov-07 7:31 
Questionhow to get it work under the mingw toolchain? Pinmembersnija024-May-07 12:54 
AnswerRe: how to get it work under the mingw toolchain? PinmemberFrancisco Campos Gualdron29-May-07 2:31 
Generalcompile error Pinmemberkmlch23-May-07 19:17 
GeneralRe: compile error PinmemberFrancisco Campos Gualdron29-May-07 2:28 

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

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

| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 23 May 2007
Article Copyright 2007 by Francisco Campos Gualdron
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid