📄 demo_ui_mfcxlib.shtml.htm
字号:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content="zafir anjum">
<title>mfc programmer's sourcebook : advanced ui</title>
<meta name="description" content="source code for implementing advanced ui features">
<meta name="keywords" content>
</head>
<body background="../di2001.jpg"
tppabs="http://www.codeguru.com/fancyhome/back.gif" bgcolor="#ffffff">
<h3 align="center"><font color="#aoao99">mfc extension library - cj60lib ( updated for
visual c++ 6.0 ) </font></h3>
<hr>
<!-- author and contact details -->
<p>this article was contributed by <a href="mailto:kstowell@codejockeys.com">kirk stowell</a>.
<!-- start of article --></p>
<h2>mfc extension library - cj60lib ( updated for visual c++ 6.0 )</h2>
<p>the original library (mfcxlib) was renamed to cj60lib, in order to break any links that
may have been established with any applications using the old library, and to establish a
version control system. the library has the same functioinality as the old one, however,
there have been several enhancements for compatibility with visual c++ 6.0.</p>
<p><b>follow these steps to setup your application to use cj60lib mfc extension library:</b>
<ul>
<li>in your project settings, select the <b>general</b> tab. make sure that <b>microsoft
foundation class </b>is set to <b>use mfc in a shared dll</b>.</li>
<li>in your project settings, select the <b>link</b> tab. set the <b>category</b> to <b>input</b>,
and add <b>../lib</b> to <b>additional library path</b>.</li>
<li>while still in the <b>link</b> tab, change <b>category</b> to <b>general</b>. for <b>output
name</b> (all configurations), build to the <b>../lib</b> directory. this makes the
execution and debugging easier, since both <b>dll</b> and <b>exe</b> are located in the
same directory. an example of this would be: <b>../lib/mydemo.exe</b>.</li>
<li>select the c/c++ tab next. change category to preprocessor, and add ../include to
additional include directories.</li>
<li>the last step would be to add the following two lines of code to your <b>stdafx.h</b>
header file, which will import all exported classes, and grant access to your entire
application:</li>
</ul>
<!-- start a block of source code -->
<pre><font color="#990000"><tt>
<b>#define mfcx_proj
#include <cj60lib.h></b>
<!-- end the block of source code -->
</pre>
</tt></font>
<p><b>in order to statically link to cj60lib, make the following changes:</b>
<ul>
<li>in your project settings, select the <b>general</b> tab. make sure that <b>microsoft
foundation class </b>is set to <b>use mfc in a static library</b>.</li>
<li>add the following additional line of code to your <b>stdafx.h</b> header file, which
will cause the library to link statically with your application ( make sure you do this
prior to the include statement ):</li>
</ul>
<!-- start a block of source code -->
<pre><font color="#990000"><tt>
<b>#define mfcxlib_static</b>
#define mfcx_proj
#include <cj60lib.h>
<!-- end the block of source code -->
</pre>
</tt></font>
<p>this library was written for version 4.71 or later of comctl32.dll. if you have an
older version, you can download the latest version from the microsoft site. </p>
<p><b>classes found in cj60lib:</b></p>
<p><img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>ccjbutton</b> - ( cjbutton.cpp
and cjbutton.h )</p>
<blockquote>
<p>i wrote this class the originally handle the minimize and close buttons found in the
ccjcontrolbar class. this class handles flat style buttons. i have expanded upon this and
created an article which implements the static button control as seen in the project
settings->custom build tab in visualstudio. </p>
</blockquote>
<p><img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>ccjcombobox</b> - (
cjcombobox.cpp and cjcombobox.h )</p>
<blockquote>
<p>i wrote this class to handle the flat looking combo boxes as seen in the microsoft
office products. its easy to use, simply replace any occurance of ccombobox, with
ccjcombobox. </p>
</blockquote>
<p><img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>ccjcontrolbar</b> - (
cjcontrolbar.cpp and cjcontrolbar.h )</p>
<blockquote>
<p>this class is based upon the csizingcontrolbar class written by cristiposea. i added a
more authentic look to the control, including a minimize and maximize button, grippers
button tooltips, popup menu support, and verticle and horizontal sizebar cursors. </p>
</blockquote>
<p><img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>ccjframewnd</b> - (
cjframewnd.cpp and cjframewnd.h )<br>
<img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>ccjmdiframewnd</b> - (
cjmdiframewnd.cpp and cjmdiframewnd.h )<br>
<img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>ccjdockbar</b> - ( cjdockbar.cpp
and cjdockbar.h )</p>
<blockquote>
<p>these classes override the default main frame layout to allow an offset for the 3d look
added to the toolbars. to use these classes, simply change <b>cframewnd</b> to <b>ccjframewnd</b>
where <b>cmainframe</b> is derived from in the <b>mainfrm.h</b> file (use <b>ccjmdiframewnd</b>
for mdi applications). </p>
</blockquote>
<p><img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>ccjoutlookbar</b> - (
cjoutlookbar.cpp and cjoutlookbar.h )</p>
<blockquote>
<p>this class has changed quite a bit since the last release for vc5. i have added message
handlers for mouse events, and modified it to use the <b>ccjpagerctrl</b> class, instead
of the default list box scroll bars. </p>
</blockquote>
<p><img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>ccjpagerctrl</b> - (
cjpagerctrl.cpp and cjpagerctrl.h )</p>
<blockquote>
<p>this class wraps the pager common control. to use it simple create it within your view
or dialog box, and set the child window with the hwnd of the control you wish pagged. when
creating the child window, set the pager as its parent. </p>
</blockquote>
<p><img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>ccjtabctrlbar</b> - (
cjtabctrlbar.cpp and cjtabctrlbar.h )</p>
<blockquote>
<p>this class is based upon dirk clemens article sizing tabcontrolbar. i have made some
enhancements to the code to accomindate the modifications i made to the ccjcontrolbar
class, which this class inherits from. </p>
</blockquote>
<p><img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>ccjtoolbar</b> - ( cjtoolbar.cpp
and cjtoolbar.h )</p>
<blockquote>
<p>i wrote this class to extend the ctoolbar class. this class adds a gripper to the
toolbar, sets the font the toolbar will use, draws the 3d borders for the look and feel of
the visual studio and office products. additionally i have add a method which allows
controls to be added to the toolbar such as combo and edit boxes. to use this toolbar
class, simply change ctoolbar to ccjtoolbar. </p>
</blockquote>
<p><img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>ccoolmenumanager</b> -(
coolmenu.cpp, emboss.cpp and coolmenu.h )<br>
<img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>csubclasswnd</b> -( subclass.cpp
and subclass.h )</p>
<blockquote>
<p>this code was written by paul dilascia. check out the january 98' issue of msj. it is
probably the easiest implementation for cool menus ( pulldown menus with icons ) that i
have seen. some minor enhancements have been made to fix memory leak problems. these
classes have been integrated into the <b>xframewnd</b> extensions. in order to use cool
menus, simply add the following code to your <b>cmainframe::oncreate</b> method: </p>
</blockquote>
<p><img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>cflattoolbar</b> - ( flatbar.cpp
and flatbar.h ) <b>obsolete with vc 6.0</b><br>
<img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>cmoduleversion</b> - (
modulver.cpp and modulver.h )</p>
<blockquote>
<p>this is the base class that my ccjtoolbar derives from. this class was written by paul
dilascia, and handles most of the sizing and internal issues with flat toolbars.
cmoduleversion is used to check the current version of the common control dll.
cflattoolbar is a composite of the october 97 and august 98 issuses of microsoft journal. </p>
</blockquote>
<p><img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>ccoolbar, crebarinfo</b> - (
coolbar.cpp and coolbar.h ) <b>obsolete with vc 6.0</b></p>
<blockquote>
<p>this code was originally written by paul dilascia. i have made some enhancements to the
original code, these are the classes that are used to create the rebar bands as seen in
the internet explorer 4 style ui article int the advanced ui section. </p>
</blockquote>
<p><img src="bullet.gif" tppabs="http://www.codeguru.com/advancedui/bullet.gif"
align="center" valign="center" width="11" height="11"> <b>chyperlink</b> - ( hyperlink.cpp
and hyperlink.h )</p>
<blockquote>
<p>this class was written by chris maunder, from his article hyperlink control. i am using
this class in order to add hyperlinks to the about dialogs in most of my articles. i have
made on minor change to this class which changes the "gotourl" method from
protected to public. this allows the routine to be called directly, without having to go
through a static object. </p>
</blockquote>
<div align="center"><center>
<table border="1" width="80%">
<tr>
<td><i>this code may be used in compiled form in any way you desire. this file may be
redistributed unmodified by any means providing it is not sold for profit without the
authors written consent, and providing that this notice and the authors name and all
copyright notices remains intact. if the source code in this file is used in any
commercial application then a statement along the lines of "portions copyright
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -