Click here to Skip to main content
Licence 
First Posted 23 Oct 2001
Views 66,824
Bookmarked 20 times

CDialogEx New Ownerdrawn Dialog Base Class

By | 24 Oct 2001 | Article
Custom non-client drawn dialog base derived from CDialog.

Introduction

Using this class you can subclass CDialog. The main reasons for doing this are twofold - to minimize the work done by your MFC dialog-class (like removing silly icon paint on minimized) and thereby decrease your workload and to personalize your dialogs (and to have some fun).

In the example project, notice that you have to link againt msimg32.lib in order to use the ::GradientFill(...) function but you do not have to compile using a redefinition of WINVER and/or _WIN32_WINNT. For details see my slightly modifyed stdafx.h. If you allow redefine WINVER to 0x0500 a better set of constructors are avalible using information for the gradient fill of the active caption on the target OS. Needless to say of course - but using this base class you can have dialogs (or windows with a small modification) in 'private' colors because they paint themselves.

I don't think that there is much more to it. Using the class is in the exact same manner as its base class (plain CDialog) - apart from bigger constructors.

Note that not all event handlers are used. I have implemnted them for future versions.

Good luck.

Ps. And yes I respond to WM_SYSCOLORCHANGE :-).

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

Michael Pauli

Software Developer (Senior)

Denmark Denmark

Member

Unemployed c-developer.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Questionwhat if menu is present? PinsussSubrahmanyam2:36 5 Sep '02  
GeneralCaption gets truncated under WinMe, OK under WinXP Pinmemberwindeveloper23:05 25 May '02  
GeneralUpdated OnNCActivate(...) PinmemberMichael Mogensen3:56 26 Oct '01  

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.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 25 Oct 2001
Article Copyright 2001 by Michael Pauli
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid