一无所知

世界如此之大,世界又如此之小!我什么都不知,只知我一无所知!

首页 CNDEV 网志 联络 (RSS 2.0) (Atom) 登录
  随笔 25 :: 收藏 0 :: 评论 0 :: 寻迹: 1

News

本站主要是技术类的文章和新闻
本站内容按创作共用方式授权
如果侵犯了您的权利,请告之!

随笔

随笔归档

图库

编程手册

常用链接

网络工具

我的链接

在线翻译

2005-04-27 #

    在皮肤界面中,最难的恐怕就是自画窗口标题了,网上虽然有各种各样的解决方法,但是都不是很完美,而商业皮肤界面程序包是需要花钱买的。

其中最主要的问题有:

1、在标题栏或边框移动鼠标时系统会画窗口标题

2、没有任务栏图标。当取消了 SYS_CAPTION Style 后系统不会画窗口标题了,但是同时该窗口也没有任务栏图标。

3、最大化后在标题栏按下鼠标时系统会画窗口标题

4、按下系统按钮再移动鼠标到按钮外后没有正确的重画按钮

    没办法,只有自己摸索了,研究了网络上的一些代码片段和几个比较成功的皮肤界面程序比如 RealPlay, Microsoft Money ,发现它们采用的手法都不尽相同,而网上关于这个问题也没有很完美的解决方案,总是有点小瑕疵。最后,去研究了一下 Windows 2000 的核心代码中关于窗口管理部分,终于算是比较满意的解决了上面的这些问题,但是,我采用的方法和RealPlay, Microsoft Money 都不太一样,RealPlay 好象没有了 NC_* 的消息,而Microsoft Money 则是采用遮盖的方法,而我是采用直接重画的方法,关键是找到重画的关键点。

关键代码:

  1    BEGIN_MSG_MAP(TCaptionBaseT)
  2        MESSAGE_HANDLER(WM_NCHITTEST,            OnNCHitTest)
  3        MESSAGE_HANDLER(WM_NCPAINT,                OnNCPaint)
  4
  5        MESSAGE_HANDLER(WM_NCLBUTTONDOWN,        OnNCLButtonDown)
  6        MESSAGE_HANDLER(WM_NCLBUTTONUP,            OnNCLButtonUp)
  7        MESSAGE_HANDLER(WM_NCMOUSEMOVE,            OnNCMouseMove)
  8        MESSAGE_HANDLER(WM_LBUTTONUP,            OnLButtonUp)
  9
10        MESSAGE_HANDLER(WM_NCACTIVATE,            OnNCActivate)
11
12        MESSAGE_HANDLER(WM_SYSCOMMAND,            OnSysCommand)
13        MESSAGE_HANDLER(WM_INITMENU,            OnInitMenu)
14
15        MESSAGE_HANDLER(WM_SIZE,                OnSizeChanged)
16        MESSAGE_HANDLER(WM_STYLECHANGED ,        OnStyleChanged)
17 MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingsChange) 18        MESSAGE_HANDLER(WM_SETTEXT,                OnSetText)
19        MESSAGE_HANDLER(WM_SETICON ,            OnSetIcon)
20
21        MESSAGE_HANDLER(WM_CREATE,                OnCreate)
22        MESSAGE_HANDLER(WM_INITDIALOG,            OnInitDialog)
23    END_MSG_MAP()
24
25    LRESULT OnNCLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
26    {
27        // wParam 由 OnNcHitTest 返回
28        T* pT = static_cast<T*>(this);
29       
30        POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
31        mn_ButtonPress = HTNOWHERE;
32
33        switch( wParam )
34        {
35        case HTMINBUTTON:
36        case HTMAXBUTTON:
37        case HTCLOSE:
38        case HTHELP:
39            mn_ButtonPress  = wParam;
40            mb_OnPressed    = TRUE;
41            bHandled        = TRUE;        // 表示已经处理过了,否则系统会重画按钮且 WM_NC_LBUTTONUP 不会被触发。
42            pT->doReDrawCaption();
43            break;
44        case HTCAPTION:
45            bHandled = FALSE;    // 继续让系统进行缺省处理
46            {
47                DWORD nStyle = pT->GetStyle();
48                if(nStyle & WS_MINIMIZE)
49                {
50                    return 0; // BUG: Prevents move of iconic window, but fixes Windows freeze
51                }

52                else
53                if(nStyle & WS_MAXIMIZE)
54                {
55                    // 在系统最大化的时候需要在鼠标按下时重画标题栏
56                    bHandled = TRUE; // 表示已经处理过了,否则系统会重画按钮。
57                    // 让系统对 HTCAPTION 进行处理
58                    pT->DefWindowProc(uMsg, wParam, lParam);
59                    pT->doReDrawCaption();
60                }

61            }

62            break;
63        default:
64            bHandled = FALSE;    // 继续让系统进行缺省处理
65            break;
66        }

67        return 0;
68    }

69   
70    LRESULT OnNCLButtonUp(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
71    {
72        // wParam 由 OnNcHitTest 返回
73        T* pT = static_cast<T*>(this);
74
75        mb_OnPressed = FALSE;
76
77        if(wParam == mn_ButtonPress)
78        {
79            // 鼠标按下和释放在相同的按钮上
80            POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
81            switch( wParam )
82            {
83            case HTMINBUTTON:
84                pT->PostMessage(WM_SYSCOMMAND, SC_MINIMIZE, MAKELPARAM(pt.x, pt.y));
85                bHandled = TRUE;    // 禁止系统做缺省处理
86                break;
87            case HTMAXBUTTON:
88                mn_ButtonMove = HTNOWHERE;        // 最大画后鼠标位置将改变
89                if(pT->GetStyle() & WS_MAXIMIZE)
90                    pT->PostMessage(WM_SYSCOMMAND, SC_RESTORE,  MAKELPARAM(pt.x, pt.y));
91                else
92                    pT->PostMessage(WM_SYSCOMMAND, SC_MAXIMIZE, MAKELPARAM(pt.x, pt.y));
93                bHandled = TRUE;    // 禁止系统做缺省处理
94                break;
95            case HTCLOSE:
96                pT->PostMessage(WM_CLOSE);
97                bHandled = TRUE;    // 禁止系统做缺省处理
98                break;
99            case HTHELP:
100                pT->PostMessage(WM_HELP);
101                bHandled = TRUE;    // 禁止系统做缺省处理
102                break;
103            case HTSYSMENU:
104            default:
105                bHandled = FALSE;    // 让系统进行缺省处理
106            }

107        }

108        mn_ButtonPress = HTNOWHERE;
109        return 0;
110    }

111
112    LRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
113    {
114        bHandled = FALSE;
115
116        mb_OnPressed    = FALSE;
117        mn_ButtonPress    = HTNOWHERE;
118
119        return 0;
120    }

发表于 @ 12:23 | 评论与反馈 (0)

2005-04-04 #

  一直以来用 AxIcon Workshop 来处理图标,但是 AxIcon Workshop稍微有点问题就是,不支持重复图标过滤,而且,在处理大量图标的时候很容易没有响应!:(

  为此,我自己写了一个图标处理工具,可以自动抽取 DLL/EXE/ICL 等文件中的图标,并进行重复图标自动过滤,图标扫描等功能,其中比较困难的是对 ICL 文件的处理,ICL 文件本质上是一个 16 Bit 的 DLL 资源文件,但是在 Windows 2000 下好象没有直接操作它的函数,至少我是不知道,查了 Google 也没查到相关资料,没有办法,只有硬来了,查了 16 Bit 的 EXE 的文件结构资料,结合网上可以找到的一些对16 Bit 的 EXE 的读写代码片段,再经过探索和摸索,终于成功的将从 ICL 中分离出 ICON 。其中的关键代码如下:希望给你有帮助

typedef UINT16          HANDLE16;
typedef HANDLE16       *LPHANDLE16;

DECLARE_HANDLE(FARPROC16);

#pragma pack( push )
#pragma pack( 2 )

typedef struct
{
    WORD     offset;
    WORD     length;
    WORD     flags;
    WORD     id;
    HANDLE16 handle;
    WORD     usage;
} NE_NAMEINFO;

typedef struct
{
    WORD        type_id;   /* Type identifier */
    WORD        count;     /* Number of resources of this type */
    FARPROC16   resloader; /* SetResourceHandler() */
    /*
     * Name info array.
     */
} NE_TYPEINFO;

typedef struct
{
    WORD idReserved;  // Reserved (must be 0)
    WORD idType;   // Resource Type (1 for icons)
    WORD idCount;  // How many images?
   
    BYTE bWidth;          // Width, in pixels, of the image
    BYTE bHeight;         // Height, in pixels, of the image
    BYTE bColorCount;     // Number of colors in image (0 if >=8bpp)
    BYTE bReserved;       // Reserved ( must be 0)
    WORD wPlanes;         // Color Planes
    WORD wBitCount;       // Bits per pixel
    DWORD dwBytesInRes;    // How many bytes in this resource?
    DWORD dwImageOffset;   // Where in the file is this image?
} NE_ICONDIRENTRY, *LPNE_ICONDIRENTRY;

// 图标目录
typedef struct
{
 WORD idReserved;   // Reserved (must be 0)
 WORD idType;    // Resource type (1 for icons)
 WORD idCount;   // How many images?
} GRPICONDIR, *LPGRPICONDIR;

// 图标项
typedef struct
{
 BYTE   bWidth;               // Width, in pixels, of the image
 BYTE   bHeight;              // Height, in pixels, of the image
 BYTE   bColorCount;          // Number of colors in image (0 if >=8bpp)
 BYTE   bReserved;            // Reserved
 WORD   wPlanes;              // Color Planes
 WORD   wBitCount;            // Bits per pixel
 DWORD  dwBytesInRes;         // how many bytes in this resource?
 WORD   nID;                  // the ID
} GRPNE_ICONDIRENTRY, *LPGRPNE_ICONDIRENTRY;

#pragma pack( pop )

#define NE_RT_CURSOR         0x8001
#define NE_RT_BITMAP         0x8002
#define NE_RT_ICON           0x8003
#define NE_RT_MENU           0x8004
#define NE_RT_DIALOG         0x8005
#define NE_RT_STRING         0x8006
#define NE_RT_FONTDIR        0x8007
#define NE_RT_FONT           0x8008
#define NE_RT_ACCELERATOR    0x8009
#define NE_RT_RCDATA         0x800a
#define NE_RT_GROUP_CURSOR   0x800c
#define NE_RT_GROUP_ICON     0x800e

// ICL 图标枚举
HRESULT ICL_EnumResourceNames(IN CONST HANDLE hFile, IN UINT nType, IN NE_ENUM_RES_NAME_PROC pFunc, IN LPARAM lParam)
{
 DWORD dwRead = 0;

 // 读区 DOS 文件头
 IMAGE_DOS_HEADER oDOSHeader;
 if(!::ReadFile( hFile, &oDOSHeader, sizeof(IMAGE_DOS_HEADER), &dwRead, NULL ) )
 {
  return ::GetLastError();
 }
 
 // 读区 NE 文件头
 IMAGE_OS2_HEADER oNEHeader;
 ::SetFilePointer(hFile, oDOSHeader.e_lfanew, NULL, FILE_BEGIN);
  if(!::ReadFile( hFile, &oNEHeader, sizeof(IMAGE_OS2_HEADER), &dwRead, NULL ) )
 {
  return ::GetLastError();
 }

  // 读区 RSRC 资源表
 DWORD nPos = oDOSHeader.e_lfanew + oNEHeader.ne_rsrctab;
 ::SetFilePointer(hFile, nPos, NULL, FILE_BEGIN);

 WORD nSizeShift;
  if(!::ReadFile( hFile, &nSizeShift, sizeof(WORD), &dwRead, NULL ) )
 {
  return ::GetLastError();
 }

    NE_TYPEINFO oInfo;
  if(!::ReadFile( hFile, &oInfo, sizeof(NE_TYPEINFO), &dwRead, NULL ) )
 {
  return ::GetLastError();
 }

 // 枚举所有的资源
 DWORD nPosEnd  = oDOSHeader.e_lfanew + oNEHeader.ne_restab;
 DWORD nPosName = nPosEnd + 4;

 NE_NAMEINFO oName;
 UINT nIndex = 0;
 while (oInfo.type_id != 0 && nPos < nPosEnd)
    {
        for (UINT nCount = oInfo.count; nCount > 0; nCount--)
        {
    if(!::ReadFile(hFile, &oName, sizeof(NE_NAMEINFO), &dwRead, NULL))
   {
    return ::GetLastError();
   }
   if(oInfo.type_id == nType)
   {
    // 保存文件位置
    DWORD nPosOld = ::SetFilePointer(hFile, 0, NULL, FILE_CURRENT);
    
    // 资源名
    BYTE nSize;
    ::SetFilePointer(hFile, nPosName, NULL, FILE_BEGIN);
     if(!::ReadFile( hFile, &nSize, sizeof(BYTE), &dwRead, NULL))
    {
     return ::GetLastError();
    }
    if(nSize > 255) return E_FAIL;

    nPosName += sizeof(BYTE) + nSize;

    ACHAR sName[255 + 1];
     if(!::ReadFile( hFile, sName, nSize, &dwRead, NULL))
    {
     return ::GetLastError();
    }
    if(nSize == 1 && sName[0] == __A(
'@')) nSize = 0;
    sName[nSize] = ACHR_NULL;

    // 资源组
    GRPICONDIR oDir;
    DWORD nPosGroup = oName.offset << nSizeShift;
    ::SetFilePointer(hFile, nPosGroup, NULL, FILE_BEGIN);
     if(!::ReadFile( hFile, &oDir, sizeof(GRPICONDIR), &dwRead, NULL))
    {
     return ::GetLastError();
    }

    // 处理
    STK_CONVERSIONU;
    pFunc(hFile, nIndex++, STK_A2T(sName), &oDir, lParam);

    // 恢复文件位置
    ::SetFilePointer(hFile, nPosOld, NULL, FILE_BEGIN);
   }
        }
   if(!::ReadFile( hFile, &oInfo, sizeof(NE_TYPEINFO), &dwRead, NULL))
  {
   return ::GetLastError();
  }
    }
 return S_OK;
}

发表于 @ 14:04 | 评论与反馈 (0)

以前在Window 2000 IIS5.0下写了一个URL检测 + 重定向 + Session + 入侵检测 + 自动解压+ 自动解密的 ISAPI Filter ,用于数字图书馆项目,一直都很好使, 最近升级到 Widnows 2003 IIS6.0 后,发现 ISAPI Filter 根本运行不起来,后来查了又查,原来是文件的权限问题,IIS 6.0 ISAPI Filter 好象是在 Service 帐号下运行的(具体我也没去查过) ,将数据文件的读写权限给予Service 帐号后,ISAPI Filter 终于可以正常运行了,但是,在随后的测试中,我发现,数据解密结果不正确,郁闷啊,查吧............

经过日志跟踪和分析,终于发现问题所在,原来 IIS 6.0 和 IIS 5.0 发送给客户端的时候应答稍微有点不一样,IIS 5.0 是先单独发应一次答头 HttpFilterProc->OnSendData,

HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
X-Powered-By: ASP.NET
Date: Mon, 04 Apr 2005 05:39:01 GMT
Content-Type: application/octet-stream
Accept-Ranges: bytes
Last-Modified: Mon, 04 Apr 2005 05:39:00 GMT
ETag: W/"90c9399ad838c51:fd1"
Content-Length: 661442

然后分多次发送数据 HttpFilterProc->OnSendData;

 

而 IIS6.0 却是将应答头和数据一起发送的,也就是说IIS 6.0 的第一次HttpFilterProc->OnSendData 中即包含了应答头,也包含了数据,

HTTP/1.1 200 OK
Date: Mon, 04 Apr 2005 05:17:09 GMT
Content-Length: 661442
Content-Type: application/pdf
Last-Modified: Mon, 04 Apr 2005 05:16:41 GMT
Accept-Ranges: bytes
ETag: "4c949b7cd538c51:ef5"
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET

%PDutv?在>2fW[[; e?v0F[Z4楽=Z;uJVYCYX(|XES敵蛣?

而原先的程序没有为这种情况设计,经过调整后,ISAPI Filter 已经成功的运行在 IIS 5.0 和 IIS 6.0 下了。

发表于 @ 13:41 | 评论与反馈 (2)

2005-03-03 #

Windows Template Library - WTL Version 7.5         (build 5058) 2/27/05
Development Release

Copyright © 2005 Microsoft Corporation. All rights reserved.
 
This file is a part of the Windows Template Library.
The use and distribution terms for this software are covered by the
Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
which can be found in the file CPL.TXT at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license. You must not remove this notice, or
any other, from this software.

 

 

Welcome to the Windows Template Library, version 7.5. This document contains the following topics:

 

  1. Introduction
  2. Features And Installation
  3. Packing List
  4. Class Overview
  5. ATL/WTL AppWizard
  6. Support for Windows CE
  7. Notes
  8. Changes Between WTL 7.5 And 7.1
  9. Changes Between WTL 7.1 And 7.0
  10. Changes Between WTL 7.0 And 3.1
  11. Changes Between WTL 3.1 And 3.0

 

 

1. Introduction

 

Windows Template Library, or WTL, is a set of classes that extend ATL to support more complex user interfaces for either applications or various UI components, while maintaining the big advantage of ATL - small and fast code. WTL classes were designed to be the best and the easiest way to implement rich Win32 based UI for ATL based applications, servers, components, and controls.

 

WTL provides support for implementing many user interface elements, from frame and popup windows, to MDI, standard and common controls, common dialogs, property sheets and pages, GDI objects, UI updating, scrollable windows, splitter windows, command bars, etc. The WTL classes are mostly templated and use minimal instance data and inline functions. They were not designed as a framework, so they do not force a particular application model, and can accommodate any. The classes do not use hooks or thread local storage, so they have no restrictions that those techniques impose. They also have no inter-dependencies and can be freely mixed with straight SDK code. In summary, WTL delivers very small and efficient code, very close in size and speed to SDK programs, while presenting a more logical, object oriented model to a programmer.

 

 

2. Features And Installation

 

This is the fifth public release of WTL, after WTL 3.0, 3.1, 7.0, and 7.1. It is also the first release of WTL under the Common Public License, enabling developers from the WTL community to contribute to the library.

 

WTL classes can be used with either VC++ 6.0 and ATL 3.0, VC++ .NET 2002 and ATL 7.0, VC++ .NET 2003 and ATL 7.1, or EVC++ 4.0 or 3.0 with ATL for Windows CE. AppWizard for VC++ .NET 2002 and 2003 is included.

 

The WTL classes are provided in header files located in the include directory. The only header files that must be included is atlapp.h, while others can be used when needed. The name of the file doesn't mean that you have to create an application, just that atlapp.h contains base definitions required for WTL projects.

 

To install WTL, just copy the whole directory structure, or unpack the archive file, to the location of your choice. Please be sure to add the WTL\include directory to the list of include directories in VC++, so that the compiler can find them when you include them in your projects..

 

Setup programs for the AppWizard are provided. After executing the setup scripts, ATL/WTL AppWizard will appear in the list of AppWizards when you select File.New.Project in VC++ IDE. The file AppWiz\setup70.js is the setup script for VC++ .NET 2002, while AppWiz\setup71.js is for VC++ .NET 2003.

 

To manually install AppWizard for VC++ .NET 2002, copy all WTLAppWiz.* files from AppWiz\Files to VC++ .NET projects directory, %VC7DIR%\Vc7\vcprojects, where %VC7DIR% is the directory where VC++ .NET 2002 is installed. After that, open WTLAppWiz.vsz and modify the like that contains ABSOLUTE_PATH to contain %WTLDIR%\AppWiz\Files, where %WTLDIR% is the directory where WTL files are.

 

For VC++ .NET 2003 use the WTLApp71.* files with the same steps.

 

Platform support and requirements:

 

    Compiler/IDE/ATL:

            Visual C++ 6.0   (ATL 3.0)

            Visual C++.NET 2002   (ATL 7.0)

            Visual C++.NET 2003   (ATL 7.1)

 

    SDK (optional):

            Any Platform SDK from January 2000 release up to the latest (February 2003)

 

    Windows CE development:

            eMbedded Visual C++ 3.0 - Pocket PC, Pocket PC 2002

            eMbedded Visual C++ 4.0 - STANDARDSDK_410, Pocket PC 2003, Smartphone 2003

 

This release also brings the preliminary support for the Visual Studio 2005 (codename Whidbey) Beta1. App Wizards for both Windows applications and SmartDevice projects are provided.

 

 

3. Packing List

 

File Name: Description:

readme.htm this file
CPL.TXT Common Public License
 
include\
    atlapp.h message loop, interfaces, general app stuff
    atlcrack.h message cracker macros
    atlctrls.h standard and common control classes
    atlctrlw.h command bar class
    atlctrlx.h bitmap button, check list view, and other controls
    atlddx.h data exchange for dialogs and windows
    atldlgs.h common dialog classes, property sheet and page classes
    atlframe.h frame window classes, MDI, update UI classes
    atlgdi.h DC classes, GDI object classes
    atlmisc.h WTL ports of CPoint, CRect, CSize, CString, etc.
    atlprint.h printing and print preview
    atlres.h standard resource IDs
    atlresce.h standard resource IDs for Windows CE
    atlscrl.h scrollable windows
    atlsplit.h splitter windows
    atltheme.h Windows XP theme classes
    atluser.h menu class
    atlwinx.h extensions of ATL windowing support
 
Samples\
    Alpha\... Windows XP 32-bit (alpha) toolbar images
    BmpView\... bitmap file view sample
    MTPad\... multithreaded notepad sample
    MDIDocVw\... WTL version of the MDI sample
    GuidGen\... WTL version of the GuidGen sample
    Wizard97Test\... Wizard97 showcase sample
    WTLExplorer\... Explorer-like application sample
 
AppWiz\
    setup70.js AppWizard setup program for VC++ .NET 2002
    setup71.js AppWizard setup program for VC++ .NET 2003
    setup80.js AppWizard setup program for VC++ 2005 Beta1
    Files\... WTL AppWizard for VC++ .NET 2002 and 2003 files
 
AppWizCE\
    setup80.js AppWizard setup program for VC++ 2005 Beta1
    Files\... WTL AppWizard for VC++ 2005 Beta1 files

 

 

4. Class Overview

 

usage:        mi base    -    a base class (multiple inheritance)
  client    -    wrapper class for a handle
  as-is    -    to be used directly
  impl    -    implements a window (has WindowProc) or other support
  helper    -    a helper class
  base    -    implementation base class

 

class name: usage: description:

app/module support
CAppModule as-is app support, CComModule derived
CServerAppModule as-is module for COM servers
CMessageLoop as-is message loop
CMessageFilter mi base message filter interface
CIdleHandler mi base idle time handler interface

frame windows
CFrameWindowImplBase<> base  
CFrameWindowImpl<> impl frame window support
COwnerDraw<> impl mi base owner-draw msg map and handlers
CDialogResize<> impl mi base support for resizing dialogs

MDI windows
CMDIWindow client MDI methods
CMDIFrameWindowImpl<> impl MDI frame window
CMDIChildWindowImpl<> impl MDI child window

update UI
CUpdateUIBase base  
CUpdateUI<> mi base class  provides support for UI update
CDynamicUpdateUI<> mi base class  provides dynamic support for UI update

standard controls
CStatic client static ctrl
CButton client button ctrl
CListBox client list box ctrl
CComboBox client combo box ctrl
CEdit client edit ctrl
CEditCommands mi standard edit command support
CScrollBar client scroll bar ctrl

common controls
CImageList client image list
CListViewCtrl client list view ctrl
CTreeViewCtrl client tree view ctrl
CTreeItem helper  
CTreeViewCtrlEx client uses CTreeItem
CHeaderCtrl client header bar ctrl
CToolBarCtrl client toolbar ctrl
CStatusBarCtrl client status bar ctrl
CTabCtrl client tab ctrl
CToolTipCtrl client tool tip ctrl
CToolInfo helper  
CTrackBarCtrl client trackbar ctrl
CUpDownCtrl client up-down ctrl
CProgressBarCtrl client progress bar ctrl
CHotKeyCtrl client hot key ctrl
CAnimateCtrl client animation ctrl
CRichEditCtrl client rich edit ctrl
CRichEditCommands mi std rich edit commands support
CDragListBox client drag list box
CDragListNotifyImpl<> impl mi class support for notifications
CReBarCtrl client rebar ctrl
CComboBoxEx client extended combo box
CDateTimePickerCtrl client date-time ctrl
CFlatScrollBarImpl mi impl flat scroll bars support
CFlatScrollBar as-is flat scroll bars support
CIPAddressCtrl client IP address ctrl
CMonthCalendarCtrl client month calendar ctrl
CCustomDraw<> impl mi class custom draw handling support

Windows CE controls
CCECommandBarCtrl client command bar ctrl
CCECommandBandsCtrl client command bands ctrl

property sheet & page
CPropertySheetWindow client  
CPropertySheetImpl<> impl property sheet
CPropertySheet as-is  
CPropertyPageWindow client  
CPropertyPageImpl<> impl property page
CPropertyPage as-is  
CAxPropertyPageImpl<> impl property page with ActiveX
CAxPropertyPage as-is  
CWizard97SheetWindow client  
CWizard97SheetImpl<> impl Wizard97 property sheet
CWizard97Sheet as-is  
CWizard97PageWindow client  
CWizard97PageImpl<> impl Wizard97 property page
CWizard97ExteriorPageImpl<> impl Wizard97 exterior page
CWizard97InteriorPageImpl<> impl Wizard97 interior page

common dialogs
CFileDialogImpl<> impl GetOpenFileName/GetSaveFileName
CFileDialog as-is  
CFolderDialogImpl impl directory picker
CFolderDialog as-is  
CFontDialogImpl<> impl ChooseFont common dialog
CFontDialog as-is  
CRichEditFontDialogImpl<> impl ChooseFont for rich edit
CRichEditFontDialog as-is  
CColorDialogImpl<> impl ChooseColor common dialog
CColorDialog as-is  
CPrintDialogImpl<> impl PrintDlg common dialog
CPrintDialog as-is  
CPrintDialogExImpl impl new Win2000 print dialog
CPrintDialogEx as-is  
CPageSetupDialogImpl<> impl PageSetupDlg common dialog
CPageSetupDialog as-is  
CFindReplaceDialogImpl<> impl FindText/ReplaceText
CFindReplaceDialog as-is  

USER support
CMenu client menu support
CMenuItemInfo as-is MENUITEMINFO wrapper
CAccelerator client accelerator table
CIcon client icon object
CCursor client cursor object
CResource client generic resource object

GDI support
CDC client DC support
CPaintDC client for handling WM_PAINT
CClientDC client for GetDC
CWindowDC client for GetWindowDC
CPen client GDI pen object
CBrush client GDI brush object
CLogFont as-is LOGFONT wrapper
CFont client GDI font object
CBitmap client GDI bitmap object
CPalette client GDI palette object
CRgn client GDI region object

enhanced controls
CCommandBarCtrlImpl impl command bar
CCommandBarCtrl as-is  
CBitmapButtonImpl impl bitmap button
CBitmapButton as-is  
CCheckListViewCtrlImpl impl check list box
CCheckListViewCtrl as-is  
CHyperLinkImpl impl hyper link control
CHyperLink as-is  
CWaitCursor as-is wait cursor
CCustomWaitCursor as-is custom and animated wait cursor
CMultiPaneStatusBarCtrlImpl impl status bar with multiple panes
CMultiPaneStatusBarCtrl as-is  
CPaneContainerImpl<> impl pane window container
CPaneContainer as-is  
CSortListViewImpl<> impl sorting list view control
CSortListViewCtrlImpl<> impl  
CSortListViewCtrl as-is  

scrolling window support
CScrollImpl<> impl mi scrolling support
CScrollWindowImpl<> impl scrollable window
CMapScrollImpl<> impl mi scrolling support with map modes
CMapScrollWindowImpl<> impl scrollable window with map modes
CZoomScrollImpl<> impl mi zooming support
CZoomScrollWindowImpl<> impl zooming window
CScrollContainerImpl<> impl scroll container window
CScrollContainer as-is  

splitter window support
CSplitterImpl<> impl mi splitter support
CSplitterWindowImpl<> impl splitter window
CSplitterWindow<> as-is  

theming support
CTheme client Windows XP theme
CThemeImpl<> impl theming support for a window

printing support
CPrinterInfo<> as-is print info support
CPrinter client printer handle wrapper
CDevMode client DEVMODE wrapper
CPrinterDC client printing DC support
CPrintJobInfo client print job info
CPrintJob client print job support
CPrintPreview mi print preview support
CPrintPreviewWindowImpl<> impl print preview window
CPrintPreviewWindow as-is  
CZoomPrintPreviewWindowImpl<> impl zooming print preview window
CZoomPrintPreviewWindow as-is  

miscellaneous
CSize as-is WTL port of MFC's CSize
CPoint as-is WTL port of MFC's CPoint
CRect as-is WTL port of MFC's CRect
CString as-is WTL port of MFC's CString
CWinDataExchange mi data exchange for controls
CRecentDocumentList mi or as-is support for MRU list

 

 

5. ATL/WTL AppWizard

 

ATL/WTL AppWizard generates starting code for a WTL application. It has options to create code for different application types and features.

 

You can choose the following options:

  • Application type (SDI, multi thread SDI, MDI, dialog based)
  • Support for hosting ActiveX controls
  • COM server support
  • Class implementation in .CPP files
  • Common Control manifest
  • Toolbar, rebar, command bar, status bar
  • View window, and it's type (generic, dialog based form, or a list box, edit, list view, tree view, rich edit based, HTML page)
  • For dialog based apps or a form based view window - support for hosting ActiveX controls in the dialog

 

ATL/WTL AppWizard supports VC++ .NET 2002 and 2003.

 

 

6. Support for Windows CE

 

WTL now fully supports building projects for the Windows CE platforms. This initial support for Windows CE was implemented primarily for eMbedded Visual C++ 4.0 with Pocket PC 2003 and SmartPhone 2003 SDKs. However, it can be used with other versions and configurations. For instance, Standard SDK 4.1 is supported as well. Considerable effort was made to provide the best Windows CE support, however, there might be some limitations because different platforms provide different programming support.

 

The support for Windows CE was not designed to port projects for the desktop version of Windows as-is to the Windows CE platforms, but to allow use of the same library, WTL, for both desktop Windows and Windows CE. Applications for Windows CE are often designed in a different way, and they use different platform services. WTL depends on the version of ATL provided with each Windows CE platform, and supports controls and services that are appropriate and supported for each Windows CE platform.

 

 

7. Notes

 

~    WTL provides several classes that are also present in ATL 7.0 and 7.1. The classes are: CSize, CPoint, CRect, and CString in atlmisc.h. While their existence will not cause any problems, their usage might. You should qualify the class you want to use with a namespace to resolve ambiguity, either ATL or WTL namespace, depending on which implementation you want to use. Alternatively, you can conditionally exclude WTL implementations, by defining preprocessor symbol _WTL_NO_WTYPES for CSize, CPoint, and CRect; and _WTL_NO_CSTRING for CString.

 

~    If you use WTL 7.5 with VC++ 6.0/ATL 3.0 and define _ATL_STATIC_REGISTRY, you'll get errors referring to the ambiguous symbol ATL. This is caused by a bug in ATL 3.0 - in atlbase.h, the file statreg.h is included inside of the ATL namespace, and it contains another namespace ATL declaration. Because of that, the compiler cannot decide between ATL:: and ATL::ATL:: namespaces. The solution is either to fix the atlbase.h, or to surround atlbase.h include declaration with following statements:

 

    #define ATL   ATLFIX

    #include <atlapp.h>

    #undef ATL

    namespace ATL = ::ATLFIX;

 

~    Windows XP allows applications to use Common Controls version 6, which supports only Unicode applications. While WTL allows creation of Ansi applications that use Common Controls 6, that should be used only for test programs and is not recommended or supported for released projects. If you want to use Common Controls 6, build your application as Unicode.

 

~    Several of the sample programs included with WTL were extended to support building for Windows CE. These samples are not specially redesigned for Windows CE, but just modified to allow you to compile and run them on the Windows CE platforms. The samples are: BmpView, GuidGen, and MTPad.

 

~    WTL supports building projects with EVC++ 3.0 only for Pocket PC and Pocket PC 2002 platforms, as other platforms don't provide minimum support for ATL or other required libraries.

 

~    The old AppWizards for VC++ 6.0 and eVC++ 4.0/3.0 are not included in this version of WTL because they cannot be a part of an Open Source project. They are still available in the previous release, WTL 7.1.

 

 

8. Changes Between WTL 7.5 And 7.1

 

New and improved:

<< TODO: Add items >>

 

Fixes and enhancements:

<< TODO: Add items >>

 

 

9. Changes Between WTL 7.1 And 7.0

 

New and improved:

VC7 Compatibility: Support for ATL7 Module classes and critical sections and AppWizard setup for VC++ 7.1

Windows CE Support: Full compatibility with Windows CE platforms and AppWizard for eMbedded Visual C++

Namespace Support: Automatic "using ATL" (ATL7 only) or "using WTL" can now be turned off

CHyperLink New Features: not underlined, underlined when hover, command button, link tags

CCustomWaitCursor class supports custom and animated wait cursors

AtlCreateBoldFont() for creating bold version of an existing font

 

Fixes and enhancements:

CFrameWindowImpl:

  • CreateSimpleToolBarCtrl() - remove dead code, improve error checking, add a global function that uses it

  • Fix - PrepareChevronMenu() fails to get toolbar strings for Unicode

  • CFrameWindowImplBase::Create() - improve ASSERT not to use m_hWnd if creation fails

  • Fix - CFrameWndClassInfo::Register - should use %p formatting only for _WIN32_WINNT >= 0x0500 or for _WIN64

  • Fix - Chevron menus not positioned correctly with RTL

  • Fix - CMDIChildWindowImpl: Problems creating maximized child windows and handling focus

  • Fix - CMDIChildWindowImpl: Should activate on WM_MOUSEACTIVATE

 

UpdateUI:

  • Fix - Incorrectly clears default item from the system menu in MDI apps

  • Added UISetCheck with bool instead of int for the check state

 

DDX:

  • Fix - Doesn't provide a way to change floating point precision

  • Added DDX_CONTROL_HANDLE for non-CWindowImpl objects

  • Added DDX_Check variant with bool instead of int for the check state

 

Command Bar:

  • Fix - OnDrawItem() and OnMeasureItem() don't do a good check for owner-draw menu items

  • Fix - Disabled 32-bit images not painted correctly in 3D menu mode

  • Fix - Popup menus not positioned correctly with RTL

  • Fix - Uses GCL_HICONSM instead of GCLP_HICONSM with GetClassLongPtr()

 

MDI Command Bar:

  • Fix - Doesn't refresh icon if MDI children are different

  • OnAllHookMessages() - improve code to handle MDI child window class icon

  • Fix - OnNcLButtonDown() uses TPM_VERPOSANIMATION without checking Windows version

  • Fix - Maximized MDI buttons in wrong place for RTL

  • Should adjust cxIdeal for rebar bands for IE4

  • Add support for different top-level menu widths by handling ideal size for rebar bands

 

AppWizard:

  • Fix - Doesn't support MSDI application as a COM Server

  • Fix - MDI with Form View - stack overflow closing maximized MDI child windows

  • Fix - Generates VERSION resource name 'test1' regardless of the project name

  • Fix - Dialog project with control hosting doesn't derive a dialog from CAxDialogImpl

  • Fix - COM Server doesn't register type library

  • Fix - COM Server doesn't register AppID properly

 

CTreeViewCtrl:

  • Fix - GetItemData() needs better return value

  • Fix - GetItemState() should use TVM_GETITEMSTATE instead of TVM_GETITEM for IE5

  • GetItem() and SetItem() - added new variants that use TVITEMEX

  • Fix - SortChildren() should add recurse flag argument

  • Fix - CTreeItem doesn't support CTreeViewCtrlExT that has different TBase than CWindow

 

CThemeImpl:

  • Fix - Uses scalar delete instead of the vector one

  • Fix - EnableThemeDialogTexture() argument is BOOL instead of DWORD

 

CFolderDialog:

  • Fix - EnableOK() passes wrong arguments to BFFM_ENABLEOK

  • Fix - Always clears m_hWnd, which causes problem for nested messages

 

CDialogResize:

  • Fix - DlgResize_Init() forces dialog to be visible by using SetRedraw()

  • Forcing WS_THICKFRAME is not enough to make dialog resizable

  • Min track size should be used for child dialogs as well

  • Fix - DlgResize_PositionControl() incorrectly checks return value from MapWindowPoints()

 

CAppModule:

  • Fix - CAppModule methods not thread-safe

  • Fix - AddSettingChangeNotify() unusable in multithreaded apps because of delayed initialization

 

CString:

  • Fix - Delete() doesn't allow deleting more than the length of the string

  • Fix - Append() can cause buffer overrun

  • Fix - MakeReverse() can cause an infinite loop

  • Fix - _cstrstr() unnecessarily inefficient

  • Fix - FindOneOf() is not DBCS-aware

  • Fix - Format() does not recognize %E

  • Fix - TrimLeft() and TrimRight() are only half-way DBCS-aware

  • Fix - May cause assertions or undefined behavior with SBCS

 

CRecentDocumentList:

  • Fix - SetMaxEntries() has an incorrect ASSERT

  • Add CString variant of the GetFromList() method

  • Add a way to replace command IDs used for the MRU list

  • Add a way to replace registry key name

 

Misc:

  • CMessageLoop::Run() - improve the loop by checking bDoIdle before calling PeekMessage()

  • CServerAppModule: Clean-up unused code

  • Fix - CServerAppModule::MonitorProc() - no need to call _endthreadex()

  • Fix - CListBox::GetText() and CComboBox::GetLBText() (CString variants) don't check for LBERR/CB_ERR

  • Fix - CAxPropertyPageImpl doesn't create ActiveX controls with ATL7

  • Fix - CDC::GetTextExtentExPoint() missing

  • CDC::SetWindowExt() should have default value NULL for the lpSizeRet argument

  • Fix - CPropertySheetWindow missing methods for PSM_INSERTPAGE, PSM_SETHEADERTITLE, and PSM_SETHEADERSUBTITLE; AddPage should return BOOL

  • Fix - CMapScrollImpl::SetScrollSize() uses wrong variable

  • Fix - CHyperLink: WM_UPDATEUISTATE causes repaint without WM_PAINT

  • Fix - CUpDownCtrl::GetPos() returns incorrect value

  • Fix - CUpDownCtrl::GetPos32() doesn't have default arg value

  • Fix - CMultiPaneStatusBarCtrl: Always uses size grip for positioning panes

  • Fix - CTabCtrl::InsertItem() should return int, not BOOL

  • CReBarCtrl: Added LockBands() method

  • Fix - CFont: uninitialized variable passed to DPtoLP

  • Fix - CPrintDialogImpl: Crash when displaying Print Setup dialog

  • Fix - CPageSetupDialogImpl::PaintHookProc() - should use T* and return UINT_PTR instead of UINT

  • Fix - CPrintJob doesn't support printing to a file

  • Fix - CSplitterImpl: Doesn't handle WM_CAPTURECHANGED - can get in an invalid state

  • CRichEditCtrl: Add method for EM_SETTABSTOPS

  • Fix - CFindFile::GetFilePath() checks for a trailing slash, but doesn't use that info

 

General:

  • Fix - Problems compiling with /Zc:forScope ('for' loop scope conformance)

  • Use named constants instead of values for pixel sizes, buffer lengths, etc.

  • Support building with Managed C++ (/CLR)

  • CMenuItemInfo - add run-time support for different versions of Windows

  • CommCtrl.h change - additional fields in IMAGELISTDRAWPARAMS now depend on _WIN32_IE instead of _WIN32_WINNT

  • Fix - Incorrect usage of CRegKey::QueryStringValue()

  • Fix - Operator = for GDI and USER wrappers leaks handle if it's managed variant

  • Fix - GDI and USER wrappers break under self-assignments

  • Fix - Chaining messages with cracked handlers broken with ATL7

  • Initialize all variables and structures prior to use

  • Use new common control struct names

 

 

10. Changes Between WTL 7.0 And 3.1

 

New classes and features:

Support for new Common Controls v6 messages

Support for Visual Studio .NET and ATL 7.0

WTLApp70 - new AppWizard for Visual Studio .NET

CThemeImpl - implements support for Windows XP themes

CMDICommandBarCtrl - implements Command Bar for MDI applications

 

Fixes and enhancements:

Command Bar:

  • Bogus assert in OnDestroy
  • Check marks can be truncated in large font settings
  • Use pT to access GetSystemSettings, DrawMenuText, DrawBitmapDisabled, Draw3DCheckmark, DoPopupMenu, DoTrackPopupMenu, TakeFocus, GiveFocusBack, so they can be overridden
  • No hot-tracking if main window is not active
  • Top level items not painted inactive if app looses activation while drop down menu is displayed
  • Added Windows XP flat menus support
  • Drop-down menu doesn't close if clicked again (Windows XP only)
  • Menu item text and accelerator text too close with some settings
  • Keyboard can still access clipped menu items
  • Added support for hiding keyboard navigation indicators until Alt key is pressed (system setting)
  • Added AddIcon and ReplaceIcon variants for icon resources
  • Image size calculated differently in different places
  • Add support for 32-bit (alpha channel) bitmaps for Windows XP
  • Fixed width calculation for default menu items

 

CFrameWindowImpl:

  • AddSimpleReBarBandCtrl sets toolbar extended styles without preserving old ones
  • PrepareChevronMenu should not create menu items for buttons with TBSTATE_HIDDEN
  • TPM_VERPOSANIMATION will not be defined in atlframe.h if atlctrlw.h is included first
  • CreateSimpleToolBarCtrl - height might be too small if large font is used
  • PrepareChevronMenu uses TB_GETBUTTONTEXT, better use TB_GETBUTTONINFO
  • Chevron menu doesn't close if clicked again (Windows XP only)
  • Should check local classes for superclassing
  • Add support for 32-bit (alpha channel) bitmaps for Windows XP

 

Update UI:

  • UISetText can clear other menu item flags
  • CUpdateUI::UIUpdateState assigns value with |= instead of =
  • Added UISetDefault() and fix default state to work with menus

 

CString:

  • GetBuffer() and GetBufferSetLength() should return NULL in out-of-memory condition
  • Added missing methods: separate c-tors for LPCSTR and LPCWSTR, CollateNoCase, TrimRight and TrimLeft variants, Find variants, moved FormatV to public
  • Fix _IsValidString usage
  • FormatV incorrectly calculates buffer size (too big)
  • Usage of _ttoi causes problems with _ATL_MIN_CRT in VC7

 

CDC:

  • GetTabbedTextExtent() should return DWORD instead of BOOL
  • Add FillRect() that accept color index instead of a brush handle
  • DrawDragRect() leaks regions and a brush
  • Improved DitherBlt() - added brushes as arguments for used colors
  • Added DrawShadowText() (uses LoadLibrary/GetProcAddress to run on older Windows)

 

CListViewCtrl:

  • SetItemState should use LVM_SETITEMSTATE
  • SetItemCount should return a BOOL

 

CRichEditCtrl:

  • Added SetCharFormat() variant that accepts flags (for SCF_ALL)
  • CharFromPos() should pass a pointer to POINTL in lParam
  • GetTextRange() - should add Unicode variant for rich edit version >= 2
  • Added another FormatRange() that can accept a pointer to FORMATRANGE (needed for passing NULL to clear cache)

 

CHyperLink:

  • Allow overriding of Navigate and CalcLabelRect
  • Doesn't handle right or center alignment

 

CColorDialog:

  • Has static variables that were not initialized with _ATL_MIN_CRT
  • Fixed HookProc for ColorOK message - the message is not sent, but the hook proc is called directly

 

atlcrack.h:

  • MSG_WM_TIMER crack macro should cast to TIMERPROC instead of TIMERPROC*
  • Add cracked handlers for all new messages in Common Controls 6

 

atlapp.h:

  • Fixed problems with atlTraceUI with ATL7
  • #ifdefs for ATL7 were in the wrong place

 

atlctrls.h:

  • Add support in control classes for all new messages in Common Controls 6

 

CRecentDocumentList:

  • AtlCompactPath corrupts memory if filename is longer than requested compact size
  • ReadFromRegistry incorrectly checks for error when reading from registry

 

CSplitterWindow:

  • Incorrect calculation of middle position
  • 3D border now drawn only if WS_EX_CLIENTEDGE is set

 

Printing:

  • Uses DWORD instead of an int for a job ID
  • CPrintJob::CancelPrintJob shouldn't have a return value

 

Misc:

  • CRegKey::QueryValue and SetValue are deprecated in ATL7
  • Added direct support for ATL7
  • Replace ScreenToClient and ClientToScreen with MapWindowPoints to support RTL layout
  • CFindFile::GetFilePath(LPTSTR...) returns path without the file name
  • MDI: Updating client edge in WM_WINDOWPOSCHANGING causes minimize/maximize/restore animation problems, use WM_WINDOWPOSCHANGED
  • Custom Draw: Added CCustomDraw::OnSubItemPrePaint() overrideable method
  • CFolderDialogImpl uses 'this' for BROWSEINFO.lParam instead of T*
  • CImageList::Destroy shouldn't use Detach()
  • ATL7 has its own AtlLoadString
  • CPropertySheet doesn't close when you press X button
  • Fixed problems for _U_STRINGorID and others that moved from atlbase.h to atlwin.h in ATL7
  • Add AtlMessageBox() that accepts either in-memory or resource strings
  • CScrollImpl: fixed bug with scrolling child windows
  • CPropertyPageImpl: Add new notification handlers to enable direct return values (use #ifdef _WTL_NEW_PAGE_NOTIFY_HANDLERS to use them)
  • Add AtlInitCommonControls() to simplify use
  • DDX: Fixed usage of the size of char arrays for DDX
  • CPageSetupDialog: changed usage of CWndProcThunk because of changes in ATL7
  • Fix confusing precedence in expressions
  • Removed forward declarations because default values for template arguments shouldn't be specified in two places (we don't need them anyway)
  • Win64: Fix /Wp64 warnings from 32-bit VC7 compiler caused by SDK headers
  • Fix direct usage of English strings (they can be #defined to something else now)
  • AtlGetCommCtrlVersion not defined if _ATL_DLL is in ATL 3.0 (and CmdBar is using it)

 

AppWizard:

  • Added manifest for Common Controls 6
  • Loading Rich Edit DLL should use HMODULE
  • Should not use atlimpl.cpp for ATL7
  • Added message handler prototypes to generated files
  • VERSION resource always has VALUE "OLESelfRegister" (now only for COM servers)
  • Added option for putting implementation in CPP files
  • d-tor for the thread manager class in MSDI project executed after the heap is destroyed
  • Wrong settings when changing to a dialog project and back (AppWizard 6.0 only)
  • Remove cut/copy/paste accelerators for form view and dialogs projects
  • Fix toolbar bitmaps so they are not transparent (problem with Windows XP flat menus only)
  • Used CMDICommandBarCtrl for MDI apps
  • Add symbols required for VC7 Class Wizard to recognize an ATL project
  • Changed default styles for the rebar, so it does look OK without CmdBar and with manifest
  • Added setup programs for both AppWizards
  • Remove ignored resource attributes: MOVEABLE, PURE, etc. (AppWizard 7.0 only)
  • Add call to DefWindowProc to WinMain to resolve possible problems if MSLU is used

 

Samples:

  • Updated toolbar bitmaps, added #ifdefs for ATL7, added manifest file for CommCtrl6, qualified _U_RECT with WTL namespace, updated use of deprecated CRegKey functions, added VC7 projects
  • Added Alpha sample

 

 

11. Changes Between WTL 3.1 And 3.0

 

New classes:

CPaneContainer - implements a window that provides a title bar and a close button (like Explorer)

CDialogResize - an MI class that allows resizing of dialogs (or any windows with child windows/controls)

CAxPropertyPageImpl - implements a property page that can host ActiveX controls

 

Fixes and enhancements:

CServerAppModule now clears m_hEventShutdown to avoid calling CloseHandle twice

 

CString:

  • operator += now leaves original string intact if it's out of memory
  • Fixed bad DWORD_PTR usage in TrimRight, TrimLeft, Replace, Remove
  • Removed dependencies on CRT for projects that don't use it
  • Insert - fixed string corruption in release builds
  • Added optional floating point formatting (for projects that use CRT)

 

CEdit and CRichEditCtrl: SetSelAll and SetSelNone had reversed implementation

 

atlres.h: Changed IDs so that they are compatible with MFC's afxres.h

 

Command Bar:

  • Added LoadMappedImages()
  • Changed handling of left and right arrow keys so that they don't close context menus
  • Add code to handle left/right arrow keys correctly on mirrored (RTL) systems
  • Removed handler that eats parent window's WM_SETTINGCHANGE
  • Fixed bitmap resource leak in Draw3DCheckmark
  • Fixed incorrect usage of CharLower in OnMenuChar
  • Fixed wrong color for the disabled items in hi-contrast mode
  • Added code to gray menu items if main window is inactive
  • Fixed keyboard mnemonic handling for IE 4
  • Fixed hook problems with multiple cmdbars in the same thread
  • Added support for radio menu items
  • Added support for disabled top-level menu items (also added in CFrameWindowImpl::PrepareChevronMenu)
  • Added keyboard shortcut (Alt+/) to invoke chevron menu
  • Added support to override menu item length in a derived class

 

CBitmapButton:

  • Bypassed BUTTON DefWindowProc for hover style so that the button doesn't take focus
  • Added BMPBTN_AUTOFIRE extended style

 

CDC:

  • Added _WTL_FORWARD_DECLARE_CSTRING define to allow usage of methods that accept CString
  • Fixed errors in GetTextFace and GetMenuItemString
  • Added GetCharWidth32
  • Added DrawIconEx method

 

CMenu:

  • Implement following missing methods:
        GetMenuDefaultItem
        GetMenuInfo
        GetMenuItemRect
        HiliteMenuItem
        IsMenu
        MenuItemFromPoint
        SetMenuDefaultItem
        SetMenuInfo
  • GetMenuString - fixed to include space for terminating NULL character in returning string

 

GDI and USER classes should destroy the GDI/USER objects in Attach if GDI/USER resource is managed

 

CFrameWindowImpl:

  • OnToolTipText shouldn't save tool tip text if it's not for a menu
  • AddSimpleReBarBandCtrl now adds chevron style only for toolbars with buttons
  • AddSimpleReBarBand(Ctrl) - calc band ID if not specified

 

CRecentDocumentList:

  • Fix - UpdateMenu deletes wrong menu item when the list is empty
  • Added code to allow restricting the number of characters displayed by MRU menu items

 

Update UI:

  • Added support for blocking accelerators for disabled items
  • Improved search code assuming there are no duplicate entries (and added checks for duplicates)

 

CSplitterWindow:

  • CSplitterWindowImpl should derive from CSplitterImpl<T , t_bVertical> to allow overriding of methods
  • Added single pane mode and SetSinglePaneMode/GetSinglePaneMode
  • Added right/bottom aligned resize mode using extended styles SPLIT_RIGHTALIGNED/SPLIT_BOTTOMALIGNED

 

atlcrack.h: Added handlers for following new messages:
    WM_APPCOMMAND
    WM_NCXBUTTONDOWN
    WM_NCXBUTTONUP
    WM_NCXBUTTONDBLCLK
    WM_XBUTTONDOWN
    WM_XBUTTONUP
    WM_XBUTTONDBLCLK

 

Win64:

  • Dialog return value should use DWLP_MSGRESULT and SetWindowLongPtr
  • CMenu::InsertMenu, AppendMenu, ModifyMenu should have UINT_PTR for the menu ID
  • Added appropriate type casts
  • CFrameWindowImpl::m_szAutoName - changed the size to fit the pointer value size
  • CListViewCtrl::SortItems should use LPARAM for user data instead of DWORD

 

Misc:

  • Added optional mask argument to all methods for setting extended styles
  • CMDIWindow::MDIRestore - fixed to send WM_MDIRESTORE instead of WM_MDIICONARRANGE
  • CListViewCtrl: Added SortItemsEx method
  • CToolBarCtrl::GetButtonInfo - fixed to return int instead of BOOL
  • Added CToolBarCtrl::SetButtonSize and SetBitmapSize that accept cx and cy instead of SIZE
  • Printing: Changed how GetNewDevModeForPage works (comments in code)
  • CFileDialogImpl::_OnTypeChange incorrectly calls pT->OnSelChange instead of pT->OnTypeChange
  • CMultiPaneStatusBarCtrl::GetPaneTipText - fixed to use index instead of and ID internally
  • CWinDataExchange: Added references to arguments of DoDataExchange, so there are no level 4 warning even if the map is empty
  • CPropertySheetWindow: Added new, IE 5.0 specific methods
  • CPropertyPageImpl: Added new, IE 5.0 specific methods

 

AppWizard:

  • added calls to RemoveMessageFilter and RemoveIdleHandler in CMainFrame::OnDestroy for COM server projects
  • added scroll bars for HTML view
  • CAppServerModule now handles -embedding as well as -automation
  • corrected code in CMainFrame::OnShowToolBar to correctly identify the toolbar in a rebar
  • dialog based app code now derives from CUpdateUI as public

 

- end of readme.htm -

发表于 @ 09:59 | 评论与反馈 (1)

2005-03-02 #

IBM today contributed more than 30 open source projects to SourceForge.net and launched new online skills-building programs to spur innovation, collaboration and development around emerging open source projects. 
 
Read more at: 
http://www.ostg.com/pdfs/IBM%20dev%20works%20release%20vfin.pdf 
 
 
This project list includes: 
 
AIX Toolbox - http://sf.net/projects/aixtoolbox/ 
 
Bluetooth ad-hoc network simulator - http://sf.net/projects/bluehoc/ 
 
Dynamic Probe Class Library - http://sf.net/projects/dpcl/ 
 
Journaled File System - http://sf.net/projects/jfs/ 
 
IBM Jikes Compiler for the Java Language - http://sf.net/projects/jikes/ 
 
Jikes RVM - http://sf.net/projects/jikesrvm/ 
 
Java POS Config Loader - http://sf.net/projects/jposloader/ 
 
Toolbox for Java/JTOpen - http://sf.net/projects/jt400/ 
 
openCryptoki - http://sf.net/projects/opencryptoki/ 
 
LTC Linux Kernel Performance Project - http://sf.net/projects/linuxperf/ 
 
LSID (Life Science Identifier) - http://sf.net/projects/lsid/ 
 
Memory Expansion Technology - http://sf.net/projects/mxt/ 
 
OpenSSH on AIX - http://sf.net/projects/openssh-aix/ 
 
Standards Based Linux Instrumentation - http://sf.net/projects/sblim/ 
 
UDDI4J Java Class Library - http://sf.net/projects/uddi4j/ 
 
Web Services Description Language for Java - 
http://sf.net/projects/wsdl4j/ 
 
ACP Modem (Mwave) Driver for Linux - http://sf.net/projects/acpmodem/ 
 
International Components for Unicode - http://sf.net/projects/icu/ 
 
Dynamic Probes - http://sf.net/projects/dprobes/ 
 
TCL extension library for IBM Speech Manager Applications Programming 
Interface (SMAPI) - http://sf.net/projects/tclsmapi/ 
 
TCK for JWSDL ( JWSDLTCK ) - http://sf.net/projects/jwsdltck/ 

发表于 @ 09:39 | 评论与反馈 (1)

2005-02-23 #

        传统的全文检索都是基于数据库的,SQL Server、Oracle、mysql 都提供全文检索,但这些比较大,不适合单机或小应用程序(Mysql4.0以上可以作为整合开发),Mysql也不支持中文。
        Lucene是一个高性能、纯Java的全文检索引擎,而且免费、开源。Lucene几乎适合于任何需要全文检索的应用,尤其是跨平台的应用。Lucene的作者Doug Cutting是一个资深的全文检索专家,刚开始,Doug Cutting将Lucene发表在自己的主页上,2000年3月将其转移到Sourceforge,于2001年10捐献给Apache,作为Jakarta的一个子工程。
        CLucene是C++版的全文检索引擎,完全移植于Lucene,采用 STL 编写。
        编译了一下 C++ 版本的 Lucene - CLucene - a C++ search engine  http://sourceforge.net/projects/clucene/
在 MSVC6 下修改了一些编译选项后编译成功,测试了一下,好象不支持对中文的全文检索,估计是分词部分对中文不支持,但是据说 Lucene 的全文检索架构是很 NB 的,有空研究研究 Lucene 的全文检索架构然后再加上中文分词功能吧,不加中文分词功能可没办法用。

BTW: 不知道 Java 版的 Lucene 稳定性怎样,但是 CLucene 的稳定性比较差,据说还有 n 多的内存泄露。
发表于 @ 14:58 | 评论与反馈 (4)

2005-02-18 #

在2月15日于San Francisco召开的RSA 2005会议上,Microsoft主席兼首席架构工程师Bill Gates
宣布了Internet Explorer 7.0,IE 7.0为Windows XP SP2增加了新的安全功能,并维持了用户所需要的扩展性和兼容性。IE 7.0将对恶意软件和间谍软件拥有更强大的抵御能力。IE 7.0的Beta版本将于今年夏天发布。

同时MS表示去年8月发布的Windows XP SP2已经获得了巨大成功。Gates表示WinXP SP2在全球散发的拷贝已经超过了170M份,将近有一半的用户表示Windows XP SP2有更好的保护功能。而在最近调查的800家企业用户中,有77%的企业已经使用SP2有6个月之久。

在会议上Gates重申了公司的未来工作重点-安全:

"我们的首要目标是通过技术创新,指导和业界领袖地位的平衡,来提高所有用户的保密和安全-无论是个人消费者还是企业,无论大小。我们承诺将继续创新来解决当前和未来可能出现的种种安全威胁。"

详细的报道在这里
发表于 @ 11:21 | 评论与反馈 (1)

2005-02-01 #

        看源代码的时候免不了要格式化一下代码,Java 当然是用 Eclipse 了,但是 C/C++ 就一直没有一个合适好用的工具来格式化(Format)/风格化(Style)代码,虽然Visual Studio 6.0 - Visual Studio 2005都提供了代码格式化功能,但是,实在是 --- 太简单了,根本不够用!!!
        后来在网上搜索了一把,发现一个很不错的工具Artistic Style 功能很强大,支持 C/C++/C# 和 Java,而且开源,目前最后版本是 1.17.0。此版本需要用 CVS 下载并编译,其中还是有些小 Bug, 估计是作者没空改,呵呵。

Artistic Style 1.17.0-dev

A Free, Fast and Small Automatic Formatter
for C, C++, C#, and Java Source Codes

Project Overview http://astyle.sourceforge.net
Sources, Binaries, Bug Tracker, Mailinglists http://www.sourceforge.net/projects/astyle/
Original Author Tal Davidson, Israel (tald@users.sourceforge.net)
Maintainer Martin Baute, Germany (devsolar@sourceforge.net)

Artistic Style is a reindenter and reformatter for C, C++, C#, and Java source code.

When indenting source code, we as programmers have a tendency to use both spaces and tab characters to create the wanted indentation. Moreover, some editors by default insert spaces instead of tabs when pressing the tab key, and other editors (Emacs for example) have the ability to "pretty up" lines by automatically setting up the white space before the code on the line, possibly inserting spaces in a code that up to now used only tabs for indentation.

Since the number of space characters showed on screen for each tab character in the source code changes between editors (unless the user sets up the number to his liking...), one of the standard problems programmers are facing when moving from one editor to another is that code containing both spaces and tabs that was up to now perfectly indented, suddently becomes a mess to look at when changing to another editor. Even if you as a programmer take care to only use spaces or tabs, looking at other peoples source code can still be problematic.

To address this problem, Artistic Style was created - a filter written in C++, that automatically reindents & reformats C / C++ / C# / Java source files. It can be used from a command line, or it can be incorporated in another C++ program.

The AStyle executable is distributed under the terms of the GNU General Public License (GPL); you may incorporate the core classes (ASBeautifier and ASFormatter) in other projects subject to the GNU Lesser General Public License (LGPL). You may want to read the Release Notes.

发表于 @ 17:35 | 评论与反馈 (1)

2005-01-31 #

       安装了开源的缺陷管理系统BugTracker.NETBugTracker.NET 是用ASP.NET 和C#.写的在ASP.Net环境下运行的基于Web的缺陷管理系统,作为缺陷管理系统来说,功能比较弱,只有简单的缺陷级别和优先级,没有缺陷类型、缺陷起源、缺陷来源,缺陷类型等字段,虽然它是可定制的,但是可定制性不是很强,当然它是免费的,作为个人/小项目开发也勉强可用。

BTW:
        看了一下代码,代码质量不是很高,感觉作者写程序时比较随意,没有事先规划过,总的来说比较混乱,建议不用拿来作为参考了:P

发表于 @ 10:34 | 评论与反馈 (2)

2005-01-27 #

Visual Assist X 是一个非常好的 Visual Studio 6.0 IDE 辅助工具, 但我一直没有找到注册码,当 Visual Assist X 过期后,有一种方法可以重置 Visual Assist X 的过期时间,供参考,步骤如下:
1、关闭 Visual Studio 6.0。
2、删除注册表中的 HKLM\Software\Licenses 键值。
3、删除 %TEMP% 中的 .tmp 文件。
4、在注册表中搜索关键字 "nLxxQ" ,会找到一个类似于下面所示的 COM 注册项,删除整个该项。
      HKCU\CLSID\{BC29421E-12B6-4630-A281-E18D215BC63E}

发表于 @ 11:39 | 评论与反馈 (2)

2005-01-26 #

由于硬盘物理损坏,索性重新装了一下操作系统和新的开发环境

- Windows 2003 

- SharePoint 2003

- Visual Studio 6.0

- Visual Studio 2005

- Avalon

其中主要是 Visual Studio 2005,另外新版本的 CVSNT 2.0.58d 好象配置上有些改变,主要是用户验证上,好象必须要一个 Windows 帐号和 CVSNT 帐号对应,否则就会出现“no such user”的错误,另外,cvs chacl 命令也和以前有点不同,而且,cvs chacl 还存在 bug  ???, 会在服务器的 CVSRoot/CVS/ 下产生一个格式错误的 fileattr.xml  文件,导致不能 Check In ,Check  out, 在给搞了半天手工修改 fileattr.xml  文件才搞好。现在一切正常了,:D

发表于 @ 17:53 | 评论与反馈 (3)

2005-01-25 #

C++/CLI的主设计师之一Stan Lippman的blog http://blogs.msdn.com/slippman

Available Prerelease Products:

发表于 @ 17:01 | 评论与反馈 (0)

2005-01-21 #

        订阅 Microsoft 下载通知后,Microsoft 每周都会将新的下载链接发到您的邮箱中,可以指定您只对那些类别的下载内容有兴趣。

通知内容有
  latest updates
  additions
  trial software
  service packs
  more

下载通知邮件订阅地址:http://go.microsoft.com/fwlink/?LinkId=39737

发表于 @ 19:17 | 评论与反馈 (0)

        前几天硬盘坏了,好在数据都抢救出来了,没办法,只好重装操作系统,干脆装个 Windows 2003 吧,在装个 .Net 开发环境,现在是应该开始用 .Net 做开发的时候了,因为 .Net 现在才开始稳定和成熟起来,还要装 SharePoint 2003,据说可以在同一台机器上面成功地安装域控制器、SQL2K,SharePoint 2003,但是有个技巧:KB831704


关于 SharePoint 2003 的安装:
郑海山:SharePoint 2003 安装指北
郑海山:SharePoint 2003 安装续
发表于 @ 18:31 | 评论与反馈 (2)

        对于不能上国外网站或者上国外网站很慢的用户来说,使用一个国内的二级更新服务器是一个不错的选择,厦门大学网络中心就提供了Windows Update自动更新服务。

http://windowsupdate.xmu.edu.cn/

FAQ:
1.什么是WindowsUpdate自动更新服务?
Windows 自动更新是 Windows 的一项功能,当适用于您的计算机的重要更新发布时,它会及时提醒您下载和安装。 使用自动更新可以在第一时间更新您的操作系统,修复系统漏洞,保护您的计算机安全。
 
2.为什么要使用WindowsUpdate自动更新服务?
由于Windows会不定期的发布补丁,这些补丁可能对您的系统非常重要,为了方便用户,自动更新将自动完成下载和安装这些补丁.
 
3.为什么要使用厦门大学网络中心提供的自动更新服务?
由于微软(Microsoft)的网站是在国外,校内很多用户无法直接连到,就算可以直接 连到,但速度也很慢. 使用网络中心提供的自动更新,速度很快,而且也可以节省国际通信费用.
 
4.自动更新服务支持哪些操作系统?
本站支持Windows 2000,Windows XP,Windows 2003, 包括简体中文版和英文版.
 
5.如何使用网络中心提供的WindowsUpdate自动更新服务?
a. 如果您使用的系统是Windwos 2000 SP3 或者更高, Windows XP SP1或者更高版本, Windows 2003, 您只需要直接下载注册表脚本,下载完双击执行即可.
b.如果您使用的系统是非上面所罗列的,你需要先下载并安装自动更新客户端,再按照 上面的方法下载注册表脚本,并安装.
 
6.我如何知道是否已经安装好了WindowsUpdate自动更新服务?
安装完成之后,您打开控制面板,双击"自动更新"图标,如果你所看到 上面的单选框都是灰色的,就表明已经安装完成了.
 
7.为什么我安装完成之后,没有看到任何变化?
WindowUpdate自动更新客户端每隔一定时间去检查是否有更新补丁,因此您可能需要等30分钟后才会看到更新通知.
发表于 @ 18:18 | 评论与反馈 (0)