From d1a4a6ecdac4f118cfea47ecf751e205e160f0be Mon Sep 17 00:00:00 2001
From: aschoen
Date: Wed, 24 Jan 2018 13:38:04 +0100
Subject: [PATCH 1/2] Updating WTL version
---
thirdparty/wtl/CPL.TXT | 94 -
thirdparty/wtl/MS-PL.txt | 22 +
thirdparty/wtl/ReadMe.html | 2555 ++++++++++++++++++
thirdparty/wtl/atlapp.h | 1274 ++-------
thirdparty/wtl/atlcrack.h | 247 +-
thirdparty/wtl/atlctrls.h | 5109 ++++++++++++++++--------------------
thirdparty/wtl/atlctrlw.h | 1054 ++++----
thirdparty/wtl/atlctrlx.h | 1247 ++++-----
thirdparty/wtl/atlddx.h | 106 +-
thirdparty/wtl/atldlgs.h | 1065 ++++----
thirdparty/wtl/atldwm.h | 165 +-
thirdparty/wtl/atlfind.h | 265 +-
thirdparty/wtl/atlframe.h | 708 ++---
thirdparty/wtl/atlgdi.h | 634 +----
thirdparty/wtl/atlmisc.h | 3019 +--------------------
thirdparty/wtl/atlprint.h | 78 +-
thirdparty/wtl/atlres.h | 44 +-
thirdparty/wtl/atlresce.h | 93 -
thirdparty/wtl/atlribbon.h | 409 +--
thirdparty/wtl/atlscrl.h | 612 +++--
thirdparty/wtl/atlsplit.h | 475 +++-
thirdparty/wtl/atltheme.h | 152 +-
thirdparty/wtl/atluser.h | 257 +-
thirdparty/wtl/atlwince.h | 2987 ---------------------
thirdparty/wtl/atlwinx.h | 394 +--
thirdparty/wtl/readme.htm | 3347 -----------------------
26 files changed, 8523 insertions(+), 17889 deletions(-)
delete mode 100644 thirdparty/wtl/CPL.TXT
create mode 100644 thirdparty/wtl/MS-PL.txt
create mode 100644 thirdparty/wtl/ReadMe.html
delete mode 100644 thirdparty/wtl/atlresce.h
delete mode 100644 thirdparty/wtl/atlwince.h
delete mode 100644 thirdparty/wtl/readme.htm
diff --git a/thirdparty/wtl/CPL.TXT b/thirdparty/wtl/CPL.TXT
deleted file mode 100644
index 5207f81..0000000
--- a/thirdparty/wtl/CPL.TXT
+++ /dev/null
@@ -1,94 +0,0 @@
-Common Public License Version 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-
-1. DEFINITIONS
-
-"Contribution" means:
-
-a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
-
-b) in the case of each subsequent Contributor:
-
-i) changes to the Program, and
-
-ii) additions to the Program;
-
-where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
-
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this Agreement.
-
-"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
-
-
-2. GRANT OF RIGHTS
-
-a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
-
-b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
-
-c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
-
-d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
-
-
-3. REQUIREMENTS
-
-A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
-
-a) it complies with the terms and conditions of this Agreement; and
-
-b) its license agreement:
-
-i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
-
-ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
-
-iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
-
-iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
-
-When the Program is made available in source code form:
-
-a) it must be made available under this Agreement; and
-
-b) a copy of this Agreement must be included with each copy of the Program.
-
-Contributors may not remove or alter any copyright notices contained within the Program.
-
-Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
-
-
-4. COMMERCIAL DISTRIBUTION
-
-Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
-
-
-5. NO WARRANTY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
-
-
-6. DISCLAIMER OF LIABILITY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-
-7. GENERAL
-
-If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
diff --git a/thirdparty/wtl/MS-PL.txt b/thirdparty/wtl/MS-PL.txt
new file mode 100644
index 0000000..6d2577a
--- /dev/null
+++ b/thirdparty/wtl/MS-PL.txt
@@ -0,0 +1,22 @@
+Microsoft Public License (MS-PL)
+
+This license governs use of the accompanying software. If you use the software, you
+accept this license. If you do not accept the license, do not use the software.
+
+1. Definitions
+The terms "reproduce," "reproduction," "derivative works," and "distribution" have the
+same meaning here as under U.S. copyright law.
+A "contribution" is the original software, or any additions or changes to the software.
+A "contributor" is any person that distributes its contribution under this license.
+"Licensed patents" are a contributor's patent claims that read directly on its contribution.
+
+2. Grant of Rights
+(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
+(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
+
+3. Conditions and Limitations
+(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
+(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
+(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
+(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
+(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
diff --git a/thirdparty/wtl/ReadMe.html b/thirdparty/wtl/ReadMe.html
new file mode 100644
index 0000000..ea6268c
--- /dev/null
+++ b/thirdparty/wtl/ReadMe.html
@@ -0,0 +1,2555 @@
+
+
+
+
+
+ Windows Template Library
+
+
+
+
+
+
+
+ |
+ Windows Template Library - WTL 10
+
+ version 10.0.7336 (2017-12-02)
+ |
+
+
+
|
+
+
+ | Copyright © 2017 Microsoft Corporation, WTL Team. 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
+ Microsoft Public License (http://opensource.org/licenses/MS-PL)
+ which can be found in the file MS-PL.txt at the root folder.
+ |
+
+
+
|
+
+
+
+
+Welcome to the Windows Template Library, version 10. This document contains the following topics:
+
+
+
+
+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.
+
+
+
+Features and Installation
+
+
+ This is the ningth public release of WTL. This version is released
+ under the Microsoft Public License, enabling developers from the WTL community to
+ contribute to the library.
+
+
+ WTL classes can be used with all versions of VC++ from 2005 to the newest, 2017.
+ AppWizard for Visual Studio 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 script,
+ ATL/WTL AppWizard will appear in the list of AppWizards when you select File.New.Project
+ in VC++ IDE. The file AppWiz\setup.js is the setup script for all supported versions of Visual Studio.
+
+
+ To manually install AppWizard for VC++ 2005, copy all WTLAppWiz.* files from AppWiz\Files to VC++
+ projects directory, %VCDIR%\VC\vcprojects, where %VCDIR% is the directory
+ where VC++ 2005 is installed. After that, open WTL10AppWiz.vsz and modify the
+ line that contains ABSOLUTE_PATH to contain %WTLDIR%\AppWiz\Files, where
+ %WTLDIR% is the directory where WTL files are.
+
+
+Compiler/IDE/ATL support:
+
+ - Visual C++ 2005 (ATL 8.0)
+ - Visual C++ 2008 (ATL 9.0)
+ - Visual C++ 2010 (ATL 10.0)
+ - Visual C++ 2012 (ATL 11.0)
+ - Visual C++ 2013 (ATL 12.0)
+ - Visual C++ 2015 (ATL 14.0)
+ - Visual C++ 2017 (ATL 14.0)
+
+
+
+Windows SDK support (optional):
+
+ - Windows SDK 6.0 or newer
+
+
+
+
+Packing List
+
+
+
+
+ | File Name: |
+ Description: |
+
+
+
|
+
+
+ | readme.html |
+ this file |
+
+
+ | MS-PL.txt |
+ Microsoft 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 |
+
+
+ | atldwm.h |
+ DWM support classes |
+
+
+ | atlfind.h |
+ Find/Replace support for Edit
+ and RichEdit |
+
+
+ | 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 |
+
+
+ | atlribbon.h |
+ RibbonUI support |
+
+
+ | atlscrl.h |
+ scrollable windows |
+
+
+ | atlsplit.h |
+ splitter windows |
+
+
+ | atltheme.h |
+ Windows XP theme classes |
+
+
+ | atluser.h |
+ menu class, USER object classes |
+
+
+ | atlwinx.h |
+ extensions of ATL windowing
+ support |
+
+
+ | |
+
+
+ | Samples\ |
+
+
+ | Aero\... |
+ Vista Aero glass showcase |
+
+
+ | Alpha\... |
+ Windows XP 32-bit (alpha)
+ toolbar images |
+
+
+ | BmpView\... |
+ bitmap file view sample |
+
+
+ | GuidGen\... |
+ WTL version of the GuidGen
+ sample |
+
+
+ | MDIDocVw\... |
+ WTL version of the MDI sample |
+
+
+ | MemDlg\... |
+ In-memory dialog sample |
+
+
+ | MTPad\... |
+ multithreaded notepad sample |
+
+
+ | MTPad7\... |
+ MTPad with RibbonUI |
+
+
+ | TabBrowser\... |
+ Web browser using TabView |
+
+
+ | Wizard97Test\... |
+ Wizard97 showcase
+ sample |
+
+
+ | WTLExplorer\... |
+ Explorer-like application
+ sample |
+
+
+ | |
+
+
+ | AppWiz\ |
+
+
+ | setup.js |
+ AppWizard setup program for all versions of
+ Visual Studio |
+
+
+ | Files\... |
+ WTL AppWizard files |
+
+
+
+
+
+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 |
+
+
+ | CDoubleBufferImpl
+ |
+ impl mi |
+ double-buffer painting support |
+
+
+ | CDoubleBufferWindowImpl
+ |
+ impl |
+ double-buffer painting window |
+
+
+ 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 |
+
+
+ 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 |
+
+
+ | CAeroWizardFrameWindow |
+ client |
+ |
+
+
+ | CAeroWizardFrameImpl |
+ impl |
+ Aero Wizard frame |
+
+
+ | CAeroWizardFrame |
+ as-is |
+ |
+
+
+ | CAeroWizardPageWindow |
+ client |
+ |
+
+
+ | CAeroWizardPageImpl |
+ impl |
+ Aero Wizard page |
+
+
+ | CAeroWizardPage |
+ as-is |
+ |
+
+
+ | CAeroWizardAxPageImpl |
+ impl |
+ Aero Wizard page with ActiveX |
+
+
+ | CAeroWizardAxPage |
+ as-is |
+ |
+
+
+ Common dialogs |
+
+
+ | CFileDialogImpl |
+ impl |
+ GetOpenFileName/GetSaveFileName |
+
+
+ | CFileDialog |
+ as-is |
+ |
+
+
+ | CSimpleFileDialog |
+ as-is |
+ no customization |
+
+
+ | CMultiFileDialogImpl |
+ impl |
+ Multi-select GetOpenFileName |
+
+
+ | CMultiFileDialog |
+ as-is |
+ |
+
+
+ | CShellFileDialogImpl |
+ base |
+ |
+
+
+ | CShellFileOpenDialogImpl |
+ impl |
+ Shell File Open dialog |
+
+
+ | CShellFileOpenDialog |
+ as-is |
+ |
+
+
+ | CShellFileSaveDialogImpl |
+ impl |
+ Shell File Save dialog |
+
+
+ | CShellFileSaveDialog |
+ 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 |
+
+
+ | CMemoryDC |
+ client |
+ in-memory DC |
+
+
+ | 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 |
+ |
+
+
+ | CTabViewImpl; |
+ impl |
+ tab view window |
+
+
+ | CTabView |
+ 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 |
+
+
+ Buffered paint and animation support |
+
+
+ | CBufferedPaint |
+ as-is |
+ buffered paint |
+
+
+ | CBufferedPaintImpl |
+ impl mi |
+ buffered paint support |
+
+
+ | CBufferedPaintWindowImpl |
+ impl |
+ window with buffered paint |
+
+
+ | CBufferedAnimation |
+ as-is |
+ buffered animation |
+
+
+ | CBufferedAnimationImpl |
+ impl mi |
+ buffered animation support |
+
+
+ | CBufferedAnimationWindowImpl |
+ impl |
+ window with buffered animation |
+
+
+ Edit and RichEdit Find/Replace support |
+
+
+ | CEditFindReplaceImplBase |
+ base |
+ |
+
+
+ | CEditFindReplaceImpl |
+ mi |
+ Edit Find/Replace support |
+
+
+ | CRichEditFindReplaceImpl |
+ mi |
+ RichEdit Find/Replace support |
+
+
+ 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 |
+
+
+ | CWinDataExchange |
+ mi |
+ data exchange for controls |
+
+
+ | CRecentDocumentList |
+ mi or as-is |
+ support for MRU list |
+
+
+ | CFindFile |
+ as-is |
+ file search support |
+
+
+ In-memory dialog |
+
+
+ | CDialogBaseUnits |
+ helper |
+ dialog units helper |
+
+
+ | CMemDlgTemplate |
+ as-is |
+ In-memory dialog template |
+
+
+ | CIndirectDialogImpl |
+ impl |
+ In-memory dialog class |
+
+
+ Task dialog |
+
+
+ | CTaskDialogImpl |
+ impl |
+ Task Dialog in Vista |
+
+
+ | CTaskDialog |
+ as-is |
+ |
+
+
+ DWM classes |
+
+
+ | CDwm |
+ client |
+ DWM handle warapper |
+
+
+ | CDwmImpl |
+ impl base |
+ DWM support |
+
+
+ | CDwmWindow |
+ impl |
+ DWM window support |
+
+
+ | CDwmThumbnail |
+ client |
+ DWM thumbnail wrapper |
+
+
+ | CAeroControlImpl |
+ impl |
+ support for Aero controls |
+
+
+ Ribbon classes |
+
+
+ | CRibbonUpdateUI |
+ mi base |
+ automatic mapping of ribbon UI elements |
+
+
+ | RibbonUI::CtrlImpl |
+ base impl |
+ base class for all ribbon controls |
+
+
+ | RibbonUI::CommandCtrlImpl |
+ base impl |
+ base class for ribbon controls |
+
+
+ | RibbonUI::CollectionImplBase |
+ base |
+ base class for all RibbonUI collections |
+
+
+ | RibbonUI::CollectionImpl |
+ impl |
+ RibbonUI collections |
+
+
+ | RibbonUI::CollectionCtrlImpl |
+ impl |
+ specializable class for ribbon collection controls |
+
+
+ | RibbonUI::ToolbarGalleryCtrlImpl |
+ base impl |
+ base class for ribbon toolbar gallery controls |
+
+
+ | RibbonUI::CRibbonImpl |
+ impl |
+ Ribbon implementation class |
+
+
+ | CRibbonFrameWindowImplBase |
+ base |
+ base frame class for Ribbon |
+
+
+ | CRibbonFrameWindowImpl |
+ impl |
+ Ribbon frame window class |
+
+
+ | CRibbonMDIFrameWindowImpl |
+ impl |
+ Ribbon MDI frame window class |
+
+
+ | CRibbonPersist |
+ as-is |
+ Ribbon persistance support |
+
+
+
+
+
+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, TabView, Explorer, dialog based)
+ - Support for hosting ActiveX controls
+ - COM server support
+ - Class implementation in .CPP files
+ - Common Control manifest
+ - Unicode character set
+ - Toolbar, rebar, command bar, status bar
+ - View window, and it's type (generic, dialog form, or a list box, edit, list view, tree view, rich edit, HTML page, scroll window)
+ - For dialog based apps or a form based view window - support for hosting ActiveX controls in the dialog
+
+
+
+ATL/WTL AppWizard supports VC++ 2005, 2008, 2010, 2012, 2013, 2015, and 2017.
+
+
+
+
+
+WTL Releases
+
+
+History
+
+
+ | |
+ WTL 10 |
+ ? |
+
+
+ | |
+ WTL 9.1 |
+ 2015 |
+
+
+ | |
+ WTL 9.0 |
+ 2014 |
+
+
+ | |
+ WTL 8.0 |
+ 2007 |
+
+
+ | |
+ WTL 7.5 |
+ 2005 |
+
+
+ | |
+ WTL 7.1 |
+ 2003 |
+
+
+ | |
+ WTL 7.0 |
+ 2002 |
+
+
+ | |
+ WTL 3.1 |
+ 2000 |
+
+
+ | |
+ WTL 3.0 |
+ 1999 |
+
+
+
+
+Changes Between WTL 10 and 9.1
+TODO
+
+
+Changes Between WTL 9.1 and 9.0
+New and improved:
+
+
+ Full compatibility with VS2015
+ NuGet support and package
+ Microsoft Public License (MS-PL)
+ New sample: MemDlg - demonstrates use of in-memory dialogs
+
+
+
+
+Fixes and enhancements:
+
+
+ Fixes for code analysis warnings
+ Fixes for strict const-qualification conformance (/Zc:strictStrings)
+ CEditFindReplaceImpl::UseShadowBuffer(): Use AtlGetCommCtrlVersion() instead of GetProcAddress()
+ Misc improvements: missing initialization, undefined messages, better #ifdefs
+ CFrameWndClassInfo: Use GetSystemMetrics() for icon sizes
+ BEGIN_MSG_MAP_EX and BEGIN_DDX_MAP: Fix for C4555: expression has no effect
+ CResource::LoadEx(): Fix for the wrong order for parameters to ::FindResourceEx()
+ CPaneContainerImpl:
+
+
+ - New extended styles: PANECNT_DIVIDER and PANECNT_GRADIENT
+ - Fixed background drawing for close button
+
+
+ CImageListManaged: Fix for assert when using attach or operator =
+ WTLExplorer sample cleanup
+ GenericWndClass::Register(): Fix for Windows CE
+ App Wizard: Improved code for generating project configurations
+ CSplitterImpl::OnCaptureChanged(): Fixed so it moves splitter bar only if move was in progress
+ CDynamicUpdateUI::UIRemoveUpdateElement() leaks memory if UPDUI_TEXT is set
+ CToolInfo and CToolTipCtrl: nIDTool argument should be UINT_PTR instead of UINT
+ CSplitterImpl: Added GetSplitterPosPct()
+ CCommandBarCtrlImpl: Fixed incorrect use of m_wndParent when AttachToWindow() is used
+
+
+
+
+Changes Between WTL 9.0 and 8.0
+New and improved:
+
+
+ Full compatibility with VS2008, VS2010, VS2012, and VS2013
+ New CRegKeyEx class for uniform support for registry
+ New MinCrtHelper functions for uniform support for _ATL_MIN_CRT
+ New DWM classes in atldwm.h
+ New Ribbon classes in atlribbon.h
+ New CDialogBaseUnits class
+ Extended DDX support to TabCtrl, ComboBox, ListBox and ListView selection index
+ Improved font handling in CHyperLink, CPaneContainer, CTabView
+ CHyperlink: Added options for auto-create link font and single-line mode
+ CBitmapButtonImpl: Added checked state, GetCheck()/SetCheck(), and check mode extended styles
+ UpdateUI: Added support for radio menu items for popup menus
+ Added support for new VersionHelpers.h in WinSDK 8.1 - GetVersionEx() is now deprecated
+ Improved global support for old SDK headers, and for original headers in VC6 and VC7.x
+ Global support for builds with NOMINMAX defined
+ Global support for builds with STRICT_TYPED_ITEMIDS defined
+ Global support for builds with _ATL_ALL_USER_WARNINGS defined
+ Splitter Window:
+
+
+ - Added keyboard handling
+ - Added default position for splitter bar
+ - Changed orientation from template argument to data member to reduce memory use
+ - Added SPLIT_GRADIENTBAR and SPLIT_FIXEDBARSIZE extended styles
+
+
+ Added CImageListManaged to manage the lifetime of wrapped image list
+ Added Vista standard menu bar look option for Command bar
+ Added new Rich Edit wrappers for _RICHEDIT_VER >= 0x0800
+ Added new Win8 methods to Theme classes
+ Added override of SubclassWindow() to CSplitterWindowImpl, CPaneContainerImpl, CTabViewImpl,
+ CScrollImpl, CMapScrollImpl, CZoomScrollImpl, and CScrollContainerImpl
+ CZoomScrollImpl:
+
+
+ - Added zoom child windows option
+ - Added zoom scale max limit
+
+
+ AppWizard:
+
+
+ - Support for VS2008, VS2010, VS2012, and VS2013
+ - New universal setup for all versions of Visual Studio
+ - Support for ribbon control
+
+
+ Updated samples and added VS2005 project files
+ New sample: MTPad7 - demonstrates Ribbon UI
+
+
+
+
+Fixes and enhancements:
+
+ General:
+
+ - Fixed security warning for _vstprintf in atlapp.h
+ - Added RunTimeHelper::IsThemeAvailable that detects if themes can be used in the app
+ - VS2012: DLL version functions are defined as they are removed from ATL11
+ - Added CWndProcThunk initialization for _ATL_VER >= 0x0800
+ - Added RunTimeHelper::SizeOf_TOOLINFO() for different Windows versions at runtime
+ - Added AtlCreateControlFont()
+
+
+ Controls:
+
+ - Extended CListViewCtrl::SelectItem() to multi-selection list view controls
+ - Added another variant of CListViewCtrl::FindItem for strings
+ - Added new CToolBarCtrl methods - InsertSeparator() and AddSeparator()
+ - Added CToolBarCtrl::GetItemDropDownRect()
+ - Added another variant of CToolTipCtrl::TrackActivate()
+
+
+ Cracked Handlers:
+
+ - Fixed handlers with menu arguments
+ - Fixed MSG_WM_SYSCOMMAND handler
+ - Added MSG_WM_MOUSEHWHEEL handler
+
+
+ App Wizard:
+
+ - Fix for TabView project code generation
+ - Improved generated code for VC++ Express to support various versions of ATL
+ - Fix for missing UIUpdateChildWindows() in dialog projects
+
+
+ App Wizard CE / App Wizard Mobile:
+
+ - Updated AppWizCE for VS2008 - used different CLSID for Platforms object
+ - Fix: VS2008 uses _SECURE_ATL code only
+ - Fix for resource creation failure
+
+
+ Misc:
+
+ - Fix: CLogFont uses ::GetDeviceCaps with wrong default hDC = NULL
+ - Fixed CPen::GetExtLogPen
+ - Fixed CFrameWindowImpl::OnToolTipText*() handlers not to reset text buffer
+ - Added support for chevron menus for multi-line toolbars
+ - Fix: CFileDialog(false) fails on Windows Mobile 5 or 6
+ - Fix: CFolderDialog::SetOKText should use lParam for string
+ - Added CFolderDialog::SetPidlRoot()
+ - Fixed CMemDlgTemplate::AddControl
+ - Added option to disable item dragging in CTabViewImpl
+ - Fixed CTabView::ShowTabControl(false) and UpdateLayout() to hide empty space
+ - CTabView: Fixed value of the active page when inserting pages before it
+ - PaneContainer: Added support for vertical title bar text
+ - atlsplit.h: Added missing support for WM_PRINTCLIENT
+ - Fix: CScrollImpl should not scroll horizontally if not needed
+ - Fixed CScrollImpl::ScrollToView() to use offset correctly
+ - Fixed CPrintDialogExImpl::GetDefaults()
+ - atltheme.h: Added CBufferedAnimation::StopAllAnimations()
+ - Added support for I64 format to CString::Format()
+ - Fix: CStdIndirectDialogImpl - DLGTEMPLATEEX not supported on Mobile devices
+ - Fix: Missing CRichInkCtrlT::SetSel(), added CRichInkCtrlT::Undo()
+
+
+
+
+Changes Between WTL 8.0 and 7.5
+New and improved:
+
+ RunTimeHelper functions for
+ correct struct sizes on different versions of Windows
ModuleHelper functions for uniform support of ATL3 and ATL7 module classes
SecureHelper functions for support of secure and non-secure run-time
+ functions
Support for new Vista features:
+
+ - Support for new messages for common controls, dialogs, etc.
+ - Support for TaskDialog
+ - New Shell file dialogs (IFileOpenDialog and IFileSaveDialog)
+ - New Aero Wizard support classes
+ - New classes for Buffered Paint and Buffered Animation
+
+
+ New TabView classes
New dialog class that uses in-memory dialog templates
New CMultiFileDialogImpl and CMultiFileDialog classes that support
+ multi-select file dialogs
Added message cracker handler prototypes for all handlers
Replaced use of _alloca with CTempBuffer everywhere (and added CTempBuffer
+ version for ATL3)
New classes for find/replace support for Edit or RichEdit
New class CFileDialogEx that supports GetOpenFileNameEx for Windows Mobile 5
+ New features for the App Wizard:
+
+
+ - New default version values
+ - Unicode build option
+ - Support for TabView applications
+ - Support for Explorer applications
+
+ Updates for the desktop App Wizard:
+
+ - Added calls to set font for views based on controls that use font
+ - Added scroll window as another view type
+
+ Support for VC2005 Express:
+
+ - Setup for VS2005x
+ - Changes in default.js to take into account that VC2005x does not have a resource editor
+ - Generated code allows use of ATL3 from the Platform SDK
+
+ New AppWizard for Mobile 2003 and 2005 platforms
+ New samples:
+
+ - Aero - demonstrates the Vista Glass UI
+ - MiniPie - Windows Mobile 2005 PPC and Smartphone sample
+ - TabBrowser - a web browser using TabView class
+
+ MTPad sample updated to show usage of CRichEditFindReplaceImpl and CEditCommands/CRichEditCommands
+
+
+
+Fixes and enhancements:
+
+ Command Bar:
+
+ - Added support for menu items with bitmaps on Vista
+ - Fix: Keyboard cues shown even if the window is disabled
+
+
+ CFolderDialog:
+
+ - Added support for PIDLs in addition to the file path
+ - Replaced use of SHGetMalloc with CoTaskMemFree
+
+
+ Scroll Windows:
+
+ - Fix: CZoomScrollImpl - some methods should be overridable
+ - Added support for WM_MOUSEHWHEEL in CScrollImpl
+
+
+ App Wizard:
+
+ - Fix: AppWizard fails to add files if C:\Temp does not exist
+ - Fix: App Wizard generates security warning when loaded
+ - Fix: App Wizard generates level 4 warning for modal dlg project
+ - Fix: App Wizard setupXX.js scripts silently fail on Vista
+ - Fix: Added code to unregister message filer and idle processing
+ - Fix: Added WS_CLIPSIBLINGS to dialog forms to avoid rebar drawing problems
+
+
+ App Wizard CE:
+
+ - Fix: App Wizard CE should not have rich edit as a view option
+ - Fix: App Wizard CE generates level 4 warnings for single instance apps
+ - Added support for Windows Mobile 6 SDKs
+
+
+ Cracked Handlers:
+
+ - Fix: Corrected MSG_WM_TIMER and handler prototype, removed unused argument (breaking change)
+ - Fix: atlcrack.h does not support WTL namespace
+
+
+ CDialogResize:
+
+ - Added SetIcon(NULL, FALSE) for CDialogResize to remove the generic icon for resizable dialogs
+ - Fix: Enabled size/move for both X and Y
+ - Added center flags for controls
+
+
+ CFrameWindowImpl:
+
+ - Fix: Const issue with title argument of AddSimpleReBarBand
+ - Fix: DECLARE_FRAME_WND_CLASS definition missing WTL namespace
+
+
+ Windows CE:
+
+ - Fix: Some symbols not defined for CE 4.0
+ - Fix: Incorrect WinCE exclusions
+ - Fix: Pocket PC - assert after navigating a CHyperLink
+ - Fix: Property sheet with listview on WM5.0 causes stack overflow
+ - Fix: CFindFile::GetFilePath() fails on diskless root requests
+ - Fix: VS 2005 dialog editor bug - DS_FIXEDSYS used but not defined
+ - Fix: Windows Mobile 2005 compatibility issues
+ - Fix: CFullScreenFrame on Smartphone 20003
+ - Fix: SmartPhone back key handling in CAppWindow
+ - Added orientation aware support to CAppStdDialogImpl
+ - Added CAxDialogImpl base for CStdDialogImpl, CStdDialogResizeImpl and CStdOrientedDialogImpl
+ - Added various CStdDialogxxx enhancements
+ - Fix: CStdDialogBase does not scale dialog title on VGA
+ - Fix: DIBINFO16 triggers code analysis warning
+ - Added LPCTSTR AtlLoadString(UINT uID) - CE only overload
+ - Added imaging draw support to CZoomScrollImpl
+ - Added CBottomTabViewImpl and CBottomTabView classes for PPC
+
+
+ CFindFile:
+
+ - Fix: CFindFile class uses CRT functions
+ - Fix: FindFile() uses lstrcpy without checking length
+
+
+ General:
+
+ - Fix: Adding ReBar bands fails with new Windows SDK
+ - Added support for relative include paths
+ - Fix: Using std::min and std::max
+ - Fix: Problems using WTL with MFC
+ - Improved support for Secure CRT
+ - Changed implementation of CSize, CPoint, CRect, and CString to be inside class definitions
+ - atltheme.h: Corrected method signatures for differences in uxtheme.h versions
+ - Replaced malloc/free with new/delete where appropriate
+
+
+ Misc:
+
+ - Fix: CString::FormatV can cause GPF with Unicode strings
+ - CHyperLink: Added handler for WM_SIZE
+ - Fix: CTheme needs constructor from HTHEME handle
+ - Added Add* methods to several control classes in atlctrls.h to augment Insert* methods
+ - Fix: Incorrect casting in CRichEditCtrl::GetLine()
+ - Fix: CTreeViewCtrl::GetItemState changed to return only state-bits as specified by mask
+ - Fix: CBitmapButton::DoPaint - wrong button image
+ - Added another variant of CDCT::Drawtext with LPTSTR argument that allows text change
+ - Fix: CRecentDocumentListBase::AddToList() uses lstrcpy
+ - Fix: AtlLoadString(uID, lpBuffer, nBufferMax) has unnecessary code
+ - Fix: CCursor::LoadOEMCursor asserts on IDC_HAND
+ - Fix: Memory leak when using CRT functions while printing
+ - Fix: Undefined CString namespace
+ - CPaneContainer: Added border styles
+ - CSplitterImpl: Added SetSplitterPosPct, and changed App Wizard code to use it
+
+
+
+
+
+Changes Between WTL 7.5 and 7.1
+
+New and improved:
+
+
+ VS2005 Compatibility:
+ Added support for Visual Studio 2005 - both desktop and Windows CE
+ Classes for icons, cursors, accelerator tables
+ CSortListViewImpl, CSortListViewCtrlImpl, and CSortListViewCtrl classes
+ Impl classes for Wizard 97 style wizards: CWizard97Sheet,
+ CWizard97Page, CWizard97ExteriorPage, CWizard97InteriorPage
+ CMemoryDC and CDoubleBufferWindowImpl classes
+ Windows CE specific classes in new header, atlwince.h
+ CScrollContainer class
+ CZoomScrollImpl and CZoomScrollWindowImpl classes
+ CZoomPrintPreviewWindowImpl and CZoomPrintPreviewWindow classes
+ Global functions: AtlGetBitmapResourceInfo,
+ AtlGetBitmapResourceBitsPerPixel
+ New REFLECT_* macros to enable selective reflection of messages
+ App Wizard: Added App Wizard for VS2005
+ App Wizard: Added App Wizard for Windows CE for VS2005
+ New samples: WTLExplorer, ImageView, SPControls
+
+
+
+
+Fixes and enhancements:
+
+ Command Bar:
+
+ - DrawBitmapDisabled() doesn't work correctly on Longhorn
+ - Submenu size not correct if command bar is off-screen
+ - Added handler for WM_SETTINGCHANGE to improve theme color changes
+ - Better support for 8/16/24-bit images
+ - Command Bar with 2 Levels of submenus remains active
+ - Hook procedure fails to call next hook
+ - OnDestroy() should not decrement hook use if AttachToWindow() is used
+
+
+ MDI Command Bar:
+
+ - Grows bigger if you switch between two maximized MDI child window types
+ - Move all hook messages processing to a separate function and use pT
+ - MDI icon & buttons should have themed background
+ - Should make MDI buttons gray when inactive
+
+ CString:
+
+ - Helper functions not overloaded properly
+ - Some return types are 'const CString&' and could be just 'CString&'
+ - FormatV() passes size in characters to _alloca, should be in bytes
+ - Fixed stack corruption in FormatV()
+ - Improved boundaries checking for integer overflows/underflows
+
+ CScrollImpl:
+
+ - Scroll bars problem when changing range
+ - SetScrollOffset() doesn't move child windows
+ - Range and thumb drawing problems
+ - Possible overflow in OnMouseWheel()
+ - Support for SIF_DISABLENOSCROLL
+ - Added ScrollToView methods
+
+
+ CMapScrollImpl:
+
+ - SetScrollSize() incorrectly inverts xMin and xMax
+ - SetScrollSize() uses bRedraw = NULL
+
+
+ CTheme:
+
+ - GetThemeFont() bad parameter ordering
+ - Uses LOGFONT and TEXTMETRIC incorrectly (SDK header problem)
+
+
+ CFrameWindowImpl:
+
+ - Improved sizing for Windows CE
+ - CreateSimpleToolBarCtrl() should handle 24-bit bitmaps
+ - Changed WinCE CCECommandBarCtrl typedef and added a PPC CMenuBarCtrl
+ - UpdatesBarPosition() doesn't take Windows CE command bar into account
+
+
+ CDialogResize:
+
+ - Enabled use for Windows CE
+ - Add WS_EX_DLGMODALFRAME to prevent empty icon
+
+
+ CReBarCtrl:
+
+ - Background not painted when resized
+ - Fixed typo in LockBands()
+ - MaximizeBand needs BOOL fIdeal argument
+
+
+ CRichEdit:
+
+ - GetSelText() should support UNICODE strings
+ - GetSelText() uses lpstr instead of lpstrText
+
+
+ CHyperLink:
+
+ - Added _xttoi() helper to avoid CRT in _ATL_MIN_CRT
+ - Fixed resource leak by destroying tooltip window
+
+ CPropertySheetImpl:
+
+ - Improved support for Windows CE
+ - Sheet without title generates a memory fault on Windows CE
+
+
+ CFolderDialog:
+
+ - Add a way to set an initial folder
+ - Uses BFFM_IUNKNOWN which is not always defined
+
+
+ Update UI:
+
+ - Add support to dynamically add UpdateUI elements
+ - UIUpdateMenuBarElement() should use EnableMenu() instead of SetMenuItemInfo() for Windows CE
+
+
+ CDC:
+
+ - FillSolidRect() should restore background color
+ - GetClipRgn() method missing
+
+
+ Printing:
+
+ - CPrinter::CreatePrinterDC() and CreatePrinterIC() members should be const
+ - CDevMode::CopyToHDEVMODE() is missing a call to GlobalUnlock()
+
+
+ AppWizard:
+
+ - Use WTL subfolder to create WTL category for VC7.x and VC8
+ - Rename files from WTLApp7x to WTLAppWiz, and add VS2005 setup file
+ - Fixed setup for x64
+
+
+ General:
+
+ - Redefinition of _MAX_FNAME with Dinkumware Standard C++ Library on Windows CE
+ - Added ATLVERIFY macro for ATL3
+ - Support warning level 4
+ - Missing methods CToolBarCtrl::SetButtonInfo, InsertButton, CTabCtrl::SetItem, CComboBoxEx::InsertItem, SetItem
+ - Missing support for WM_PRINTCLIENT
+ - Removed usage of IsBad* functions
+ - Fixed various compiler warnings
+ - TCHAR bugs in various files
+ - Improved Windows CE support and changes for Visual Studio 2005
+
+
+ Misc:
+
+ - CMDIChildWindowImpl: HMENU should be destroyed in OnDestroy()
+ - CStatic: Should use STM_SETIMAGE instead of STM_SETICON for SetIcon() on Windows CE
+ - CButton: GetButtonStyle() uses wrong mask
+ - CImageList: Made Duplicate() method const
+ - CListViewCtrl: Made SubItemHitTest() method const
+ - CTreeViewCtrl: GetItem() and SetItem() incorrectly restricted to _WIN32_IE >= 0x0500
+ - CMonthCalendarCtrl: GetMonthRange() should be GetMaxTodayWidth()
+ - CDateTimePickerCtrl: SetFormat() should have const argument
+ - CBitmapButtonImpl: Fixed resource leak by destroying tooltip window
+ - CMultiPaneStatusBarCtrlImpl: Cannot handle wide panes without resource strings
+ - CCheckListViewCtrlImpl: Call CheckSelectedItems() through pT
+ - CPaneContainerImpl: SetPaneContainerExtendedStyle() should use pT to call CalcSize()
+ - CFindFile: Enabled for Windows CE
+ - CPropertyPageImpl: Added handlers for callback messages
+ - atlcrack.h: Added return value for MSG_WM_APPCOMMAND
+ - CMenu: New method variants: AppendMenu, InsterMenu, ModifyMenu
+ - CFont: Added arguments for bold and italic to CreatePointFont()
+ - CSize: Added scalar operators for WTL::CSize and ATL::CSize
+ - CRecentDocumentList: Allow changing the "DocumentCount" and "Document%i" registry values strings
+ - CSplitterWindowImpl: Enabled use for Windows CE
+
+
+
+
+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
+
+
+
+
+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
+
+
+
+
+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.html -
+
+
+
+
diff --git a/thirdparty/wtl/atlapp.h b/thirdparty/wtl/atlapp.h
index 05078d9..433c090 100644
--- a/thirdparty/wtl/atlapp.h
+++ b/thirdparty/wtl/atlapp.h
@@ -1,13 +1,10 @@
-// Windows Template Library - WTL version 8.1
-// Copyright (C) Microsoft Corporation. All rights reserved.
+// Windows Template Library - WTL version 10.0
+// Copyright (C) Microsoft Corporation, WTL Team. 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/cpl1.0.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.
+// Microsoft Public License (http://opensource.org/licenses/MS-PL)
+// which can be found in the file MS-PL.txt at the root folder.
#ifndef __ATLAPP_H__
#define __ATLAPP_H__
@@ -22,60 +19,65 @@
#error atlapp.h requires atlbase.h to be included first
#endif
-#ifndef _WIN32_WCE
- #if (WINVER < 0x0400)
- #error WTL requires Windows version 4.0 or higher
- #endif
-
- #if (_WIN32_IE < 0x0300)
- #error WTL requires IE version 3.0 or higher
- #endif
+#ifdef _WIN32_WCE
+ #error WTL10 doesn't support Windows CE
#endif
#ifdef _ATL_NO_COMMODULE
#error WTL requires that _ATL_NO_COMMODULE is not defined
#endif
-#if (_ATL_VER >= 0x0900) && defined(_ATL_MIN_CRT)
- #error _ATL_MIN_CRT is not supported with ATL 9.0 and higher
+#if (_MSC_VER < 1400)
+ #error WTL10 requires C++ compiler version 14 (Visual C++ 2005) or higher
#endif
-#if defined(_WIN32_WCE) && defined(_ATL_MIN_CRT)
- #pragma message("Warning: WTL for Windows CE doesn't use _ATL_MIN_CRT")
+#if (WINVER < 0x0501)
+ #error WTL requires WINVER >= 0x0501
#endif
-#include
-#if !defined(_ATL_MIN_CRT) && defined(_MT) && !defined(_WIN32_WCE)
- #include // for _beginthreadex
+#if (_WIN32_WINNT < 0x0501)
+ #error WTL requires _WIN32_WINNT >= 0x0501
#endif
-#if (_ATL_VER < 0x0800) && !defined(_DEBUG)
- #include
+#if (_WIN32_IE < 0x0600)
+ #error WTL requires _WIN32_IE >= 0x0600
#endif
-#include
-#ifndef _WIN32_WCE
- #pragma comment(lib, "comctl32.lib")
+#if (_ATL_VER < 0x0800)
+ #error WTL10 requires ATL version 8 or higher
+#endif
+
+#ifdef _ATL_MIN_CRT
+ #error WTL10 doesn't support _ATL_MIN_CRT
+#endif
+
+#include
+#ifdef _MT
+ #include // for _beginthreadex
#endif
-#ifndef _WIN32_WCE
- #include "atlres.h"
-#else // CE specific
- #include "atlresce.h"
-#endif // _WIN32_WCE
+#include
+#pragma comment(lib, "comctl32.lib")
+
+// Check for VS2005 without newer WinSDK
+#if (_MSC_VER == 1400) && !defined(RB_GETEXTENDEDSTYLE)
+ #error WTL10 requires WinSDK 6.0 ot higher
+#endif
-// We need to disable this warning because of template class arguments
-#pragma warning(disable: 4127)
+#include
+#pragma comment(lib, "uxtheme.lib")
-#if (_ATL_VER >= 0x0900) && !defined(_SECURE_ATL)
- #define _SECURE_ATL 1
+#if defined(_SYSINFOAPI_H_) && defined(NOT_BUILD_WINDOWS_DEPRECATE)
+ #include
#endif
+#include "atlres.h"
+
///////////////////////////////////////////////////////////////////////////////
// WTL version number
-#define _WTL_VER 0x0810
+#define _WTL_VER 0x1000 // version 10.0
///////////////////////////////////////////////////////////////////////////////
@@ -88,8 +90,6 @@
// CAppModule
// CServerAppModule
//
-// CRegKeyEx
-//
// Global functions:
// AtlGetDefaultGuiFont()
// AtlCreateControlFont()
@@ -97,341 +97,6 @@
// AtlInitCommonControls()
-///////////////////////////////////////////////////////////////////////////////
-// Global support for Windows CE
-
-#ifdef _WIN32_WCE
-
-#ifndef SW_SHOWDEFAULT
- #define SW_SHOWDEFAULT SW_SHOWNORMAL
-#endif // !SW_SHOWDEFAULT
-
-// These get's OR-ed in a constant and will have no effect.
-// Defining them reduces the number of #ifdefs required for CE.
-#define LR_DEFAULTSIZE 0
-#define LR_LOADFROMFILE 0
-
-#ifndef SM_CXCURSOR
- #define SM_CXCURSOR 13
-#endif
-#ifndef SM_CYCURSOR
- #define SM_CYCURSOR 14
-#endif
-
-inline BOOL IsMenu(HMENU hMenu)
-{
- MENUITEMINFO mii = { sizeof(MENUITEMINFO) };
- ::SetLastError(0);
- BOOL bRet = ::GetMenuItemInfo(hMenu, 0, TRUE, &mii);
- if(!bRet)
- bRet = (::GetLastError() != ERROR_INVALID_MENU_HANDLE) ? TRUE : FALSE;
- return bRet;
-}
-
-#if (_WIN32_WCE >= 410)
-extern "C" void WINAPI ListView_SetItemSpacing(HWND hwndLV, int iHeight);
-#endif // (_WIN32_WCE >= 410)
-
-inline int MulDiv(IN int nNumber, IN int nNumerator, IN int nDenominator)
-{
- __int64 multiple = nNumber * nNumerator;
- return static_cast(multiple / nDenominator);
-}
-
-#if (_ATL_VER >= 0x0800)
-
-#ifndef _WTL_KEEP_WS_OVERLAPPEDWINDOW
- #ifdef WS_OVERLAPPEDWINDOW
- #undef WS_OVERLAPPEDWINDOW
- #define WS_OVERLAPPEDWINDOW 0
- #endif // WS_OVERLAPPEDWINDOW
-#endif // !_WTL_KEEP_WS_OVERLAPPEDWINDOW
-
-#ifndef RDW_FRAME
- #define RDW_FRAME 0
-#endif // !RDW_FRAME
-
-#ifndef WM_WINDOWPOSCHANGING
- #define WM_WINDOWPOSCHANGING 0
-#endif // !WM_WINDOWPOSCHANGING
-
-#define FreeResource(x)
-#define UnlockResource(x)
-
-namespace ATL
-{
- inline HRESULT CComModule::RegisterClassObjects(DWORD /*dwClsContext*/, DWORD /*dwFlags*/) throw()
- { return E_NOTIMPL; }
- inline HRESULT CComModule::RevokeClassObjects() throw()
- { return E_NOTIMPL; }
-}; // namespace ATL
-
-#ifndef lstrlenW
- #define lstrlenW (int)ATL::lstrlenW
-#endif // lstrlenW
-
-inline int WINAPI lstrlenA(LPCSTR lpszString)
-{ return ATL::lstrlenA(lpszString); }
-
-#ifdef lstrcpyn
- #undef lstrcpyn
- #define lstrcpyn ATL::lstrcpynW
-#endif // lstrcpyn
-
-#ifndef SetWindowLongPtrW
- inline LONG_PTR tmp_SetWindowLongPtrW( HWND hWnd, int nIndex, LONG_PTR dwNewLong )
- {
- return( ::SetWindowLongW( hWnd, nIndex, LONG( dwNewLong ) ) );
- }
- #define SetWindowLongPtrW tmp_SetWindowLongPtrW
-#endif
-
-#ifndef GetWindowLongPtrW
- inline LONG_PTR tmp_GetWindowLongPtrW( HWND hWnd, int nIndex )
- {
- return( ::GetWindowLongW( hWnd, nIndex ) );
- }
- #define GetWindowLongPtrW tmp_GetWindowLongPtrW
-#endif
-
-#ifndef LongToPtr
- #define LongToPtr(x) ((void*)x)
-#endif
-
-#ifndef PtrToInt
- #define PtrToInt( p ) ((INT)(INT_PTR) (p) )
-#endif
-
-#else // !(_ATL_VER >= 0x0800)
-
-#ifdef lstrlenW
- #undef lstrlenW
- #define lstrlenW (int)::wcslen
-#endif // lstrlenW
-
-#define lstrlenA (int)strlen
-
-#ifndef lstrcpyn
- inline LPTSTR lstrcpyn(LPTSTR lpstrDest, LPCTSTR lpstrSrc, int nLength)
- {
- if(lpstrDest == NULL || lpstrSrc == NULL || nLength <= 0)
- return NULL;
- int nLen = min(lstrlen(lpstrSrc), nLength - 1);
- LPTSTR lpstrRet = (LPTSTR)memcpy(lpstrDest, lpstrSrc, nLen * sizeof(TCHAR));
- lpstrDest[nLen] = 0;
- return lpstrRet;
- }
-#endif // !lstrcpyn
-
-#ifndef lstrcpynW
- inline LPWSTR lstrcpynW(LPWSTR lpstrDest, LPCWSTR lpstrSrc, int nLength)
- {
- return lstrcpyn(lpstrDest, lpstrSrc, nLength); // WinCE is Unicode only
- }
-#endif // !lstrcpynW
-
-#ifndef lstrcpynA
- inline LPSTR lstrcpynA(LPSTR lpstrDest, LPCSTR lpstrSrc, int nLength)
- {
- if(lpstrDest == NULL || lpstrSrc == NULL || nLength <= 0)
- return NULL;
- int nLen = min(lstrlenA(lpstrSrc), nLength - 1);
- LPSTR lpstrRet = (LPSTR)memcpy(lpstrDest, lpstrSrc, nLen * sizeof(char));
- lpstrDest[nLen] = 0;
- return lpstrRet;
- }
-#endif // !lstrcpyn
-
-#ifdef TrackPopupMenu
- #undef TrackPopupMenu
-#endif // TrackPopupMenu
-
-#define DECLARE_WND_CLASS_EX(WndClassName, style, bkgnd) \
-static CWndClassInfo& GetWndClassInfo() \
-{ \
- static CWndClassInfo wc = \
- { \
- { style, StartWindowProc, \
- 0, 0, NULL, NULL, NULL, (HBRUSH)(bkgnd + 1), NULL, WndClassName }, \
- NULL, NULL, IDC_ARROW, TRUE, 0, _T("") \
- }; \
- return wc; \
-}
-
-#ifndef _MAX_FNAME
- #define _MAX_FNAME _MAX_PATH
-#endif // _MAX_FNAME
-
-#if (_WIN32_WCE < 400)
- #define MAKEINTATOM(i) (LPTSTR)((ULONG_PTR)((WORD)(i)))
-#endif // (_WIN32_WCE < 400)
-
-#if (_WIN32_WCE < 410)
- #define WHEEL_PAGESCROLL (UINT_MAX)
- #define WHEEL_DELTA 120
-#endif // (_WIN32_WCE < 410)
-
-#ifdef DrawIcon
- #undef DrawIcon
-#endif
-
-#ifndef VARCMP_LT
- #define VARCMP_LT 0
-#endif
-#ifndef VARCMP_EQ
- #define VARCMP_EQ 1
-#endif
-#ifndef VARCMP_GT
- #define VARCMP_GT 2
-#endif
-#ifndef VARCMP_NULL
- #define VARCMP_NULL 3
-#endif
-
-#ifndef RDW_ALLCHILDREN
- #define RDW_ALLCHILDREN 0
-#endif
-
-#endif // !(_ATL_VER >= 0x0800)
-
-#endif // _WIN32_WCE
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Global support for using original VC++ 6.0 headers with WTL
-
-#ifndef _ATL_NO_OLD_HEADERS_WIN64
-#if !defined(_WIN64) && (_ATL_VER < 0x0700)
-
- #ifndef PSM_INSERTPAGE
- #define PSM_INSERTPAGE (WM_USER + 119)
- #endif // !PSM_INSERTPAGE
-
- #ifndef GetClassLongPtr
- #define GetClassLongPtrA GetClassLongA
- #define GetClassLongPtrW GetClassLongW
- #ifdef UNICODE
- #define GetClassLongPtr GetClassLongPtrW
- #else
- #define GetClassLongPtr GetClassLongPtrA
- #endif // !UNICODE
- #endif // !GetClassLongPtr
-
- #ifndef GCLP_HICONSM
- #define GCLP_HICONSM (-34)
- #endif // !GCLP_HICONSM
-
- #ifndef GetWindowLongPtr
- #define GetWindowLongPtrA GetWindowLongA
- #define GetWindowLongPtrW GetWindowLongW
- #ifdef UNICODE
- #define GetWindowLongPtr GetWindowLongPtrW
- #else
- #define GetWindowLongPtr GetWindowLongPtrA
- #endif // !UNICODE
- #endif // !GetWindowLongPtr
-
- #ifndef SetWindowLongPtr
- #define SetWindowLongPtrA SetWindowLongA
- #define SetWindowLongPtrW SetWindowLongW
- #ifdef UNICODE
- #define SetWindowLongPtr SetWindowLongPtrW
- #else
- #define SetWindowLongPtr SetWindowLongPtrA
- #endif // !UNICODE
- #endif // !SetWindowLongPtr
-
- #ifndef GWLP_WNDPROC
- #define GWLP_WNDPROC (-4)
- #endif
- #ifndef GWLP_HINSTANCE
- #define GWLP_HINSTANCE (-6)
- #endif
- #ifndef GWLP_HWNDPARENT
- #define GWLP_HWNDPARENT (-8)
- #endif
- #ifndef GWLP_USERDATA
- #define GWLP_USERDATA (-21)
- #endif
- #ifndef GWLP_ID
- #define GWLP_ID (-12)
- #endif
-
- #ifndef DWLP_MSGRESULT
- #define DWLP_MSGRESULT 0
- #endif
-
- typedef long LONG_PTR;
- typedef unsigned long ULONG_PTR;
- typedef ULONG_PTR DWORD_PTR;
-
- #ifndef HandleToUlong
- #define HandleToUlong( h ) ((ULONG)(ULONG_PTR)(h) )
- #endif
- #ifndef HandleToLong
- #define HandleToLong( h ) ((LONG)(LONG_PTR) (h) )
- #endif
- #ifndef LongToHandle
- #define LongToHandle( h) ((HANDLE)(LONG_PTR) (h))
- #endif
- #ifndef PtrToUlong
- #define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) )
- #endif
- #ifndef PtrToLong
- #define PtrToLong( p ) ((LONG)(LONG_PTR) (p) )
- #endif
- #ifndef PtrToUint
- #define PtrToUint( p ) ((UINT)(UINT_PTR) (p) )
- #endif
- #ifndef PtrToInt
- #define PtrToInt( p ) ((INT)(INT_PTR) (p) )
- #endif
- #ifndef PtrToUshort
- #define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) )
- #endif
- #ifndef PtrToShort
- #define PtrToShort( p ) ((short)(LONG_PTR)(p) )
- #endif
- #ifndef IntToPtr
- #define IntToPtr( i ) ((VOID *)(INT_PTR)((int)i))
- #endif
- #ifndef UIntToPtr
- #define UIntToPtr( ui ) ((VOID *)(UINT_PTR)((unsigned int)ui))
- #endif
- #ifndef LongToPtr
- #define LongToPtr( l ) ((VOID *)(LONG_PTR)((long)l))
- #endif
- #ifndef ULongToPtr
- #define ULongToPtr( ul ) ((VOID *)(ULONG_PTR)((unsigned long)ul))
- #endif
-
-#endif // !defined(_WIN64) && (_ATL_VER < 0x0700)
-#endif // !_ATL_NO_OLD_HEADERS_WIN64
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Global support for SecureHelper functions
-
-#ifndef _TRUNCATE
- #define _TRUNCATE ((size_t)-1)
-#endif
-
-#ifndef _ERRCODE_DEFINED
- #define _ERRCODE_DEFINED
- typedef int errno_t;
-#endif
-
-#ifndef _SECURECRT_ERRCODE_VALUES_DEFINED
- #define _SECURECRT_ERRCODE_VALUES_DEFINED
- #define EINVAL 22
- #define STRUNCATE 80
-#endif
-
-#ifndef _countof
- #define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
-#endif
-
-
///////////////////////////////////////////////////////////////////////////////
// Miscellaneous global support
@@ -454,25 +119,14 @@ static CWndClassInfo& GetWndClassInfo() \
#endif
// Dummy structs for compiling with /CLR
-#if (_MSC_VER >= 1300) && defined(_MANAGED)
+#ifdef _MANAGED
__if_not_exists(_IMAGELIST::_IMAGELIST) { struct _IMAGELIST { }; }
__if_not_exists(_TREEITEM::_TREEITEM) { struct _TREEITEM { }; }
__if_not_exists(_PSP::_PSP) { struct _PSP { }; }
#endif
-// Define ATLVERIFY macro for ATL3
-#if (_ATL_VER < 0x0700)
- #ifndef ATLVERIFY
- #ifdef _DEBUG
- #define ATLVERIFY(expr) ATLASSERT(expr)
- #else
- #define ATLVERIFY(expr) (expr)
- #endif // DEBUG
- #endif // ATLVERIFY
-#endif // (_ATL_VER < 0x0700)
-
-// Forward declaration for ATL3 and ATL11 fix
-#if (((_ATL_VER < 0x0700) && defined(_ATL_DLL)) || (_ATL_VER >= 0x0B00)) && !defined(_WIN32_WCE)
+// Forward declaration for ATL11 fix
+#if (_ATL_VER >= 0x0B00)
namespace ATL { HRESULT AtlGetCommCtrlVersion(LPDWORD pdwMajor, LPDWORD pdwMinor); };
#endif
@@ -480,53 +134,35 @@ static CWndClassInfo& GetWndClassInfo() \
#define WM_MOUSEHWHEEL 0x020E
#endif
+// Used for stack allocations with ATL::CTempBuffer
+#ifndef _WTL_STACK_ALLOC_THRESHOLD
+ #define _WTL_STACK_ALLOC_THRESHOLD 512
+#endif
+
namespace WTL
{
-#if (_ATL_VER >= 0x0700)
- DECLARE_TRACE_CATEGORY(atlTraceUI);
- #ifdef _DEBUG
- __declspec(selectany) ATL::CTraceCategory atlTraceUI(_T("atlTraceUI"));
- #endif // _DEBUG
-#else // !(_ATL_VER >= 0x0700)
- enum wtlTraceFlags
- {
- atlTraceUI = 0x10000000
- };
-#endif // !(_ATL_VER >= 0x0700)
-
-// Windows version helper
-inline bool AtlIsOldWindows()
-{
- OSVERSIONINFO ovi = { sizeof(OSVERSIONINFO) };
- BOOL bRet = ::GetVersionEx(&ovi);
- return (!bRet || !((ovi.dwMajorVersion >= 5) || (ovi.dwMajorVersion == 4 && ovi.dwMinorVersion >= 90)));
-}
+DECLARE_TRACE_CATEGORY(atlTraceUI);
+#ifdef _DEBUG
+ __declspec(selectany) ATL::CTraceCategory atlTraceUI(_T("atlTraceUI"));
+#endif // _DEBUG
// Default GUI font helper - "MS Shell Dlg" stock font
inline HFONT AtlGetDefaultGuiFont()
{
-#ifndef _WIN32_WCE
return (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
-#else // CE specific
- return (HFONT)::GetStockObject(SYSTEM_FONT);
-#endif // _WIN32_WCE
}
// Control font helper - default font for controls not in a dialog
// (NOTE: Caller owns the font, and should destroy it when it's no longer needed)
inline HFONT AtlCreateControlFont()
{
-#ifndef _WIN32_WCE
LOGFONT lf = { 0 };
ATLVERIFY(::SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, 0) != FALSE);
HFONT hFont = ::CreateFontIndirect(&lf);
ATLASSERT(hFont != NULL);
return hFont;
-#else // CE specific
- return (HFONT)::GetStockObject(SYSTEM_FONT);
-#endif // _WIN32_WCE
}
// Bold font helper
@@ -534,16 +170,10 @@ inline HFONT AtlCreateControlFont()
inline HFONT AtlCreateBoldFont(HFONT hFont = NULL)
{
LOGFONT lf = { 0 };
-#ifndef _WIN32_WCE
if(hFont == NULL)
ATLVERIFY(::SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, 0) != FALSE);
else
ATLVERIFY(::GetObject(hFont, sizeof(LOGFONT), &lf) == sizeof(LOGFONT));
-#else // CE specific
- if(hFont == NULL)
- hFont = (HFONT)::GetStockObject(SYSTEM_FONT);
- ATLVERIFY(::GetObject(hFont, sizeof(LOGFONT), &lf) == sizeof(LOGFONT));
-#endif // _WIN32_WCE
lf.lfWeight = FW_BOLD;
HFONT hFontBold = ::CreateFontIndirect(&lf);
ATLASSERT(hFontBold != NULL);
@@ -563,11 +193,6 @@ inline BOOL AtlInitCommonControls(DWORD dwFlags)
///////////////////////////////////////////////////////////////////////////////
// RunTimeHelper - helper functions for Windows version and structure sizes
-// Not for Windows CE
-#if defined(_WIN32_WCE) && !defined(_WTL_NO_RUNTIME_STRUCT_SIZE)
- #define _WTL_NO_RUNTIME_STRUCT_SIZE
-#endif
-
#ifndef _WTL_NO_RUNTIME_STRUCT_SIZE
#ifndef _SIZEOF_STRUCT
@@ -590,15 +215,18 @@ inline BOOL AtlInitCommonControls(DWORD dwFlags)
#define MCHITTESTINFO_V1_SIZE _SIZEOF_STRUCT(MCHITTESTINFO, st)
#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN) && !defined(MCHITTESTINFO_V1_SIZE)
-#if !defined(_WIN32_WCE) && (WINVER >= 0x0600) && !defined(NONCLIENTMETRICS_V1_SIZE)
+#if (WINVER >= 0x0600) && !defined(NONCLIENTMETRICS_V1_SIZE)
#define NONCLIENTMETRICS_V1_SIZE _SIZEOF_STRUCT(NONCLIENTMETRICS, lfMessageFont)
-#endif // !defined(_WIN32_WCE) && (WINVER >= 0x0600) && !defined(NONCLIENTMETRICS_V1_SIZE)
+#endif // (WINVER >= 0x0600) && !defined(NONCLIENTMETRICS_V1_SIZE)
+
+#ifndef TTTOOLINFO_V2_SIZE
+ #define TTTOOLINFO_V2_SIZE _SIZEOF_STRUCT(TTTOOLINFO, lParam)
+#endif
#endif // !_WTL_NO_RUNTIME_STRUCT_SIZE
namespace RunTimeHelper
{
-#ifndef _WIN32_WCE
inline bool IsCommCtrl6()
{
DWORD dwMajor = 0, dwMinor = 0;
@@ -608,44 +236,29 @@ namespace RunTimeHelper
inline bool IsVista()
{
+#ifdef _versionhelpers_H_INCLUDED_
+ return ::IsWindowsVistaOrGreater();
+#else // !_versionhelpers_H_INCLUDED_
OSVERSIONINFO ovi = { sizeof(OSVERSIONINFO) };
BOOL bRet = ::GetVersionEx(&ovi);
return ((bRet != FALSE) && (ovi.dwMajorVersion >= 6));
+#endif // _versionhelpers_H_INCLUDED_
}
inline bool IsThemeAvailable()
{
- bool bRet = false;
-
- if(IsCommCtrl6())
- {
- HMODULE hThemeDLL = ::LoadLibrary(_T("uxtheme.dll"));
- if(hThemeDLL != NULL)
- {
- typedef BOOL (STDAPICALLTYPE *PFN_IsThemeActive)();
- PFN_IsThemeActive pfnIsThemeActive = (PFN_IsThemeActive)::GetProcAddress(hThemeDLL, "IsThemeActive");
- ATLASSERT(pfnIsThemeActive != NULL);
- bRet = (pfnIsThemeActive != NULL) && (pfnIsThemeActive() != FALSE);
- if(bRet)
- {
- typedef BOOL (STDAPICALLTYPE *PFN_IsAppThemed)();
- PFN_IsAppThemed pfnIsAppThemed = (PFN_IsAppThemed)::GetProcAddress(hThemeDLL, "IsAppThemed");
- ATLASSERT(pfnIsAppThemed != NULL);
- bRet = (pfnIsAppThemed != NULL) && (pfnIsAppThemed() != FALSE);
- }
-
- ::FreeLibrary(hThemeDLL);
- }
- }
-
- return bRet;
+ return IsCommCtrl6() && (::IsThemeActive() != FALSE) && (::IsAppThemed() != FALSE);
}
inline bool IsWin7()
{
+#ifdef _versionhelpers_H_INCLUDED_
+ return ::IsWindows7OrGreater();
+#else // !_versionhelpers_H_INCLUDED_
OSVERSIONINFO ovi = { sizeof(OSVERSIONINFO) };
BOOL bRet = ::GetVersionEx(&ovi);
return ((bRet != FALSE) && (ovi.dwMajorVersion == 6) && (ovi.dwMinorVersion >= 1));
+#endif // _versionhelpers_H_INCLUDED_
}
inline bool IsRibbonUIAvailable()
@@ -676,134 +289,109 @@ namespace RunTimeHelper
return (iRibbonUI == 1);
}
-#endif // !_WIN32_WCE
-
- inline int SizeOf_REBARBANDINFO()
+ inline UINT SizeOf_REBARBANDINFO()
{
- int nSize = sizeof(REBARBANDINFO);
+ UINT uSize = sizeof(REBARBANDINFO);
#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)
if(!(IsVista() && IsCommCtrl6()))
- nSize = REBARBANDINFO_V6_SIZE;
+ uSize = REBARBANDINFO_V6_SIZE;
#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)
- return nSize;
+ return uSize;
}
-#if (_WIN32_WINNT >= 0x501)
- inline int SizeOf_LVGROUP()
+ inline UINT SizeOf_LVGROUP()
{
- int nSize = sizeof(LVGROUP);
+ UINT uSize = sizeof(LVGROUP);
#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)
if(!IsVista())
- nSize = LVGROUP_V5_SIZE;
+ uSize = LVGROUP_V5_SIZE;
#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)
- return nSize;
+ return uSize;
}
- inline int SizeOf_LVTILEINFO()
+ inline UINT SizeOf_LVTILEINFO()
{
- int nSize = sizeof(LVTILEINFO);
+ UINT uSize = sizeof(LVTILEINFO);
#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)
if(!IsVista())
- nSize = LVTILEINFO_V5_SIZE;
+ uSize = LVTILEINFO_V5_SIZE;
#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)
- return nSize;
+ return uSize;
}
-#endif // (_WIN32_WINNT >= 0x501)
- inline int SizeOf_MCHITTESTINFO()
+ inline UINT SizeOf_MCHITTESTINFO()
{
- int nSize = sizeof(MCHITTESTINFO);
+ UINT uSize = sizeof(MCHITTESTINFO);
#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)
if(!(IsVista() && IsCommCtrl6()))
- nSize = MCHITTESTINFO_V1_SIZE;
+ uSize = MCHITTESTINFO_V1_SIZE;
#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)
- return nSize;
+ return uSize;
}
-#ifndef _WIN32_WCE
- inline int SizeOf_NONCLIENTMETRICS()
+ inline UINT SizeOf_NONCLIENTMETRICS()
{
- int nSize = sizeof(NONCLIENTMETRICS);
+ UINT uSize = sizeof(NONCLIENTMETRICS);
#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (WINVER >= 0x0600)
if(!IsVista())
- nSize = NONCLIENTMETRICS_V1_SIZE;
+ uSize = NONCLIENTMETRICS_V1_SIZE;
#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (WINVER >= 0x0600)
- return nSize;
+ return uSize;
+ }
+
+ inline UINT SizeOf_TOOLINFO()
+ {
+ UINT uSize = sizeof(TOOLINFO);
+#ifndef _WTL_NO_RUNTIME_STRUCT_SIZE
+ if(!IsVista())
+ uSize = TTTOOLINFO_V2_SIZE;
+#endif
+ return uSize;
}
-#endif // !_WIN32_WCE
};
///////////////////////////////////////////////////////////////////////////////
-// ModuleHelper - helper functions for ATL3 and ATL7 module classes
+// ModuleHelper - helper functions for ATL (deprecated)
namespace ModuleHelper
{
inline HINSTANCE GetModuleInstance()
{
-#if (_ATL_VER >= 0x0700)
return ATL::_AtlBaseModule.GetModuleInstance();
-#else // !(_ATL_VER >= 0x0700)
- return ATL::_pModule->GetModuleInstance();
-#endif // !(_ATL_VER >= 0x0700)
}
inline HINSTANCE GetResourceInstance()
{
-#if (_ATL_VER >= 0x0700)
return ATL::_AtlBaseModule.GetResourceInstance();
-#else // !(_ATL_VER >= 0x0700)
- return ATL::_pModule->GetResourceInstance();
-#endif // !(_ATL_VER >= 0x0700)
}
inline void AddCreateWndData(ATL::_AtlCreateWndData* pData, void* pObject)
{
-#if (_ATL_VER >= 0x0700)
ATL::_AtlWinModule.AddCreateWndData(pData, pObject);
-#else // !(_ATL_VER >= 0x0700)
- ATL::_pModule->AddCreateWndData(pData, pObject);
-#endif // !(_ATL_VER >= 0x0700)
}
inline void* ExtractCreateWndData()
{
-#if (_ATL_VER >= 0x0700)
return ATL::_AtlWinModule.ExtractCreateWndData();
-#else // !(_ATL_VER >= 0x0700)
- return ATL::_pModule->ExtractCreateWndData();
-#endif // !(_ATL_VER >= 0x0700)
}
};
///////////////////////////////////////////////////////////////////////////////
-// SecureHelper - helper functions for VS2005 secure CRT
+// SecureHelper - WTL10 requires use if secure functions
+// these are here only for compatibility with existing projects
namespace SecureHelper
{
inline void strcpyA_x(char* lpstrDest, size_t cchDest, const char* lpstrSrc)
{
-#if _SECURE_ATL
ATL::Checked::strcpy_s(lpstrDest, cchDest, lpstrSrc);
-#else
- if(cchDest > (size_t)lstrlenA(lpstrSrc))
- ATLVERIFY(lstrcpyA(lpstrDest, lpstrSrc) != NULL);
- else
- ATLASSERT(FALSE);
-#endif
}
inline void strcpyW_x(wchar_t* lpstrDest, size_t cchDest, const wchar_t* lpstrSrc)
{
-#if _SECURE_ATL
ATL::Checked::wcscpy_s(lpstrDest, cchDest, lpstrSrc);
-#else
- if(cchDest > (size_t)lstrlenW(lpstrSrc))
- ATLVERIFY(lstrcpyW(lpstrDest, lpstrSrc) != NULL);
- else
- ATLASSERT(FALSE);
-#endif
}
inline void strcpy_x(LPTSTR lpstrDest, size_t cchDest, LPCTSTR lpstrSrc)
@@ -817,56 +405,12 @@ namespace SecureHelper
inline errno_t strncpyA_x(char* lpstrDest, size_t cchDest, const char* lpstrSrc, size_t cchCount)
{
-#if _SECURE_ATL
return ATL::Checked::strncpy_s(lpstrDest, cchDest, lpstrSrc, cchCount);
-#else
- errno_t nRet = 0;
- if(lpstrDest == NULL || cchDest == 0 || lpstrSrc == NULL)
- {
- nRet = EINVAL;
- }
- else if(cchCount == _TRUNCATE)
- {
- cchCount = min(cchDest - 1, size_t(lstrlenA(lpstrSrc)));
- nRet = STRUNCATE;
- }
- else if(cchDest <= cchCount)
- {
- lpstrDest[0] = 0;
- nRet = EINVAL;
- }
- if(nRet == 0 || nRet == STRUNCATE)
- nRet = (lstrcpynA(lpstrDest, lpstrSrc, (int)cchCount + 1) != NULL) ? nRet : EINVAL;
- ATLASSERT(nRet == 0 || nRet == STRUNCATE);
- return nRet;
-#endif
}
inline errno_t strncpyW_x(wchar_t* lpstrDest, size_t cchDest, const wchar_t* lpstrSrc, size_t cchCount)
{
-#if _SECURE_ATL
return ATL::Checked::wcsncpy_s(lpstrDest, cchDest, lpstrSrc, cchCount);
-#else
- errno_t nRet = 0;
- if(lpstrDest == NULL || cchDest == 0 || lpstrSrc == NULL)
- {
- nRet = EINVAL;
- }
- else if(cchCount == _TRUNCATE)
- {
- cchCount = min(cchDest - 1, size_t(lstrlenW(lpstrSrc)));
- nRet = STRUNCATE;
- }
- else if(cchDest <= cchCount)
- {
- lpstrDest[0] = 0;
- nRet = EINVAL;
- }
- if(nRet == 0 || nRet == STRUNCATE)
- nRet = (lstrcpynW(lpstrDest, lpstrSrc, (int)cchCount + 1) != NULL) ? nRet : EINVAL;
- ATLASSERT(nRet == 0 || nRet == STRUNCATE);
- return nRet;
-#endif
}
inline errno_t strncpy_x(LPTSTR lpstrDest, size_t cchDest, LPCTSTR lpstrSrc, size_t cchCount)
@@ -880,26 +424,12 @@ namespace SecureHelper
inline void strcatA_x(char* lpstrDest, size_t cchDest, const char* lpstrSrc)
{
-#if _SECURE_ATL
ATL::Checked::strcat_s(lpstrDest, cchDest, lpstrSrc);
-#else
- if(cchDest > (size_t)lstrlenA(lpstrSrc))
- ATLVERIFY(lstrcatA(lpstrDest, lpstrSrc) != NULL);
- else
- ATLASSERT(FALSE);
-#endif
}
inline void strcatW_x(wchar_t* lpstrDest, size_t cchDest, const wchar_t* lpstrSrc)
{
-#if _SECURE_ATL
ATL::Checked::wcscat_s(lpstrDest, cchDest, lpstrSrc);
-#else
- if(cchDest > (size_t)lstrlenW(lpstrSrc))
- ATLVERIFY(lstrcatW(lpstrDest, lpstrSrc) != NULL);
- else
- ATLASSERT(FALSE);
-#endif
}
inline void strcat_x(LPTSTR lpstrDest, size_t cchDest, LPCTSTR lpstrSrc)
@@ -913,48 +443,22 @@ namespace SecureHelper
inline void memcpy_x(void* pDest, size_t cbDest, const void* pSrc, size_t cbSrc)
{
-#if _SECURE_ATL
ATL::Checked::memcpy_s(pDest, cbDest, pSrc, cbSrc);
-#else
- if(cbDest >= cbSrc)
- memcpy(pDest, pSrc, cbSrc);
- else
- ATLASSERT(FALSE);
-#endif
}
inline void memmove_x(void* pDest, size_t cbDest, const void* pSrc, size_t cbSrc)
{
-#if _SECURE_ATL
ATL::Checked::memmove_s(pDest, cbDest, pSrc, cbSrc);
-#else
- if(cbDest >= cbSrc)
- memmove(pDest, pSrc, cbSrc);
- else
- ATLASSERT(FALSE);
-#endif
}
inline int vsprintf_x(LPTSTR lpstrBuff, size_t cchBuff, LPCTSTR lpstrFormat, va_list args)
{
-#if _SECURE_ATL && !defined(_ATL_MIN_CRT) && !defined(_WIN32_WCE)
return _vstprintf_s(lpstrBuff, cchBuff, lpstrFormat, args);
-#else
- cchBuff; // Avoid unused argument warning
-#pragma warning(disable: 4996)
- return _vstprintf(lpstrBuff, lpstrFormat, args);
-#pragma warning(default: 4996)
-#endif
}
inline int wvsprintf_x(LPTSTR lpstrBuff, size_t cchBuff, LPCTSTR lpstrFormat, va_list args)
{
-#if _SECURE_ATL && !defined(_ATL_MIN_CRT) && !defined(_WIN32_WCE)
return _vstprintf_s(lpstrBuff, cchBuff, lpstrFormat, args);
-#else
- cchBuff; // Avoid unused argument warning
- return ::wvsprintf(lpstrBuff, lpstrFormat, args);
-#endif
}
inline int sprintf_x(LPTSTR lpstrBuff, size_t cchBuff, LPCTSTR lpstrFormat, ...)
@@ -978,90 +482,71 @@ namespace SecureHelper
///////////////////////////////////////////////////////////////////////////////
-// MinCrtHelper - helper functions for using _ATL_MIN_CRT
+// MinCrtHelper - WTL10 doesn't support _ATL_MIN_CRT,
+// these are here only for compatibility with existing projects
namespace MinCrtHelper
{
inline int _isspace(TCHAR ch)
{
-#ifndef _ATL_MIN_CRT
return _istspace(ch);
-#else // _ATL_MIN_CRT
- WORD type = 0;
- ::GetStringTypeEx(::GetThreadLocale(), CT_CTYPE1, &ch, 1, &type);
- return (type & C1_SPACE) == C1_SPACE;
-#endif // _ATL_MIN_CRT
}
inline int _isdigit(TCHAR ch)
{
-#ifndef _ATL_MIN_CRT
return _istdigit(ch);
-#else // _ATL_MIN_CRT
- WORD type = 0;
- ::GetStringTypeEx(::GetThreadLocale(), CT_CTYPE1, &ch, 1, &type);
- return (type & C1_DIGIT) == C1_DIGIT;
-#endif // _ATL_MIN_CRT
}
inline int _atoi(LPCTSTR str)
{
-#ifndef _ATL_MIN_CRT
return _ttoi(str);
-#else // _ATL_MIN_CRT
- while(_isspace(*str) != 0)
- ++str;
-
- TCHAR ch = *str++;
- TCHAR sign = ch; // save sign indication
- if(ch == _T('-') || ch == _T('+'))
- ch = *str++; // skip sign
-
- int total = 0;
- while(_isdigit(ch) != 0)
- {
- total = 10 * total + (ch - '0'); // accumulate digit
- ch = *str++; // get next char
- }
-
- return (sign == '-') ? -total : total; // return result, negated if necessary
-#endif // _ATL_MIN_CRT
}
inline LPCTSTR _strrchr(LPCTSTR str, TCHAR ch)
{
-#ifndef _ATL_MIN_CRT
return _tcsrchr(str, ch);
-#else // _ATL_MIN_CRT
- LPCTSTR lpsz = NULL;
- while(*str != 0)
- {
- if(*str == ch)
- lpsz = str;
- str = ::CharNext(str);
- }
- return lpsz;
-#endif // _ATL_MIN_CRT
}
inline LPTSTR _strrchr(LPTSTR str, TCHAR ch)
{
-#ifndef _ATL_MIN_CRT
return _tcsrchr(str, ch);
-#else // _ATL_MIN_CRT
- LPTSTR lpsz = NULL;
- while(*str != 0)
- {
- if(*str == ch)
- lpsz = str;
- str = ::CharNext(str);
- }
- return lpsz;
-#endif // _ATL_MIN_CRT
}
}; // namespace MinCrtHelper
+///////////////////////////////////////////////////////////////////////////////
+// GenericWndClass - generic window class usable for subclassing
+
+// Use in dialog templates to specify a placeholder to be subclassed
+// Specify as a custom control with class name WTL_GenericWindow
+// Call Rregister() before creating dialog (for example, in WinMain)
+namespace GenericWndClass
+{
+ inline LPCTSTR GetName()
+ {
+ return _T("WTL_GenericWindow");
+ }
+
+ inline ATOM Register()
+ {
+ WNDCLASSEX wc = { sizeof(WNDCLASSEX) };
+ wc.lpfnWndProc = ::DefWindowProc;
+ wc.hInstance = ModuleHelper::GetModuleInstance();
+ wc.hCursor = ::LoadCursor(NULL, IDC_ARROW);
+ wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
+ wc.lpszClassName = GetName();
+ ATOM atom = ::RegisterClassEx(&wc);
+ ATLASSERT(atom != 0);
+ return atom;
+ }
+
+ inline BOOL Unregister() // only needed for DLLs or tmp use
+ {
+ return ::UnregisterClass(GetName(), ModuleHelper::GetModuleInstance());
+ }
+}; // namespace GenericWndClass
+
+
///////////////////////////////////////////////////////////////////////////////
// CMessageFilter - Interface for message filter support
@@ -1081,12 +566,6 @@ class CIdleHandler
virtual BOOL OnIdle() = 0;
};
-#ifndef _ATL_NO_OLD_NAMES
- // for compatilibility with old names only
- typedef CIdleHandler CUpdateUIObject;
- #define DoUpdate OnIdle
-#endif // !_ATL_NO_OLD_NAMES
-
///////////////////////////////////////////////////////////////////////////////
// CMessageLoop - message loop implementation
@@ -1120,21 +599,6 @@ class CMessageLoop
return m_aIdleHandler.Remove(pIdleHandler);
}
-#ifndef _ATL_NO_OLD_NAMES
- // for compatilibility with old names only
- BOOL AddUpdateUI(CIdleHandler* pIdleHandler)
- {
- ATLTRACE2(atlTraceUI, 0, _T("CUpdateUIObject and AddUpdateUI are deprecated. Please change your code to use CIdleHandler and OnIdle\n"));
- return AddIdleHandler(pIdleHandler);
- }
-
- BOOL RemoveUpdateUI(CIdleHandler* pIdleHandler)
- {
- ATLTRACE2(atlTraceUI, 0, _T("CUpdateUIObject and RemoveUpdateUI are deprecated. Please change your code to use CIdleHandler and OnIdle\n"));
- return RemoveIdleHandler(pIdleHandler);
- }
-#endif // !_ATL_NO_OLD_NAMES
-
// message loop
int Run()
{
@@ -1185,9 +649,7 @@ class CMessageLoop
switch(pMsg->message)
{
case WM_MOUSEMOVE:
-#ifndef _WIN32_WCE
case WM_NCMOUSEMOVE:
-#endif // !_WIN32_WCE
case WM_PAINT:
case 0x0118: // WM_SYSTIMER (caret blink)
return FALSE;
@@ -1204,7 +666,7 @@ class CMessageLoop
for(int i = m_aMsgFilter.GetSize() - 1; i >= 0; i--)
{
CMessageFilter* pMessageFilter = m_aMsgFilter[i];
- if(pMessageFilter != NULL && pMessageFilter->PreTranslateMessage(pMsg))
+ if((pMessageFilter != NULL) && pMessageFilter->PreTranslateMessage(pMsg))
return TRUE;
}
return FALSE; // not translated
@@ -1226,35 +688,24 @@ class CMessageLoop
///////////////////////////////////////////////////////////////////////////////
// CStaticDataInitCriticalSectionLock and CWindowCreateCriticalSectionLock
-// internal classes to manage critical sections for both ATL3 and ATL7
+// internal classes to manage critical sections for ATL (deprecated)
class CStaticDataInitCriticalSectionLock
{
public:
-#if (_ATL_VER >= 0x0700)
ATL::CComCritSecLock m_cslock;
CStaticDataInitCriticalSectionLock() : m_cslock(ATL::_pAtlModule->m_csStaticDataInitAndTypeInfo, false)
{ }
-#endif // (_ATL_VER >= 0x0700)
HRESULT Lock()
{
-#if (_ATL_VER >= 0x0700)
return m_cslock.Lock();
-#else // !(_ATL_VER >= 0x0700)
- ::EnterCriticalSection(&ATL::_pModule->m_csStaticDataInit);
- return S_OK;
-#endif // !(_ATL_VER >= 0x0700)
}
void Unlock()
{
-#if (_ATL_VER >= 0x0700)
m_cslock.Unlock();
-#else // !(_ATL_VER >= 0x0700)
- ::LeaveCriticalSection(&ATL::_pModule->m_csStaticDataInit);
-#endif // !(_ATL_VER >= 0x0700)
}
};
@@ -1262,117 +713,32 @@ class CStaticDataInitCriticalSectionLock
class CWindowCreateCriticalSectionLock
{
public:
-#if (_ATL_VER >= 0x0700)
ATL::CComCritSecLock m_cslock;
CWindowCreateCriticalSectionLock() : m_cslock(ATL::_AtlWinModule.m_csWindowCreate, false)
{ }
-#endif // (_ATL_VER >= 0x0700)
HRESULT Lock()
{
-#if (_ATL_VER >= 0x0700)
return m_cslock.Lock();
-#else // !(_ATL_VER >= 0x0700)
- ::EnterCriticalSection(&ATL::_pModule->m_csWindowCreate);
- return S_OK;
-#endif // !(_ATL_VER >= 0x0700)
}
void Unlock()
{
-#if (_ATL_VER >= 0x0700)
m_cslock.Unlock();
-#else // !(_ATL_VER >= 0x0700)
- ::LeaveCriticalSection(&ATL::_pModule->m_csWindowCreate);
-#endif // !(_ATL_VER >= 0x0700)
}
};
///////////////////////////////////////////////////////////////////////////////
-// CTempBuffer - helper class for stack allocations for ATL3
-
-#ifndef _WTL_STACK_ALLOC_THRESHOLD
- #define _WTL_STACK_ALLOC_THRESHOLD 512
-#endif
-
-#if (_ATL_VER >= 0x0700)
-
-using ATL::CTempBuffer;
-
-#else // !(_ATL_VER >= 0x0700)
+// CAppModule - module class for an application
-#ifndef SIZE_MAX
- #ifdef _WIN64
- #define SIZE_MAX _UI64_MAX
- #else
- #define SIZE_MAX UINT_MAX
- #endif
+#if (_MSC_VER == 1400) // VS2005
+ #pragma warning(push)
+ #pragma warning(disable : 4244)
+ #pragma warning(disable : 4312)
#endif
-#pragma warning(disable: 4284) // warning for operator ->
-
-template
-class CTempBuffer
-{
-public:
- CTempBuffer() : m_p(NULL)
- {
- }
-
- CTempBuffer(size_t nElements) : m_p(NULL)
- {
- Allocate(nElements);
- }
-
- ~CTempBuffer()
- {
- if(m_p != reinterpret_cast(m_abFixedBuffer))
- free(m_p);
- }
-
- operator T*() const
- {
- return m_p;
- }
-
- T* operator ->() const
- {
- ATLASSERT(m_p != NULL);
- return m_p;
- }
-
- T* Allocate(size_t nElements)
- {
- ATLASSERT(nElements <= (SIZE_MAX / sizeof(T)));
- return AllocateBytes(nElements * sizeof(T));
- }
-
- T* AllocateBytes(size_t nBytes)
- {
- ATLASSERT(m_p == NULL);
- if(nBytes > t_nFixedBytes)
- m_p = static_cast(malloc(nBytes));
- else
- m_p = reinterpret_cast(m_abFixedBuffer);
-
- return m_p;
- }
-
-private:
- T* m_p;
- BYTE m_abFixedBuffer[t_nFixedBytes];
-};
-
-#pragma warning(default: 4284)
-
-#endif // !(_ATL_VER >= 0x0700)
-
-
-///////////////////////////////////////////////////////////////////////////////
-// CAppModule - module class for an application
-
class CAppModule : public ATL::CComModule
{
public:
@@ -1480,7 +846,7 @@ class CAppModule : public ATL::CComModule
}
BOOL bRet = (m_pSettingChangeNotify != NULL);
- if(bRet && m_pSettingChangeNotify->GetSize() == 0)
+ if(bRet && (m_pSettingChangeNotify->GetSize() == 0))
{
// init everything
_ATL_EMPTY_DLGTEMPLATE templ;
@@ -1488,12 +854,7 @@ class CAppModule : public ATL::CComModule
ATLASSERT(::IsWindow(hNtfWnd));
if(::IsWindow(hNtfWnd))
{
-// need conditional code because types don't match in winuser.h
-#ifdef _WIN64
::SetWindowLongPtr(hNtfWnd, GWLP_USERDATA, (LONG_PTR)this);
-#else
- ::SetWindowLongPtr(hNtfWnd, GWLP_USERDATA, PtrToLong(this));
-#endif
bRet = m_pSettingChangeNotify->Add(hNtfWnd);
}
else
@@ -1517,7 +878,7 @@ class CAppModule : public ATL::CComModule
return;
}
- if(m_pSettingChangeNotify != NULL && m_pSettingChangeNotify->GetSize() > 0)
+ if((m_pSettingChangeNotify != NULL) && (m_pSettingChangeNotify->GetSize() > 0))
::DestroyWindow((*m_pSettingChangeNotify)[0]);
delete m_pSettingChangeNotify;
m_pSettingChangeNotify = NULL;
@@ -1575,40 +936,28 @@ class CAppModule : public ATL::CComModule
WORD wMenu, wClass, wTitle;
};
-#ifdef _WIN64
static INT_PTR CALLBACK _SettingChangeDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
-#else
- static BOOL CALLBACK _SettingChangeDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
-#endif
{
if(uMsg == WM_SETTINGCHANGE)
{
-// need conditional code because types don't match in winuser.h
-#ifdef _WIN64
CAppModule* pModule = (CAppModule*)::GetWindowLongPtr(hWnd, GWLP_USERDATA);
-#else
- CAppModule* pModule = (CAppModule*)LongToPtr(::GetWindowLongPtr(hWnd, GWLP_USERDATA));
-#endif
ATLASSERT(pModule != NULL);
ATLASSERT(pModule->m_pSettingChangeNotify != NULL);
const UINT uTimeout = 1500; // ms
for(int i = 1; i < pModule->m_pSettingChangeNotify->GetSize(); i++)
- {
-#if !defined(_WIN32_WCE)
::SendMessageTimeout((*pModule->m_pSettingChangeNotify)[i], uMsg, wParam, lParam, SMTO_ABORTIFHUNG, uTimeout, NULL);
-#elif(_WIN32_WCE >= 400) // CE specific
- ::SendMessageTimeout((*pModule->m_pSettingChangeNotify)[i], uMsg, wParam, lParam, SMTO_NORMAL, uTimeout, NULL);
-#else // _WIN32_WCE < 400 specific
- uTimeout;
- ::SendMessage((*pModule->m_pSettingChangeNotify)[i], uMsg, wParam, lParam);
-#endif
- }
+
return TRUE;
}
+
return FALSE;
}
};
+#if (_MSC_VER == 1400) // VS2005
+ #pragma warning(pop)
+#endif
+
///////////////////////////////////////////////////////////////////////////////
// CServerAppModule - module class for a COM server application
@@ -1631,13 +980,13 @@ class CServerAppModule : public CAppModule
void Term()
{
- if(m_hEventShutdown != NULL && ::CloseHandle(m_hEventShutdown))
+ if((m_hEventShutdown != NULL) && ::CloseHandle(m_hEventShutdown))
m_hEventShutdown = NULL;
CAppModule::Term();
}
// COM Server methods
- LONG Unlock()
+ LONG Unlock() throw()
{
LONG lRet = CComModule::Unlock();
if(lRet == 0)
@@ -1661,11 +1010,11 @@ class CServerAppModule : public CAppModule
}
while(dwWait == WAIT_OBJECT_0);
// timed out
- if(!m_bActivity && m_nLockCnt == 0) // if no activity let's really bail
+ if(!m_bActivity && (m_nLockCnt == 0)) // if no activity let's really bail
{
-#if ((_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM)) && defined(_ATL_FREE_THREADED) && !defined(_WIN32_WCE)
+#if defined(_WIN32_DCOM) && defined(_ATL_FREE_THREADED)
::CoSuspendClassObjects();
- if(!m_bActivity && m_nLockCnt == 0)
+ if(!m_bActivity && (m_nLockCnt == 0))
#endif
break;
}
@@ -1683,7 +1032,7 @@ class CServerAppModule : public CAppModule
if(m_hEventShutdown == NULL)
return false;
DWORD dwThreadID = 0;
-#if !defined(_ATL_MIN_CRT) && defined(_MT) && !defined(_WIN32_WCE)
+#ifdef _MT
HANDLE hThread = (HANDLE)_beginthreadex(NULL, 0, (UINT (WINAPI*)(void*))MonitorProc, this, 0, (UINT*)&dwThreadID);
#else
HANDLE hThread = ::CreateThread(NULL, 0, MonitorProc, this, 0, &dwThreadID);
@@ -1700,320 +1049,35 @@ class CServerAppModule : public CAppModule
p->MonitorShutdown();
return 0;
}
-
-#if (_ATL_VER < 0x0700)
- // search for an occurence of string p2 in string p1
- static LPCTSTR FindOneOf(LPCTSTR p1, LPCTSTR p2)
- {
- while(p1 != NULL && *p1 != NULL)
- {
- LPCTSTR p = p2;
- while(p != NULL && *p != NULL)
- {
- if(*p1 == *p)
- return ::CharNext(p1);
- p = ::CharNext(p);
- }
- p1 = ::CharNext(p1);
- }
- return NULL;
- }
-#endif // (_ATL_VER < 0x0700)
};
///////////////////////////////////////////////////////////////////////////////
-// CRegKeyEx - adds type-specific methods to ATL3 CRegKey
-
-#if (_ATL_VER < 0x0700)
-
-class CRegKeyEx : public ATL::CRegKey
-{
-public:
-// Constructors and operators
- CRegKeyEx(HKEY hKey = NULL)
- {
- m_hKey = hKey;
- }
-
- CRegKeyEx(CRegKeyEx& key)
- {
- Attach(key.Detach());
- }
-
- CRegKeyEx& operator =(CRegKeyEx& key)
- {
- Close();
- Attach(key.Detach());
- return *this;
- }
-
-// Methods
- LONG SetValue(LPCTSTR pszValueName, DWORD dwType, const void* pValue, ULONG nBytes)
- {
- ATLASSERT(m_hKey != NULL);
- return ::RegSetValueEx(m_hKey, pszValueName, NULL, dwType, static_cast(pValue), nBytes);
- }
-
- LONG SetGUIDValue(LPCTSTR pszValueName, REFGUID guidValue)
- {
- ATLASSERT(m_hKey != NULL);
-
- OLECHAR szGUID[64] = { 0 };
- ::StringFromGUID2(guidValue, szGUID, 64);
-
- USES_CONVERSION;
- LPCTSTR lpstr = OLE2CT(szGUID);
-#ifndef _UNICODE
- if(lpstr == NULL)
- return E_OUTOFMEMORY;
-#endif
- return SetStringValue(pszValueName, lpstr);
- }
-
- LONG SetBinaryValue(LPCTSTR pszValueName, const void* pValue, ULONG nBytes)
- {
- ATLASSERT(m_hKey != NULL);
- return ::RegSetValueEx(m_hKey, pszValueName, NULL, REG_BINARY, reinterpret_cast(pValue), nBytes);
- }
-
- LONG SetDWORDValue(LPCTSTR pszValueName, DWORD dwValue)
- {
- ATLASSERT(m_hKey != NULL);
- return ::RegSetValueEx(m_hKey, pszValueName, NULL, REG_DWORD, reinterpret_cast(&dwValue), sizeof(DWORD));
- }
-
-#ifndef _WIN32_WCE
- LONG SetQWORDValue(LPCTSTR pszValueName, ULONGLONG qwValue)
- {
- ATLASSERT(m_hKey != NULL);
- return ::RegSetValueEx(m_hKey, pszValueName, NULL, REG_QWORD, reinterpret_cast(&qwValue), sizeof(ULONGLONG));
- }
-#endif
-
- LONG SetStringValue(LPCTSTR pszValueName, LPCTSTR pszValue, DWORD dwType = REG_SZ)
- {
- ATLASSERT(m_hKey != NULL);
- if(pszValue == NULL)
- {
- ATLASSERT(FALSE);
- return ERROR_INVALID_DATA;
- }
- ATLASSERT((dwType == REG_SZ) || (dwType == REG_EXPAND_SZ));
-
- return ::RegSetValueEx(m_hKey, pszValueName, NULL, dwType, reinterpret_cast(pszValue), (lstrlen(pszValue) + 1) * sizeof(TCHAR));
- }
-
- LONG SetMultiStringValue(LPCTSTR pszValueName, LPCTSTR pszValue)
- {
- ATLASSERT(m_hKey != NULL);
- if(pszValue == NULL)
- {
- ATLASSERT(FALSE);
- return ERROR_INVALID_DATA;
- }
-
- ULONG nBytes = 0;
- ULONG nLength = 0;
- LPCTSTR pszTemp = pszValue;
- do
- {
- nLength = lstrlen(pszTemp) + 1;
- pszTemp += nLength;
- nBytes += nLength * sizeof(TCHAR);
- } while (nLength != 1);
-
- return ::RegSetValueEx(m_hKey, pszValueName, NULL, REG_MULTI_SZ, reinterpret_cast(pszValue), nBytes);
- }
-
- LONG QueryValue(LPCTSTR pszValueName, DWORD* pdwType, void* pData, ULONG* pnBytes)
- {
- ATLASSERT(m_hKey != NULL);
- return ::RegQueryValueEx(m_hKey, pszValueName, NULL, pdwType, static_cast(pData), pnBytes);
- }
-
- LONG QueryGUIDValue(LPCTSTR pszValueName, GUID& guidValue)
- {
- ATLASSERT(m_hKey != NULL);
-
- guidValue = GUID_NULL;
-
- TCHAR szGUID[64] = { 0 };
- ULONG nCount = 64;
- LONG lRes = QueryStringValue(pszValueName, szGUID, &nCount);
-
- if (lRes != ERROR_SUCCESS)
- return lRes;
-
- if(szGUID[0] != _T('{'))
- return ERROR_INVALID_DATA;
-
- USES_CONVERSION;
- LPOLESTR lpstr = T2OLE(szGUID);
-#ifndef _UNICODE
- if(lpstr == NULL)
- return E_OUTOFMEMORY;
-#endif
-
- HRESULT hr = ::CLSIDFromString(lpstr, &guidValue);
- if (FAILED(hr))
- return ERROR_INVALID_DATA;
-
- return ERROR_SUCCESS;
- }
-
- LONG QueryBinaryValue(LPCTSTR pszValueName, void* pValue, ULONG* pnBytes)
- {
- ATLASSERT(pnBytes != NULL);
- ATLASSERT(m_hKey != NULL);
-
- DWORD dwType = 0;
- LONG lRes = ::RegQueryValueEx(m_hKey, pszValueName, NULL, &dwType, reinterpret_cast(pValue), pnBytes);
- if (lRes != ERROR_SUCCESS)
- return lRes;
- if (dwType != REG_BINARY)
- return ERROR_INVALID_DATA;
-
- return ERROR_SUCCESS;
- }
-
- LONG QueryDWORDValue(LPCTSTR pszValueName, DWORD& dwValue)
- {
- ATLASSERT(m_hKey != NULL);
-
- ULONG nBytes = sizeof(DWORD);
- DWORD dwType = 0;
- LONG lRes = ::RegQueryValueEx(m_hKey, pszValueName, NULL, &dwType, reinterpret_cast(&dwValue), &nBytes);
- if (lRes != ERROR_SUCCESS)
- return lRes;
- if (dwType != REG_DWORD)
- return ERROR_INVALID_DATA;
-
- return ERROR_SUCCESS;
- }
-
- LONG QueryQWORDValue(LPCTSTR pszValueName, ULONGLONG& qwValue)
- {
- ATLASSERT(m_hKey != NULL);
-
- ULONG nBytes = sizeof(ULONGLONG);
- DWORD dwType = 0;
- LONG lRes = ::RegQueryValueEx(m_hKey, pszValueName, NULL, &dwType, reinterpret_cast(&qwValue), &nBytes);
- if (lRes != ERROR_SUCCESS)
- return lRes;
- if (dwType != REG_QWORD)
- return ERROR_INVALID_DATA;
-
- return ERROR_SUCCESS;
- }
-
- LONG QueryStringValue(LPCTSTR pszValueName, LPTSTR pszValue, ULONG* pnChars)
- {
- ATLASSERT(m_hKey != NULL);
- ATLASSERT(pnChars != NULL);
-
- ULONG nBytes = (*pnChars) * sizeof(TCHAR);
- DWORD dwType = 0;
- *pnChars = 0;
- LONG lRes = ::RegQueryValueEx(m_hKey, pszValueName, NULL, &dwType, reinterpret_cast(pszValue), &nBytes);
-
- if (lRes != ERROR_SUCCESS)
- {
- return lRes;
- }
-
- if(dwType != REG_SZ && dwType != REG_EXPAND_SZ)
- {
- return ERROR_INVALID_DATA;
- }
-
- if (pszValue != NULL)
- {
- if(nBytes != 0)
- {
- if ((nBytes % sizeof(TCHAR) != 0) || (pszValue[nBytes / sizeof(TCHAR) -1] != 0))
- return ERROR_INVALID_DATA;
- }
- else
- {
- pszValue[0] = _T('\0');
- }
- }
-
- *pnChars = nBytes / sizeof(TCHAR);
-
- return ERROR_SUCCESS;
- }
-
- LONG QueryMultiStringValue(LPCTSTR pszValueName, LPTSTR pszValue, ULONG* pnChars)
- {
- ATLASSERT(m_hKey != NULL);
- ATLASSERT(pnChars != NULL);
-
- if (pszValue != NULL && *pnChars < 2)
- return ERROR_INSUFFICIENT_BUFFER;
-
- ULONG nBytes = (*pnChars) * sizeof(TCHAR);
- DWORD dwType = 0;
- *pnChars = 0;
- LONG lRes = ::RegQueryValueEx(m_hKey, pszValueName, NULL, &dwType, reinterpret_cast(pszValue), &nBytes);
- if (lRes != ERROR_SUCCESS)
- return lRes;
- if (dwType != REG_MULTI_SZ)
- return ERROR_INVALID_DATA;
- if (pszValue != NULL && (nBytes % sizeof(TCHAR) != 0 || nBytes / sizeof(TCHAR) < 1 || pszValue[nBytes / sizeof(TCHAR) - 1] != 0 || ((nBytes / sizeof(TCHAR)) > 1 && pszValue[nBytes / sizeof(TCHAR) - 2] != 0)))
- return ERROR_INVALID_DATA;
-
- *pnChars = nBytes / sizeof(TCHAR);
-
- return ERROR_SUCCESS;
- }
-};
-
-#else // !(_ATL_VER < 0x0700)
+// CRegKeyEx - not used any more, here only for compatibility with old projects
typedef ATL::CRegKey CRegKeyEx;
-#endif // !(_ATL_VER < 0x0700)
+}; // namespace WTL
///////////////////////////////////////////////////////////////////////////////
// CString forward reference (enables CString use in atluser.h and atlgdi.h)
-#if defined(_WTL_FORWARD_DECLARE_CSTRING) && !defined(_WTL_USE_CSTRING)
- #define _WTL_USE_CSTRING
-#endif // defined(_WTL_FORWARD_DECLARE_CSTRING) && !defined(_WTL_USE_CSTRING)
-
-#ifdef _WTL_USE_CSTRING
- class CString; // forward declaration (include atlmisc.h for the whole class)
-#endif // _WTL_USE_CSTRING
+#if (defined(_WTL_USE_CSTRING) || defined(_WTL_FORWARD_DECLARE_CSTRING)) && !defined(__ATLSTR_H__)
+ #include
+#endif
// CString namespace
-#ifndef _CSTRING_NS
- #ifdef __ATLSTR_H__
- #define _CSTRING_NS ATL
- #else
- #define _CSTRING_NS WTL
- #endif
-#endif // _CSTRING_NS
+#define _CSTRING_NS ATL
// Type classes namespace
-#ifndef _WTYPES_NS
- #ifdef __ATLTYPES_H__
- #define _WTYPES_NS
- #else
- #define _WTYPES_NS WTL
- #endif
-#endif // _WTYPES_NS
-
-}; // namespace WTL
+#define _WTYPES_NS
///////////////////////////////////////////////////////////////////////////////
-// General DLL version helpers
-// (ATL3: excluded from atlbase.h if _ATL_DLL is defined; ATL11: removed)
+// General DLL version helpers (removed in ATL11)
-#if (((_ATL_VER < 0x0700) && defined(_ATL_DLL)) || (_ATL_VER >= 0x0B00)) && !defined(_WIN32_WCE)
+#if (_ATL_VER >= 0x0B00)
namespace ATL
{
@@ -2048,8 +1112,8 @@ inline HRESULT AtlGetDllVersion(LPCTSTR lpstrDllName, DLLVERSIONINFO* pDllVersio
// IE 4.0 maj=4 min=71
inline HRESULT AtlGetCommCtrlVersion(LPDWORD pdwMajor, LPDWORD pdwMinor)
{
- ATLASSERT(pdwMajor != NULL && pdwMinor != NULL);
- if(pdwMajor == NULL || pdwMinor == NULL)
+ ATLASSERT((pdwMajor != NULL) && (pdwMinor != NULL));
+ if((pdwMajor == NULL) || (pdwMinor == NULL))
return E_INVALIDARG;
DLLVERSIONINFO dvi;
@@ -2081,8 +1145,8 @@ inline HRESULT AtlGetCommCtrlVersion(LPDWORD pdwMajor, LPDWORD pdwMinor)
// IE 4.01 with Web Integrated Desktop maj=4 min=72
inline HRESULT AtlGetShellVersion(LPDWORD pdwMajor, LPDWORD pdwMinor)
{
- ATLASSERT(pdwMajor != NULL && pdwMinor != NULL);
- if(pdwMajor == NULL || pdwMinor == NULL)
+ ATLASSERT((pdwMajor != NULL) && (pdwMinor != NULL));
+ if((pdwMajor == NULL) || (pdwMinor == NULL))
return E_INVALIDARG;
DLLVERSIONINFO dvi;
@@ -2109,7 +1173,7 @@ inline HRESULT AtlGetShellVersion(LPDWORD pdwMajor, LPDWORD pdwMinor)
}; // namespace ATL
-#endif // (_ATL_VER < 0x0700) && defined(_ATL_DLL) && !defined(_WIN32_WCE)
+#endif // (_ATL_VER >= 0x0B00)
// These are always included
diff --git a/thirdparty/wtl/atlcrack.h b/thirdparty/wtl/atlcrack.h
index 7f4a2ba..5053250 100644
--- a/thirdparty/wtl/atlcrack.h
+++ b/thirdparty/wtl/atlcrack.h
@@ -1,13 +1,10 @@
-// Windows Template Library - WTL version 8.1
-// Copyright (C) Microsoft Corporation. All rights reserved.
+// Windows Template Library - WTL version 10.0
+// Copyright (C) Microsoft Corporation, WTL Team. 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/cpl1.0.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.
+// Microsoft Public License (http://opensource.org/licenses/MS-PL)
+// which can be found in the file MS-PL.txt at the root folder.
#ifndef __ATLCRACK_H__
#define __ATLCRACK_H__
@@ -49,12 +46,12 @@ public: \
BOOL _ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lResult, DWORD dwMsgMapID) \
{ \
BOOL bHandled = TRUE; \
- hWnd; \
- uMsg; \
- wParam; \
- lParam; \
- lResult; \
- bHandled; \
+ (hWnd); \
+ (uMsg); \
+ (wParam); \
+ (lParam); \
+ (lResult); \
+ (bHandled); \
switch(dwMsgMapID) \
{ \
case 0:
@@ -109,7 +106,7 @@ public: \
if (uMsg == WM_MOVE) \
{ \
SetMsgHandled(TRUE); \
- func(_WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func(::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -120,7 +117,7 @@ public: \
if (uMsg == WM_SIZE) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -565,7 +562,7 @@ public: \
if (uMsg == WM_NCHITTEST) \
{ \
SetMsgHandled(TRUE); \
- lResult = (LRESULT)func(_WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ lResult = (LRESULT)func(::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
if(IsMsgHandled()) \
return TRUE; \
}
@@ -606,7 +603,7 @@ public: \
if (uMsg == WM_NCMOUSEMOVE) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -617,7 +614,7 @@ public: \
if (uMsg == WM_NCLBUTTONDOWN) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -628,7 +625,7 @@ public: \
if (uMsg == WM_NCLBUTTONUP) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -639,7 +636,7 @@ public: \
if (uMsg == WM_NCLBUTTONDBLCLK) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -650,7 +647,7 @@ public: \
if (uMsg == WM_NCRBUTTONDOWN) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -661,7 +658,7 @@ public: \
if (uMsg == WM_NCRBUTTONUP) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -672,7 +669,7 @@ public: \
if (uMsg == WM_NCRBUTTONDBLCLK) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -683,7 +680,7 @@ public: \
if (uMsg == WM_NCMBUTTONDOWN) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -694,7 +691,7 @@ public: \
if (uMsg == WM_NCMBUTTONUP) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -705,7 +702,7 @@ public: \
if (uMsg == WM_NCMBUTTONDBLCLK) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -716,7 +713,7 @@ public: \
if (uMsg == WM_KEYDOWN) \
{ \
SetMsgHandled(TRUE); \
- func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \
+ func((UINT)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -727,13 +724,13 @@ public: \
if (uMsg == WM_KEYUP) \
{ \
SetMsgHandled(TRUE); \
- func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \
+ func((UINT)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
}
-// void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
+// void OnChar(TCHAR chChar, UINT nRepCnt, UINT nFlags)
#define MSG_WM_CHAR(func) \
if (uMsg == WM_CHAR) \
{ \
@@ -744,7 +741,7 @@ public: \
return TRUE; \
}
-// void OnDeadChar(UINT nChar, UINT nRepCnt, UINT nFlags)
+// void OnDeadChar(TCHAR chChar, UINT nRepCnt, UINT nFlags)
#define MSG_WM_DEADCHAR(func) \
if (uMsg == WM_DEADCHAR) \
{ \
@@ -760,7 +757,7 @@ public: \
if (uMsg == WM_SYSKEYDOWN) \
{ \
SetMsgHandled(TRUE); \
- func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \
+ func((UINT)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -771,13 +768,13 @@ public: \
if (uMsg == WM_SYSKEYUP) \
{ \
SetMsgHandled(TRUE); \
- func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \
+ func((UINT)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
}
-// void OnSysChar(UINT nChar, UINT nRepCnt, UINT nFlags)
+// void OnSysChar(TCHAR chChar, UINT nRepCnt, UINT nFlags)
#define MSG_WM_SYSCHAR(func) \
if (uMsg == WM_SYSCHAR) \
{ \
@@ -788,7 +785,7 @@ public: \
return TRUE; \
}
-// void OnSysDeadChar(UINT nChar, UINT nRepCnt, UINT nFlags)
+// void OnSysDeadChar(TCHAR chChar, UINT nRepCnt, UINT nFlags)
#define MSG_WM_SYSDEADCHAR(func) \
if (uMsg == WM_SYSDEADCHAR) \
{ \
@@ -804,7 +801,7 @@ public: \
if (uMsg == WM_SYSCOMMAND) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -923,7 +920,7 @@ public: \
if (uMsg == WM_MOUSEMOVE) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -934,7 +931,7 @@ public: \
if (uMsg == WM_MOUSEWHEEL) \
{ \
SetMsgHandled(TRUE); \
- lResult = (LRESULT)func((UINT)LOWORD(wParam), (short)HIWORD(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ lResult = (LRESULT)func((UINT)LOWORD(wParam), (short)HIWORD(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
if(IsMsgHandled()) \
return TRUE; \
}
@@ -944,7 +941,7 @@ public: \
if (uMsg == WM_LBUTTONDOWN) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -955,7 +952,7 @@ public: \
if (uMsg == WM_LBUTTONUP) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -966,7 +963,7 @@ public: \
if (uMsg == WM_LBUTTONDBLCLK) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -977,7 +974,7 @@ public: \
if (uMsg == WM_RBUTTONDOWN) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -988,7 +985,7 @@ public: \
if (uMsg == WM_RBUTTONUP) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -999,7 +996,7 @@ public: \
if (uMsg == WM_RBUTTONDBLCLK) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -1010,7 +1007,7 @@ public: \
if (uMsg == WM_MBUTTONDOWN) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -1021,7 +1018,7 @@ public: \
if (uMsg == WM_MBUTTONUP) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -1032,7 +1029,7 @@ public: \
if (uMsg == WM_MBUTTONDBLCLK) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -1132,7 +1129,7 @@ public: \
if (uMsg == WM_CONTEXTMENU) \
{ \
SetMsgHandled(TRUE); \
- func((HWND)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((HWND)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -1155,7 +1152,7 @@ public: \
if (uMsg == WM_ASKCBFORMATNAME) \
{ \
SetMsgHandled(TRUE); \
- func((DWORD)wParam, (LPTSTR)lParam); \
+ func((UINT)wParam, (LPTSTR)lParam); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -1325,12 +1322,12 @@ public: \
return TRUE; \
}
-// BOOL OnDeviceChange(UINT nEventType, DWORD dwData)
+// BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData)
#define MSG_WM_DEVICECHANGE(func) \
if (uMsg == WM_DEVICECHANGE) \
{ \
SetMsgHandled(TRUE); \
- lResult = (LRESULT)func((UINT)wParam, (DWORD)lParam); \
+ lResult = (LRESULT)func((UINT)wParam, (DWORD_PTR)lParam); \
if(IsMsgHandled()) \
return TRUE; \
}
@@ -1351,7 +1348,7 @@ public: \
if (uMsg == WM_DISPLAYCHANGE) \
{ \
SetMsgHandled(TRUE); \
- func((UINT)wParam, _WTYPES_NS::CSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func((UINT)wParam, ::CSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -1505,12 +1502,12 @@ public: \
return TRUE; \
}
-// BOOL OnPowerBroadcast(DWORD dwPowerEvent, DWORD dwData)
+// BOOL OnPowerBroadcast(DWORD dwPowerEvent, DWORD_PTR dwData)
#define MSG_WM_POWERBROADCAST(func) \
if (uMsg == WM_POWERBROADCAST) \
{ \
SetMsgHandled(TRUE); \
- lResult = (LRESULT)func((DWORD)wParam, (DWORD)lParam); \
+ lResult = (LRESULT)func((DWORD)wParam, (DWORD_PTR)lParam); \
if(IsMsgHandled()) \
return TRUE; \
}
@@ -1612,16 +1609,14 @@ public: \
}
///////////////////////////////////////////////////////////////////////////////
-// New NT4 & NT5 messages
-
-#if(_WIN32_WINNT >= 0x0400)
+// Newer Windows messages
// void OnMouseHover(WPARAM wParam, CPoint ptPos)
#define MSG_WM_MOUSEHOVER(func) \
if (uMsg == WM_MOUSEHOVER) \
{ \
SetMsgHandled(TRUE); \
- func(wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ func(wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
@@ -1638,10 +1633,6 @@ public: \
return TRUE; \
}
-#endif /* _WIN32_WINNT >= 0x0400 */
-
-#if(WINVER >= 0x0500)
-
// void OnMenuRButtonUp(WPARAM wParam, CMenuHandle menu)
#define MSG_WM_MENURBUTTONUP(func) \
if (uMsg == WM_MENURBUTTONUP) \
@@ -1695,10 +1686,6 @@ public: \
return TRUE; \
}
-#endif /* WINVER >= 0x0500 */
-
-#if(_WIN32_WINNT >= 0x0500)
-
// BOOL OnAppCommand(CWindow wndFocus, short cmd, WORD uDevice, int dwKeys)
#define MSG_WM_APPCOMMAND(func) \
if (uMsg == WM_APPCOMMAND) \
@@ -1714,8 +1701,8 @@ public: \
if (uMsg == WM_NCXBUTTONDOWN) \
{ \
SetMsgHandled(TRUE); \
- func(GET_XBUTTON_WPARAM(wParam), GET_NCHITTEST_WPARAM(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
- lResult = 0; \
+ func(GET_XBUTTON_WPARAM(wParam), GET_NCHITTEST_WPARAM(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ lResult = (LRESULT)TRUE; \
if(IsMsgHandled()) \
return TRUE; \
}
@@ -1725,8 +1712,8 @@ public: \
if (uMsg == WM_NCXBUTTONUP) \
{ \
SetMsgHandled(TRUE); \
- func(GET_XBUTTON_WPARAM(wParam), GET_NCHITTEST_WPARAM(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
- lResult = 0; \
+ func(GET_XBUTTON_WPARAM(wParam), GET_NCHITTEST_WPARAM(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ lResult = (LRESULT)TRUE; \
if(IsMsgHandled()) \
return TRUE; \
}
@@ -1736,8 +1723,8 @@ public: \
if (uMsg == WM_NCXBUTTONDBLCLK) \
{ \
SetMsgHandled(TRUE); \
- func(GET_XBUTTON_WPARAM(wParam), GET_NCHITTEST_WPARAM(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
- lResult = 0; \
+ func(GET_XBUTTON_WPARAM(wParam), GET_NCHITTEST_WPARAM(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ lResult = (LRESULT)TRUE; \
if(IsMsgHandled()) \
return TRUE; \
}
@@ -1747,8 +1734,8 @@ public: \
if (uMsg == WM_XBUTTONDOWN) \
{ \
SetMsgHandled(TRUE); \
- func(GET_XBUTTON_WPARAM(wParam), GET_KEYSTATE_WPARAM(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
- lResult = 0; \
+ func(GET_XBUTTON_WPARAM(wParam), GET_KEYSTATE_WPARAM(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ lResult = (LRESULT)TRUE; \
if(IsMsgHandled()) \
return TRUE; \
}
@@ -1758,8 +1745,8 @@ public: \
if (uMsg == WM_XBUTTONUP) \
{ \
SetMsgHandled(TRUE); \
- func(GET_XBUTTON_WPARAM(wParam), GET_KEYSTATE_WPARAM(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
- lResult = 0; \
+ func(GET_XBUTTON_WPARAM(wParam), GET_KEYSTATE_WPARAM(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ lResult = (LRESULT)TRUE; \
if(IsMsgHandled()) \
return TRUE; \
}
@@ -1769,8 +1756,8 @@ public: \
if (uMsg == WM_XBUTTONDBLCLK) \
{ \
SetMsgHandled(TRUE); \
- func(GET_XBUTTON_WPARAM(wParam), GET_KEYSTATE_WPARAM(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
- lResult = 0; \
+ func(GET_XBUTTON_WPARAM(wParam), GET_KEYSTATE_WPARAM(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ lResult = (LRESULT)TRUE; \
if(IsMsgHandled()) \
return TRUE; \
}
@@ -1807,10 +1794,6 @@ public: \
return TRUE; \
}
-#endif // (_WIN32_WINNT >= 0x0500)
-
-#if(_WIN32_WINNT >= 0x0501)
-
// void OnInput(WPARAM RawInputCode, HRAWINPUT hRawInput)
#define MSG_WM_INPUT(func) \
if (uMsg == WM_INPUT) \
@@ -1846,7 +1829,7 @@ public: \
return TRUE; \
}
-// OnThemeChanged()
+// void OnThemeChanged()
#define MSG_WM_THEMECHANGED(func) \
if (uMsg == WM_THEMECHANGED) \
{ \
@@ -1857,7 +1840,52 @@ public: \
return TRUE; \
}
-#endif /* _WIN32_WINNT >= 0x0501 */
+#if (_WIN32_WINNT >= 0x0600)
+
+// BOOL OnMouseHWheel(UINT nFlags, short zDelta, CPoint pt)
+#define MSG_WM_MOUSEHWHEEL(func) \
+ if (uMsg == WM_MOUSEHWHEEL) \
+ { \
+ SetMsgHandled(TRUE); \
+ lResult = (LRESULT)func((UINT)LOWORD(wParam), (short)HIWORD(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \
+ if(IsMsgHandled()) \
+ return TRUE; \
+ }
+
+#endif // (_WIN32_WINNT >= 0x0600)
+
+#if (WINVER >= 0x0601)
+
+// void OnGesture(ULONGLONG ullArguments, HGESTUREINFO hGestureInfo)
+#define MSG_WM_GESTURE(func) \
+ if (uMsg == WM_GESTURE) \
+ { \
+ SetMsgHandled(TRUE); \
+ func((ULONGLONG)wParam, (HGESTUREINFO)lParam); \
+ lResult = 0; \
+ if(IsMsgHandled()) \
+ return TRUE; \
+ }
+
+// void OnGestureNotify(PGESTURENOTIFYSTRUCT pGestureNotifyStruct)
+#define MSG_WM_GESTURENOTIFY(func) \
+ if (uMsg == WM_GESTURENOTIFY) \
+ { \
+ func((PGESTURENOTIFYSTRUCT)lParam); \
+ }
+
+// void OnDpiChanged(UINT nDpiX, UINT nDpiY, PRECT pRect)
+#define MSG_WM_DPICHANGED(func) \
+ if (uMsg == WM_DPICHANGED) \
+ { \
+ SetMsgHandled(TRUE); \
+ func((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (PRECT)lParam); \
+ lResult = 0; \
+ if(IsMsgHandled()) \
+ return TRUE; \
+ }
+
+#endif // (WINVER >= 0x0601)
///////////////////////////////////////////////////////////////////////////////
// ATL defined messages
@@ -2160,7 +2188,7 @@ public: \
// LRESULT OnMessageRangeHandlerEX(UINT uMsg, WPARAM wParam, LPARAM lParam)
#define MESSAGE_RANGE_HANDLER_EX(msgFirst, msgLast, func) \
- if(uMsg >= msgFirst && uMsg <= msgLast) \
+ if((uMsg >= msgFirst) && (uMsg <= msgLast)) \
{ \
SetMsgHandled(TRUE); \
lResult = func(uMsg, wParam, lParam); \
@@ -2173,7 +2201,7 @@ public: \
// void OnCommandHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)
#define COMMAND_HANDLER_EX(id, code, func) \
- if (uMsg == WM_COMMAND && code == HIWORD(wParam) && id == LOWORD(wParam)) \
+ if ((uMsg == WM_COMMAND) && (code == HIWORD(wParam)) && (id == LOWORD(wParam))) \
{ \
SetMsgHandled(TRUE); \
func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \
@@ -2184,7 +2212,7 @@ public: \
// void OnCommandIDHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)
#define COMMAND_ID_HANDLER_EX(id, func) \
- if (uMsg == WM_COMMAND && id == LOWORD(wParam)) \
+ if ((uMsg == WM_COMMAND) && (id == LOWORD(wParam))) \
{ \
SetMsgHandled(TRUE); \
func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \
@@ -2195,7 +2223,7 @@ public: \
// void OnCommandCodeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)
#define COMMAND_CODE_HANDLER_EX(code, func) \
- if (uMsg == WM_COMMAND && code == HIWORD(wParam)) \
+ if ((uMsg == WM_COMMAND) && (code == HIWORD(wParam))) \
{ \
SetMsgHandled(TRUE); \
func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \
@@ -2206,7 +2234,7 @@ public: \
// LRESULT OnNotifyHandlerEX(LPNMHDR pnmh)
#define NOTIFY_HANDLER_EX(id, cd, func) \
- if (uMsg == WM_NOTIFY && cd == ((LPNMHDR)lParam)->code && id == ((LPNMHDR)lParam)->idFrom) \
+ if ((uMsg == WM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code) && (id == ((LPNMHDR)lParam)->idFrom)) \
{ \
SetMsgHandled(TRUE); \
lResult = func((LPNMHDR)lParam); \
@@ -2216,7 +2244,7 @@ public: \
// LRESULT OnNotifyIDHandlerEX(LPNMHDR pnmh)
#define NOTIFY_ID_HANDLER_EX(id, func) \
- if (uMsg == WM_NOTIFY && id == ((LPNMHDR)lParam)->idFrom) \
+ if ((uMsg == WM_NOTIFY) && (id == ((LPNMHDR)lParam)->idFrom)) \
{ \
SetMsgHandled(TRUE); \
lResult = func((LPNMHDR)lParam); \
@@ -2226,7 +2254,7 @@ public: \
// LRESULT OnNotifyCodeHandlerEX(LPNMHDR pnmh)
#define NOTIFY_CODE_HANDLER_EX(cd, func) \
- if (uMsg == WM_NOTIFY && cd == ((LPNMHDR)lParam)->code) \
+ if ((uMsg == WM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code)) \
{ \
SetMsgHandled(TRUE); \
lResult = func((LPNMHDR)lParam); \
@@ -2236,7 +2264,7 @@ public: \
// void OnCommandRangeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)
#define COMMAND_RANGE_HANDLER_EX(idFirst, idLast, func) \
- if(uMsg == WM_COMMAND && LOWORD(wParam) >= idFirst && LOWORD(wParam) <= idLast) \
+ if((uMsg == WM_COMMAND) && (LOWORD(wParam) >= idFirst) && (LOWORD(wParam) <= idLast)) \
{ \
SetMsgHandled(TRUE); \
func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \
@@ -2247,7 +2275,7 @@ public: \
// void OnCommandRangeCodeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)
#define COMMAND_RANGE_CODE_HANDLER_EX(idFirst, idLast, code, func) \
- if(uMsg == WM_COMMAND && code == HIWORD(wParam) && LOWORD(wParam) >= idFirst && LOWORD(wParam) <= idLast) \
+ if((uMsg == WM_COMMAND) && (code == HIWORD(wParam)) && (LOWORD(wParam) >= idFirst) && (LOWORD(wParam) <= idLast)) \
{ \
SetMsgHandled(TRUE); \
func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \
@@ -2258,7 +2286,7 @@ public: \
// LRESULT OnNotifyRangeHandlerEX(LPNMHDR pnmh)
#define NOTIFY_RANGE_HANDLER_EX(idFirst, idLast, func) \
- if(uMsg == WM_NOTIFY && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \
+ if((uMsg == WM_NOTIFY) && (((LPNMHDR)lParam)->idFrom >= idFirst) && (((LPNMHDR)lParam)->idFrom <= idLast)) \
{ \
SetMsgHandled(TRUE); \
lResult = func((LPNMHDR)lParam); \
@@ -2268,7 +2296,7 @@ public: \
// LRESULT OnNotifyRangeCodeHandlerEX(LPNMHDR pnmh)
#define NOTIFY_RANGE_CODE_HANDLER_EX(idFirst, idLast, cd, func) \
- if(uMsg == WM_NOTIFY && cd == ((LPNMHDR)lParam)->code && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \
+ if((uMsg == WM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code) && (((LPNMHDR)lParam)->idFrom >= idFirst) && (((LPNMHDR)lParam)->idFrom <= idLast)) \
{ \
SetMsgHandled(TRUE); \
lResult = func((LPNMHDR)lParam); \
@@ -2278,7 +2306,7 @@ public: \
// LRESULT OnReflectedCommandHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)
#define REFLECTED_COMMAND_HANDLER_EX(id, code, func) \
- if (uMsg == OCM_COMMAND && code == HIWORD(wParam) && id == LOWORD(wParam)) \
+ if ((uMsg == OCM_COMMAND) && (code == HIWORD(wParam)) && (id == LOWORD(wParam))) \
{ \
SetMsgHandled(TRUE); \
func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \
@@ -2289,7 +2317,7 @@ public: \
// LRESULT OnReflectedCommandIDHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)
#define REFLECTED_COMMAND_ID_HANDLER_EX(id, func) \
- if (uMsg == OCM_COMMAND && id == LOWORD(wParam)) \
+ if ((uMsg == OCM_COMMAND) && (id == LOWORD(wParam))) \
{ \
SetMsgHandled(TRUE); \
func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \
@@ -2300,7 +2328,7 @@ public: \
// LRESULT OnReflectedCommandCodeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)
#define REFLECTED_COMMAND_CODE_HANDLER_EX(code, func) \
- if (uMsg == OCM_COMMAND && code == HIWORD(wParam)) \
+ if ((uMsg == OCM_COMMAND) && (code == HIWORD(wParam))) \
{ \
SetMsgHandled(TRUE); \
func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \
@@ -2311,7 +2339,7 @@ public: \
// LRESULT OnReflectedNotifyHandlerEX(LPNMHDR pnmh)
#define REFLECTED_NOTIFY_HANDLER_EX(id, cd, func) \
- if (uMsg == OCM_NOTIFY && cd == ((LPNMHDR)lParam)->code && id == ((LPNMHDR)lParam)->idFrom) \
+ if ((uMsg == OCM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code) && (id == ((LPNMHDR)lParam)->idFrom)) \
{ \
SetMsgHandled(TRUE); \
lResult = func((LPNMHDR)lParam); \
@@ -2321,7 +2349,7 @@ public: \
// LRESULT OnReflectedNotifyIDHandlerEX(LPNMHDR pnmh)
#define REFLECTED_NOTIFY_ID_HANDLER_EX(id, func) \
- if (uMsg == OCM_NOTIFY && id == ((LPNMHDR)lParam)->idFrom) \
+ if ((uMsg == OCM_NOTIFY) && (id == ((LPNMHDR)lParam)->idFrom)) \
{ \
SetMsgHandled(TRUE); \
lResult = func((LPNMHDR)lParam); \
@@ -2331,7 +2359,7 @@ public: \
// LRESULT OnReflectedNotifyCodeHandlerEX(LPNMHDR pnmh)
#define REFLECTED_NOTIFY_CODE_HANDLER_EX(cd, func) \
- if (uMsg == OCM_NOTIFY && cd == ((LPNMHDR)lParam)->code) \
+ if ((uMsg == OCM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code)) \
{ \
SetMsgHandled(TRUE); \
lResult = func((LPNMHDR)lParam); \
@@ -2341,7 +2369,7 @@ public: \
// void OnReflectedCommandRangeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)
#define REFLECTED_COMMAND_RANGE_HANDLER_EX(idFirst, idLast, func) \
- if(uMsg == OCM_COMMAND && LOWORD(wParam) >= idFirst && LOWORD(wParam) <= idLast) \
+ if((uMsg == OCM_COMMAND) && (LOWORD(wParam) >= idFirst) && (LOWORD(wParam) <= idLast)) \
{ \
SetMsgHandled(TRUE); \
func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \
@@ -2352,7 +2380,7 @@ public: \
// void OnReflectedCommandRangeCodeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)
#define REFLECTED_COMMAND_RANGE_CODE_HANDLER_EX(idFirst, idLast, code, func) \
- if(uMsg == OCM_COMMAND && code == HIWORD(wParam) && LOWORD(wParam) >= idFirst && LOWORD(wParam) <= idLast) \
+ if((uMsg == OCM_COMMAND) && (code == HIWORD(wParam)) && (LOWORD(wParam) >= idFirst) && (LOWORD(wParam) <= idLast)) \
{ \
SetMsgHandled(TRUE); \
func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \
@@ -2363,7 +2391,7 @@ public: \
// LRESULT OnReflectedNotifyRangeHandlerEX(LPNMHDR pnmh)
#define REFLECTED_NOTIFY_RANGE_HANDLER_EX(idFirst, idLast, func) \
- if(uMsg == OCM_NOTIFY && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \
+ if((uMsg == OCM_NOTIFY) && (((LPNMHDR)lParam)->idFrom >= idFirst) && (((LPNMHDR)lParam)->idFrom <= idLast)) \
{ \
SetMsgHandled(TRUE); \
lResult = func((LPNMHDR)lParam); \
@@ -2373,7 +2401,7 @@ public: \
// LRESULT OnReflectedNotifyRangeCodeHandlerEX(LPNMHDR pnmh)
#define REFLECTED_NOTIFY_RANGE_CODE_HANDLER_EX(idFirst, idLast, cd, func) \
- if(uMsg == OCM_NOTIFY && cd == ((LPNMHDR)lParam)->code && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \
+ if((uMsg == OCM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code) && (((LPNMHDR)lParam)->idFrom >= idFirst) && (((LPNMHDR)lParam)->idFrom <= idLast)) \
{ \
SetMsgHandled(TRUE); \
lResult = func((LPNMHDR)lParam); \
@@ -2381,4 +2409,15 @@ public: \
return TRUE; \
}
+// void OnAppCommandHandler(UINT uDevice, DWORD dwKeys, CWindow wndFocus)
+#define APPCOMMAND_HANDLER_EX(cmd, func) \
+ if((uMsg == WM_APPCOMMAND) && (cmd == GET_APPCOMMAND_LPARAM(lParam))) \
+ { \
+ SetMsgHandled(TRUE); \
+ func(GET_DEVICE_LPARAM(lParam), GET_KEYSTATE_LPARAM(lParam), (HWND)wParam); \
+ lResult = TRUE; \
+ if(IsMsgHandled()) \
+ return TRUE; \
+ }
+
#endif // __ATLCRACK_H__
diff --git a/thirdparty/wtl/atlctrls.h b/thirdparty/wtl/atlctrls.h
index f1f31c7..a6e83f3 100644
--- a/thirdparty/wtl/atlctrls.h
+++ b/thirdparty/wtl/atlctrls.h
@@ -1,13 +1,10 @@
-// Windows Template Library - WTL version 8.1
-// Copyright (C) Microsoft Corporation. All rights reserved.
+// Windows Template Library - WTL version 10.0
+// Copyright (C) Microsoft Corporation, WTL Team. 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/cpl1.0.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.
+// Microsoft Public License (http://opensource.org/licenses/MS-PL)
+// which can be found in the file MS-PL.txt at the root folder.
#ifndef __ATLCTRLS_H__
#define __ATLCTRLS_H__
@@ -22,12 +19,12 @@
#error atlctrls.h requires atlwin.h to be included first
#endif
-#ifndef _WIN32_WCE
- #include
- #include
-#elif defined(WIN32_PLATFORM_WFSP) && !defined(_WINUSERM_H_)
- #include
-#endif // !_WIN32_WCE
+#include
+#include
+
+#if (_RICHEDIT_VER < 0x0300)
+ #error WTL10 requires RichEdit version 3 or higher
+#endif
// protect template members from windowsx.h macros
#ifdef _INC_WINDOWSX
@@ -47,7 +44,7 @@
// CEditCommands
// CScrollBarT - CScrollBar
//
-// CImageList
+// CImageListT - CImageList, CImageListManaged
// CListViewCtrlT - CListViewCtrl
// CTreeViewCtrlT - CTreeViewCtrl
// CTreeItemT - CTreeItem
@@ -78,9 +75,6 @@
// CLinkCtrlT - CLinkCtrl
//
// CCustomDraw
-//
-// CCECommandBarCtrlT - CCECommandBarCtrl
-// CCECommandBandsCtrlT - CCECommandBandsCtrl
namespace WTL
@@ -115,7 +109,7 @@ class CStaticT : public TBase
CStaticT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -132,66 +126,52 @@ class CStaticT : public TBase
return _T("STATIC");
}
-#ifndef _WIN32_WCE
HICON GetIcon() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HICON)::SendMessage(m_hWnd, STM_GETICON, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HICON)::SendMessage(this->m_hWnd, STM_GETICON, 0, 0L);
}
HICON SetIcon(HICON hIcon)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HICON)::SendMessage(m_hWnd, STM_SETICON, (WPARAM)hIcon, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HICON)::SendMessage(this->m_hWnd, STM_SETICON, (WPARAM)hIcon, 0L);
}
HENHMETAFILE GetEnhMetaFile() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HENHMETAFILE)::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_ENHMETAFILE, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HENHMETAFILE)::SendMessage(this->m_hWnd, STM_GETIMAGE, IMAGE_ENHMETAFILE, 0L);
}
HENHMETAFILE SetEnhMetaFile(HENHMETAFILE hMetaFile)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HENHMETAFILE)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_ENHMETAFILE, (LPARAM)hMetaFile);
- }
-#else // CE specific
- HICON GetIcon() const
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return (HICON)::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_ICON, 0L);
- }
-
- HICON SetIcon(HICON hIcon)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return (HICON)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HENHMETAFILE)::SendMessage(this->m_hWnd, STM_SETIMAGE, IMAGE_ENHMETAFILE, (LPARAM)hMetaFile);
}
-#endif // _WIN32_WCE
CBitmapHandle GetBitmap() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CBitmapHandle((HBITMAP)::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_BITMAP, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CBitmapHandle((HBITMAP)::SendMessage(this->m_hWnd, STM_GETIMAGE, IMAGE_BITMAP, 0L));
}
CBitmapHandle SetBitmap(HBITMAP hBitmap)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CBitmapHandle((HBITMAP)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CBitmapHandle((HBITMAP)::SendMessage(this->m_hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap));
}
HCURSOR GetCursor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HCURSOR)::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_CURSOR, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HCURSOR)::SendMessage(this->m_hWnd, STM_GETIMAGE, IMAGE_CURSOR, 0L);
}
HCURSOR SetCursor(HCURSOR hCursor)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HCURSOR)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_CURSOR, (LPARAM)hCursor);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HCURSOR)::SendMessage(this->m_hWnd, STM_SETIMAGE, IMAGE_CURSOR, (LPARAM)hCursor);
}
};
@@ -211,7 +191,7 @@ class CButtonT : public TBase
CButtonT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -230,161 +210,157 @@ class CButtonT : public TBase
UINT GetState() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, BM_GETSTATE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, BM_GETSTATE, 0, 0L);
}
void SetState(BOOL bHighlight)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, BM_SETSTATE, bHighlight, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, BM_SETSTATE, bHighlight, 0L);
}
int GetCheck() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, BM_GETCHECK, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, BM_GETCHECK, 0, 0L);
}
void SetCheck(int nCheck)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, BM_SETCHECK, nCheck, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, BM_SETCHECK, nCheck, 0L);
}
UINT GetButtonStyle() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::GetWindowLong(m_hWnd, GWL_STYLE) & 0xFFFF;
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::GetWindowLong(this->m_hWnd, GWL_STYLE) & 0xFFFF;
}
void SetButtonStyle(UINT nStyle, BOOL bRedraw = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, BM_SETSTYLE, nStyle, (LPARAM)bRedraw);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, BM_SETSTYLE, nStyle, (LPARAM)bRedraw);
}
-#ifndef _WIN32_WCE
HICON GetIcon() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HICON)::SendMessage(m_hWnd, BM_GETIMAGE, IMAGE_ICON, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HICON)::SendMessage(this->m_hWnd, BM_GETIMAGE, IMAGE_ICON, 0L);
}
HICON SetIcon(HICON hIcon)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HICON)::SendMessage(m_hWnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HICON)::SendMessage(this->m_hWnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
}
CBitmapHandle GetBitmap() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CBitmapHandle((HBITMAP)::SendMessage(m_hWnd, BM_GETIMAGE, IMAGE_BITMAP, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CBitmapHandle((HBITMAP)::SendMessage(this->m_hWnd, BM_GETIMAGE, IMAGE_BITMAP, 0L));
}
CBitmapHandle SetBitmap(HBITMAP hBitmap)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CBitmapHandle((HBITMAP)::SendMessage(m_hWnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CBitmapHandle((HBITMAP)::SendMessage(this->m_hWnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap));
}
-#endif // !_WIN32_WCE
-#if (_WIN32_WINNT >= 0x0501)
BOOL GetIdealSize(LPSIZE lpSize) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, BCM_GETIDEALSIZE, 0, (LPARAM)lpSize);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, BCM_GETIDEALSIZE, 0, (LPARAM)lpSize);
}
BOOL GetImageList(PBUTTON_IMAGELIST pButtonImagelist) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, BCM_GETIMAGELIST, 0, (LPARAM)pButtonImagelist);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, BCM_GETIMAGELIST, 0, (LPARAM)pButtonImagelist);
}
BOOL SetImageList(PBUTTON_IMAGELIST pButtonImagelist)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, BCM_SETIMAGELIST, 0, (LPARAM)pButtonImagelist);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, BCM_SETIMAGELIST, 0, (LPARAM)pButtonImagelist);
}
BOOL GetTextMargin(LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, BCM_GETTEXTMARGIN, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, BCM_GETTEXTMARGIN, 0, (LPARAM)lpRect);
}
BOOL SetTextMargin(LPRECT lpRect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, BCM_SETTEXTMARGIN, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, BCM_SETTEXTMARGIN, 0, (LPARAM)lpRect);
}
-#endif // (_WIN32_WINNT >= 0x0501)
#if (WINVER >= 0x0600)
void SetDontClick(BOOL bDontClick)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, BM_SETDONTCLICK, (WPARAM)bDontClick, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, BM_SETDONTCLICK, (WPARAM)bDontClick, 0L);
}
#endif // (WINVER >= 0x0600)
#if (_WIN32_WINNT >= 0x0600)
BOOL SetDropDownState(BOOL bDropDown)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (BS_SPLITBUTTON | BS_DEFSPLITBUTTON)) != 0);
- return (BOOL)::SendMessage(m_hWnd, BCM_SETDROPDOWNSTATE, (WPARAM)bDropDown, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (BS_SPLITBUTTON | BS_DEFSPLITBUTTON)) != 0);
+ return (BOOL)::SendMessage(this->m_hWnd, BCM_SETDROPDOWNSTATE, (WPARAM)bDropDown, 0L);
}
BOOL GetSplitInfo(PBUTTON_SPLITINFO pSplitInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (BS_SPLITBUTTON | BS_DEFSPLITBUTTON)) != 0);
- return (BOOL)::SendMessage(m_hWnd, BCM_GETSPLITINFO, 0, (LPARAM)pSplitInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (BS_SPLITBUTTON | BS_DEFSPLITBUTTON)) != 0);
+ return (BOOL)::SendMessage(this->m_hWnd, BCM_GETSPLITINFO, 0, (LPARAM)pSplitInfo);
}
BOOL SetSplitInfo(PBUTTON_SPLITINFO pSplitInfo)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (BS_SPLITBUTTON | BS_DEFSPLITBUTTON)) != 0);
- return (BOOL)::SendMessage(m_hWnd, BCM_SETSPLITINFO, 0, (LPARAM)pSplitInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (BS_SPLITBUTTON | BS_DEFSPLITBUTTON)) != 0);
+ return (BOOL)::SendMessage(this->m_hWnd, BCM_SETSPLITINFO, 0, (LPARAM)pSplitInfo);
}
int GetNoteLength() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (BS_COMMANDLINK | BS_DEFCOMMANDLINK)) != 0);
- return (int)::SendMessage(m_hWnd, BCM_GETNOTELENGTH, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (BS_COMMANDLINK | BS_DEFCOMMANDLINK)) != 0);
+ return (int)::SendMessage(this->m_hWnd, BCM_GETNOTELENGTH, 0, 0L);
}
BOOL GetNote(LPWSTR lpstrNoteText, int cchNoteText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (BS_COMMANDLINK | BS_DEFCOMMANDLINK)) != 0);
- return (BOOL)::SendMessage(m_hWnd, BCM_GETNOTE, cchNoteText, (LPARAM)lpstrNoteText);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (BS_COMMANDLINK | BS_DEFCOMMANDLINK)) != 0);
+ return (BOOL)::SendMessage(this->m_hWnd, BCM_GETNOTE, cchNoteText, (LPARAM)lpstrNoteText);
}
BOOL SetNote(LPCWSTR lpstrNoteText)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (BS_COMMANDLINK | BS_DEFCOMMANDLINK)) != 0);
- return (BOOL)::SendMessage(m_hWnd, BCM_SETNOTE, 0, (LPARAM)lpstrNoteText);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (BS_COMMANDLINK | BS_DEFCOMMANDLINK)) != 0);
+ return (BOOL)::SendMessage(this->m_hWnd, BCM_SETNOTE, 0, (LPARAM)lpstrNoteText);
}
LRESULT SetElevationRequiredState(BOOL bSet)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return ::SendMessage(m_hWnd, BCM_SETSHIELD, 0, (LPARAM)bSet);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return ::SendMessage(this->m_hWnd, BCM_SETSHIELD, 0, (LPARAM)bSet);
}
#endif // (_WIN32_WINNT >= 0x0600)
// Operations
void Click()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, BM_CLICK, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, BM_CLICK, 0, 0L);
}
};
@@ -404,7 +380,7 @@ class CListBoxT : public TBase
CListBoxT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -424,186 +400,177 @@ class CListBoxT : public TBase
// for entire listbox
int GetCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_GETCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_GETCOUNT, 0, 0L);
}
-#ifndef _WIN32_WCE
int SetCount(int cItems)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT(((GetStyle() & LBS_NODATA) != 0) && ((GetStyle() & LBS_HASSTRINGS) == 0));
- return (int)::SendMessage(m_hWnd, LB_SETCOUNT, cItems, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT(((this->GetStyle() & LBS_NODATA) != 0) && ((this->GetStyle() & LBS_HASSTRINGS) == 0));
+ return (int)::SendMessage(this->m_hWnd, LB_SETCOUNT, cItems, 0L);
}
-#endif // !_WIN32_WCE
int GetHorizontalExtent() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_GETHORIZONTALEXTENT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_GETHORIZONTALEXTENT, 0, 0L);
}
void SetHorizontalExtent(int cxExtent)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LB_SETHORIZONTALEXTENT, cxExtent, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LB_SETHORIZONTALEXTENT, cxExtent, 0L);
}
int GetTopIndex() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_GETTOPINDEX, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_GETTOPINDEX, 0, 0L);
}
int SetTopIndex(int nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_SETTOPINDEX, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_SETTOPINDEX, nIndex, 0L);
}
LCID GetLocale() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (LCID)::SendMessage(m_hWnd, LB_GETLOCALE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (LCID)::SendMessage(this->m_hWnd, LB_GETLOCALE, 0, 0L);
}
LCID SetLocale(LCID nNewLocale)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (LCID)::SendMessage(m_hWnd, LB_SETLOCALE, (WPARAM)nNewLocale, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (LCID)::SendMessage(this->m_hWnd, LB_SETLOCALE, (WPARAM)nNewLocale, 0L);
}
-#if (WINVER >= 0x0500) && !defined(_WIN32_WCE)
DWORD GetListBoxInfo() const
{
- ATLASSERT(::IsWindow(m_hWnd));
-#if (_WIN32_WINNT >= 0x0501)
- return (DWORD)::SendMessage(m_hWnd, LB_GETLISTBOXINFO, 0, 0L);
-#else // !(_WIN32_WINNT >= 0x0501)
- return ::GetListBoxInfo(m_hWnd);
-#endif // !(_WIN32_WINNT >= 0x0501)
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, LB_GETLISTBOXINFO, 0, 0L);
}
-#endif // (WINVER >= 0x0500) && !defined(_WIN32_WCE)
// for single-selection listboxes
int GetCurSel() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == 0);
- return (int)::SendMessage(m_hWnd, LB_GETCURSEL, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == 0);
+ return (int)::SendMessage(this->m_hWnd, LB_GETCURSEL, 0, 0L);
}
int SetCurSel(int nSelect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == 0);
- return (int)::SendMessage(m_hWnd, LB_SETCURSEL, nSelect, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == 0);
+ return (int)::SendMessage(this->m_hWnd, LB_SETCURSEL, nSelect, 0L);
}
// for multiple-selection listboxes
int GetSel(int nIndex) const // also works for single-selection
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_GETSEL, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_GETSEL, nIndex, 0L);
}
int SetSel(int nIndex, BOOL bSelect = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);
- return (int)::SendMessage(m_hWnd, LB_SETSEL, bSelect, nIndex);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);
+ return (int)::SendMessage(this->m_hWnd, LB_SETSEL, bSelect, nIndex);
}
int GetSelCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);
- return (int)::SendMessage(m_hWnd, LB_GETSELCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);
+ return (int)::SendMessage(this->m_hWnd, LB_GETSELCOUNT, 0, 0L);
}
int GetSelItems(int nMaxItems, LPINT rgIndex) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);
- return (int)::SendMessage(m_hWnd, LB_GETSELITEMS, nMaxItems, (LPARAM)rgIndex);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);
+ return (int)::SendMessage(this->m_hWnd, LB_GETSELITEMS, nMaxItems, (LPARAM)rgIndex);
}
int GetAnchorIndex() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);
- return (int)::SendMessage(m_hWnd, LB_GETANCHORINDEX, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);
+ return (int)::SendMessage(this->m_hWnd, LB_GETANCHORINDEX, 0, 0L);
}
void SetAnchorIndex(int nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);
- ::SendMessage(m_hWnd, LB_SETANCHORINDEX, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);
+ ::SendMessage(this->m_hWnd, LB_SETANCHORINDEX, nIndex, 0L);
}
int GetCaretIndex() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_GETCARETINDEX, 0, 0);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_GETCARETINDEX, 0, 0);
}
int SetCaretIndex(int nIndex, BOOL bScroll = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_SETCARETINDEX, nIndex, MAKELONG(bScroll, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_SETCARETINDEX, nIndex, MAKELONG(bScroll, 0));
}
// for listbox items
DWORD_PTR GetItemData(int nIndex) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD_PTR)::SendMessage(m_hWnd, LB_GETITEMDATA, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD_PTR)::SendMessage(this->m_hWnd, LB_GETITEMDATA, nIndex, 0L);
}
int SetItemData(int nIndex, DWORD_PTR dwItemData)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_SETITEMDATA, nIndex, (LPARAM)dwItemData);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_SETITEMDATA, nIndex, (LPARAM)dwItemData);
}
void* GetItemDataPtr(int nIndex) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (void*)::SendMessage(m_hWnd, LB_GETITEMDATA, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (void*)::SendMessage(this->m_hWnd, LB_GETITEMDATA, nIndex, 0L);
}
int SetItemDataPtr(int nIndex, void* pData)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return SetItemData(nIndex, (DWORD_PTR)pData);
}
int GetItemRect(int nIndex, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_GETITEMRECT, nIndex, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_GETITEMRECT, nIndex, (LPARAM)lpRect);
}
int GetText(int nIndex, LPTSTR lpszBuffer) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_GETTEXT, nIndex, (LPARAM)lpszBuffer);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_GETTEXT, nIndex, (LPARAM)lpszBuffer);
}
-#ifndef _ATL_NO_COM
#ifdef _OLEAUTO_H_
BOOL GetTextBSTR(int nIndex, BSTR& bstrText) const
{
USES_CONVERSION;
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(bstrText == NULL);
int nLen = GetTextLen(nIndex);
if(nLen == LB_ERR)
return FALSE;
- CTempBuffer buff;
+ ATL::CTempBuffer buff;
LPTSTR lpstrText = buff.Allocate(nLen + 1);
if(lpstrText == NULL)
return FALSE;
@@ -615,12 +582,11 @@ class CListBoxT : public TBase
return (bstrText != NULL) ? TRUE : FALSE;
}
#endif // _OLEAUTO_H_
-#endif // !_ATL_NO_COM
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
- int GetText(int nIndex, _CSTRING_NS::CString& strText) const
+#ifdef __ATLSTR_H__
+ int GetText(int nIndex, ATL::CString& strText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
int cchLen = GetTextLen(nIndex);
if(cchLen == LB_ERR)
return LB_ERR;
@@ -633,71 +599,71 @@ class CListBoxT : public TBase
}
return nRet;
}
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
+#endif // __ATLSTR_H__
int GetTextLen(int nIndex) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_GETTEXTLEN, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_GETTEXTLEN, nIndex, 0L);
}
int GetItemHeight(int nIndex) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_GETITEMHEIGHT, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_GETITEMHEIGHT, nIndex, 0L);
}
int SetItemHeight(int nIndex, UINT cyItemHeight)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0));
}
// Settable only attributes
void SetColumnWidth(int cxWidth)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LB_SETCOLUMNWIDTH, cxWidth, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LB_SETCOLUMNWIDTH, cxWidth, 0L);
}
BOOL SetTabStops(int nTabStops, LPINT rgTabStops)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & LBS_USETABSTOPS) != 0);
- return (BOOL)::SendMessage(m_hWnd, LB_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & LBS_USETABSTOPS) != 0);
+ return (BOOL)::SendMessage(this->m_hWnd, LB_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops);
}
BOOL SetTabStops()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & LBS_USETABSTOPS) != 0);
- return (BOOL)::SendMessage(m_hWnd, LB_SETTABSTOPS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & LBS_USETABSTOPS) != 0);
+ return (BOOL)::SendMessage(this->m_hWnd, LB_SETTABSTOPS, 0, 0L);
}
BOOL SetTabStops(const int& cxEachStop) // takes an 'int'
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & LBS_USETABSTOPS) != 0);
- return (BOOL)::SendMessage(m_hWnd, LB_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & LBS_USETABSTOPS) != 0);
+ return (BOOL)::SendMessage(this->m_hWnd, LB_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop);
}
// Operations
int InitStorage(int nItems, UINT nBytes)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_INITSTORAGE, (WPARAM)nItems, nBytes);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_INITSTORAGE, (WPARAM)nItems, nBytes);
}
void ResetContent()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LB_RESETCONTENT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LB_RESETCONTENT, 0, 0L);
}
UINT ItemFromPoint(POINT pt, BOOL& bOutside) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dw = (DWORD)::SendMessage(m_hWnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x, pt.y));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dw = (DWORD)::SendMessage(this->m_hWnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x, pt.y));
bOutside = (BOOL)HIWORD(dw);
return (UINT)LOWORD(dw);
}
@@ -705,74 +671,60 @@ class CListBoxT : public TBase
// manipulating listbox items
int AddString(LPCTSTR lpszItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_ADDSTRING, 0, (LPARAM)lpszItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_ADDSTRING, 0, (LPARAM)lpszItem);
}
int DeleteString(UINT nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_DELETESTRING, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_DELETESTRING, nIndex, 0L);
}
int InsertString(int nIndex, LPCTSTR lpszItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_INSERTSTRING, nIndex, (LPARAM)lpszItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_INSERTSTRING, nIndex, (LPARAM)lpszItem);
}
-#ifndef _WIN32_WCE
int Dir(UINT attr, LPCTSTR lpszWildCard)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_DIR, attr, (LPARAM)lpszWildCard);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_DIR, attr, (LPARAM)lpszWildCard);
}
int AddFile(LPCTSTR lpstrFileName)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_ADDFILE, 0, (LPARAM)lpstrFileName);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_ADDFILE, 0, (LPARAM)lpstrFileName);
}
-#endif // !_WIN32_WCE
// selection helpers
int FindString(int nStartAfter, LPCTSTR lpszItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_FINDSTRING, nStartAfter, (LPARAM)lpszItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_FINDSTRING, nStartAfter, (LPARAM)lpszItem);
}
int FindStringExact(int nIndexStart, LPCTSTR lpszFind) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind);
}
int SelectString(int nStartAfter, LPCTSTR lpszItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LB_SELECTSTRING, nStartAfter, (LPARAM)lpszItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LB_SELECTSTRING, nStartAfter, (LPARAM)lpszItem);
}
int SelItemRange(BOOL bSelect, int nFirstItem, int nLastItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);
ATLASSERT(nFirstItem <= nLastItem);
- return bSelect ? (int)::SendMessage(m_hWnd, LB_SELITEMRANGEEX, nFirstItem, nLastItem) : (int)::SendMessage(m_hWnd, LB_SELITEMRANGEEX, nLastItem, nFirstItem);
+ return bSelect ? (int)::SendMessage(this->m_hWnd, LB_SELITEMRANGEEX, nFirstItem, nLastItem) : (int)::SendMessage(this->m_hWnd, LB_SELITEMRANGEEX, nLastItem, nFirstItem);
}
-
-#ifdef WIN32_PLATFORM_WFSP // SmartPhone only messages
- DWORD GetInputMode(BOOL bCurrentMode = TRUE)
- {
- return SendMessage(LB_GETINPUTMODE, 0, (LPARAM)bCurrentMode);
- }
-
- BOOL SetInputMode(DWORD dwMode)
- {
- return SendMessage(LB_SETINPUTMODE, 0, (LPARAM)dwMode);
- }
-#endif // WIN32_PLATFORM_WFSP
};
typedef CListBoxT CListBox;
@@ -781,8 +733,6 @@ typedef CListBoxT CListBox;
///////////////////////////////////////////////////////////////////////////////
// CComboBox - client side for a Windows COMBOBOX control
-#ifndef WIN32_PLATFORM_WFSP // No COMBOBOX on SmartPhones
-
template
class CComboBoxT : public TBase
{
@@ -793,7 +743,7 @@ class CComboBoxT : public TBase
CComboBoxT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -813,138 +763,131 @@ class CComboBoxT : public TBase
// for entire combo box
int GetCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_GETCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_GETCOUNT, 0, 0L);
}
int GetCurSel() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_GETCURSEL, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_GETCURSEL, 0, 0L);
}
int SetCurSel(int nSelect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_SETCURSEL, nSelect, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_SETCURSEL, nSelect, 0L);
}
LCID GetLocale() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (LCID)::SendMessage(m_hWnd, CB_GETLOCALE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (LCID)::SendMessage(this->m_hWnd, CB_GETLOCALE, 0, 0L);
}
LCID SetLocale(LCID nNewLocale)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (LCID)::SendMessage(m_hWnd, CB_SETLOCALE, (WPARAM)nNewLocale, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (LCID)::SendMessage(this->m_hWnd, CB_SETLOCALE, (WPARAM)nNewLocale, 0L);
}
int GetTopIndex() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_GETTOPINDEX, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_GETTOPINDEX, 0, 0L);
}
int SetTopIndex(int nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_SETTOPINDEX, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_SETTOPINDEX, nIndex, 0L);
}
UINT GetHorizontalExtent() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, CB_GETHORIZONTALEXTENT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, CB_GETHORIZONTALEXTENT, 0, 0L);
}
void SetHorizontalExtent(UINT nExtent)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, CB_SETHORIZONTALEXTENT, nExtent, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, CB_SETHORIZONTALEXTENT, nExtent, 0L);
}
int GetDroppedWidth() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_GETDROPPEDWIDTH, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_GETDROPPEDWIDTH, 0, 0L);
}
int SetDroppedWidth(UINT nWidth)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_SETDROPPEDWIDTH, nWidth, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_SETDROPPEDWIDTH, nWidth, 0L);
}
-#if ((WINVER >= 0x0500) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 420))
BOOL GetComboBoxInfo(PCOMBOBOXINFO pComboBoxInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
-#if ((_WIN32_WINNT >= 0x0501) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 420))
- return (BOOL)::SendMessage(m_hWnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)pComboBoxInfo);
-#else // !((_WIN32_WINNT >= 0x0501) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 420))
- return ::GetComboBoxInfo(m_hWnd, pComboBoxInfo);
-#endif // !((_WIN32_WINNT >= 0x0501) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 420))
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)pComboBoxInfo);
}
-#endif // ((WINVER >= 0x0500) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 420))
// for edit control
DWORD GetEditSel() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, CB_GETEDITSEL, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, CB_GETEDITSEL, 0, 0L);
}
BOOL SetEditSel(int nStartChar, int nEndChar)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, CB_SETEDITSEL, 0, MAKELONG(nStartChar, nEndChar));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CB_SETEDITSEL, 0, MAKELONG(nStartChar, nEndChar));
}
// for combobox item
DWORD_PTR GetItemData(int nIndex) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD_PTR)::SendMessage(m_hWnd, CB_GETITEMDATA, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD_PTR)::SendMessage(this->m_hWnd, CB_GETITEMDATA, nIndex, 0L);
}
int SetItemData(int nIndex, DWORD_PTR dwItemData)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_SETITEMDATA, nIndex, (LPARAM)dwItemData);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_SETITEMDATA, nIndex, (LPARAM)dwItemData);
}
void* GetItemDataPtr(int nIndex) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return (void*)GetItemData(nIndex);
}
int SetItemDataPtr(int nIndex, void* pData)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return SetItemData(nIndex, (DWORD_PTR)pData);
}
int GetLBText(int nIndex, LPTSTR lpszText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_GETLBTEXT, nIndex, (LPARAM)lpszText);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_GETLBTEXT, nIndex, (LPARAM)lpszText);
}
-#ifndef _ATL_NO_COM
BOOL GetLBTextBSTR(int nIndex, BSTR& bstrText) const
{
USES_CONVERSION;
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(bstrText == NULL);
int nLen = GetLBTextLen(nIndex);
if(nLen == CB_ERR)
return FALSE;
- CTempBuffer buff;
+ ATL::CTempBuffer buff;
LPTSTR lpstrText = buff.Allocate(nLen + 1);
if(lpstrText == NULL)
return FALSE;
@@ -955,12 +898,11 @@ class CComboBoxT : public TBase
bstrText = ::SysAllocString(T2OLE(lpstrText));
return (bstrText != NULL) ? TRUE : FALSE;
}
-#endif // !_ATL_NO_COM
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
- int GetLBText(int nIndex, _CSTRING_NS::CString& strText) const
+#ifdef __ATLSTR_H__
+ int GetLBText(int nIndex, ATL::CString& strText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
int cchLen = GetLBTextLen(nIndex);
if(cchLen == CB_ERR)
return CB_ERR;
@@ -973,186 +915,175 @@ class CComboBoxT : public TBase
}
return nRet;
}
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
+#endif // __ATLSTR_H__
int GetLBTextLen(int nIndex) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_GETLBTEXTLEN, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_GETLBTEXTLEN, nIndex, 0L);
}
int GetItemHeight(int nIndex) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_GETITEMHEIGHT, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_GETITEMHEIGHT, nIndex, 0L);
}
int SetItemHeight(int nIndex, UINT cyItemHeight)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0));
}
BOOL GetExtendedUI() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, CB_GETEXTENDEDUI, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CB_GETEXTENDEDUI, 0, 0L);
}
int SetExtendedUI(BOOL bExtended = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_SETEXTENDEDUI, bExtended, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_SETEXTENDEDUI, bExtended, 0L);
}
void GetDroppedControlRect(LPRECT lprect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)lprect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)lprect);
}
BOOL GetDroppedState() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, CB_GETDROPPEDSTATE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CB_GETDROPPEDSTATE, 0, 0L);
}
-#if (_WIN32_WINNT >= 0x0501)
int GetMinVisible() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_GETMINVISIBLE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_GETMINVISIBLE, 0, 0L);
}
BOOL SetMinVisible(int nMinVisible)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, CB_SETMINVISIBLE, nMinVisible, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CB_SETMINVISIBLE, nMinVisible, 0L);
}
// Vista only
BOOL GetCueBannerText(LPWSTR lpwText, int cchText) const
{
-#ifndef CB_GETCUEBANNER
- const UINT CB_GETCUEBANNER = (CBM_FIRST + 4);
-#endif
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, CB_GETCUEBANNER, (WPARAM)lpwText, cchText);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CB_GETCUEBANNER, (WPARAM)lpwText, cchText);
}
// Vista only
BOOL SetCueBannerText(LPCWSTR lpcwText)
{
-#ifndef CB_SETCUEBANNER
- const UINT CB_SETCUEBANNER = (CBM_FIRST + 3);
-#endif
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, CB_SETCUEBANNER, 0, (LPARAM)lpcwText);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CB_SETCUEBANNER, 0, (LPARAM)lpcwText);
}
-#endif // (_WIN32_WINNT >= 0x0501)
// Operations
int InitStorage(int nItems, UINT nBytes)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_INITSTORAGE, (WPARAM)nItems, nBytes);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_INITSTORAGE, (WPARAM)nItems, nBytes);
}
void ResetContent()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, CB_RESETCONTENT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, CB_RESETCONTENT, 0, 0L);
}
// for edit control
BOOL LimitText(int nMaxChars)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, CB_LIMITTEXT, nMaxChars, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CB_LIMITTEXT, nMaxChars, 0L);
}
// for drop-down combo boxes
void ShowDropDown(BOOL bShowIt = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, CB_SHOWDROPDOWN, bShowIt, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, CB_SHOWDROPDOWN, bShowIt, 0L);
}
// manipulating listbox items
int AddString(LPCTSTR lpszString)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_ADDSTRING, 0, (LPARAM)lpszString);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_ADDSTRING, 0, (LPARAM)lpszString);
}
int DeleteString(UINT nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_DELETESTRING, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_DELETESTRING, nIndex, 0L);
}
int InsertString(int nIndex, LPCTSTR lpszString)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_INSERTSTRING, nIndex, (LPARAM)lpszString);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_INSERTSTRING, nIndex, (LPARAM)lpszString);
}
-#ifndef _WIN32_WCE
int Dir(UINT attr, LPCTSTR lpszWildCard)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_DIR, attr, (LPARAM)lpszWildCard);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_DIR, attr, (LPARAM)lpszWildCard);
}
-#endif // !_WIN32_WCE
// selection helpers
int FindString(int nStartAfter, LPCTSTR lpszString) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_FINDSTRING, nStartAfter, (LPARAM)lpszString);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_FINDSTRING, nStartAfter, (LPARAM)lpszString);
}
int FindStringExact(int nIndexStart, LPCTSTR lpszFind) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind);
}
int SelectString(int nStartAfter, LPCTSTR lpszString)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CB_SELECTSTRING, nStartAfter, (LPARAM)lpszString);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CB_SELECTSTRING, nStartAfter, (LPARAM)lpszString);
}
// Clipboard operations
void Clear()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, WM_CLEAR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, WM_CLEAR, 0, 0L);
}
void Copy()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, WM_COPY, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, WM_COPY, 0, 0L);
}
void Cut()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, WM_CUT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, WM_CUT, 0, 0L);
}
void Paste()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, WM_PASTE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, WM_PASTE, 0, 0L);
}
};
typedef CComboBoxT CComboBox;
-#endif // !WIN32_PLATFORM_WFSP
///////////////////////////////////////////////////////////////////////////////
// CEdit - client side for a Windows EDIT control
@@ -1167,7 +1098,7 @@ class CEditT : public TBase
CEditT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -1186,96 +1117,102 @@ class CEditT : public TBase
BOOL CanUndo() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_CANUNDO, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_CANUNDO, 0, 0L);
}
int GetLineCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_GETLINECOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_GETLINECOUNT, 0, 0L);
}
BOOL GetModify() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_GETMODIFY, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_GETMODIFY, 0, 0L);
}
void SetModify(BOOL bModified = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETMODIFY, bModified, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETMODIFY, bModified, 0L);
}
void GetRect(LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_GETRECT, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_GETRECT, 0, (LPARAM)lpRect);
}
DWORD GetSel() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, EM_GETSEL, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETSEL, 0, 0L);
}
void GetSel(int& nStartChar, int& nEndChar) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_GETSEL, (WPARAM)&nStartChar, (LPARAM)&nEndChar);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_GETSEL, (WPARAM)&nStartChar, (LPARAM)&nEndChar);
}
-#ifndef _WIN32_WCE
HLOCAL GetHandle() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HLOCAL)::SendMessage(m_hWnd, EM_GETHANDLE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HLOCAL)::SendMessage(this->m_hWnd, EM_GETHANDLE, 0, 0L);
}
void SetHandle(HLOCAL hBuffer)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETHANDLE, (WPARAM)hBuffer, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETHANDLE, (WPARAM)hBuffer, 0L);
}
-#endif // !_WIN32_WCE
DWORD GetMargins() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, EM_GETMARGINS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETMARGINS, 0, 0L);
}
- void SetMargins(UINT nLeft, UINT nRight)
+ void GetMargins(UINT& nLeft, UINT& nRight) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETMARGINS, EC_LEFTMARGIN|EC_RIGHTMARGIN, MAKELONG(nLeft, nRight));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, EM_GETMARGINS, 0, 0L);
+ nLeft = LOWORD(dwRet);
+ nRight = HIWORD(dwRet);
+ }
+
+ void SetMargins(UINT nLeft, UINT nRight, WORD wFlags = EC_LEFTMARGIN | EC_RIGHTMARGIN)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETMARGINS, wFlags, MAKELONG(nLeft, nRight));
}
UINT GetLimitText() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, EM_GETLIMITTEXT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, EM_GETLIMITTEXT, 0, 0L);
}
void SetLimitText(UINT nMax)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETLIMITTEXT, nMax, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETLIMITTEXT, nMax, 0L);
}
POINT PosFromChar(UINT nChar) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, EM_POSFROMCHAR, nChar, 0);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, EM_POSFROMCHAR, nChar, 0);
POINT point = { GET_X_LPARAM(dwRet), GET_Y_LPARAM(dwRet) };
return point;
}
int CharFromPos(POINT pt, int* pLine = NULL) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, EM_CHARFROMPOS, 0, MAKELPARAM(pt.x, pt.y));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, EM_CHARFROMPOS, 0, MAKELPARAM(pt.x, pt.y));
if(pLine != NULL)
*pLine = (int)(short)HIWORD(dwRet);
return (int)(short)LOWORD(dwRet);
@@ -1284,168 +1221,160 @@ class CEditT : public TBase
// NOTE: first word in lpszBuffer must contain the size of the buffer!
int GetLine(int nIndex, LPTSTR lpszBuffer) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);
}
int GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
*(LPWORD)lpszBuffer = (WORD)nMaxLength;
- return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);
+ return (int)::SendMessage(this->m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);
}
TCHAR GetPasswordChar() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (TCHAR)::SendMessage(m_hWnd, EM_GETPASSWORDCHAR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (TCHAR)::SendMessage(this->m_hWnd, EM_GETPASSWORDCHAR, 0, 0L);
}
void SetPasswordChar(TCHAR ch)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETPASSWORDCHAR, ch, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETPASSWORDCHAR, ch, 0L);
}
-#ifndef _WIN32_WCE
EDITWORDBREAKPROC GetWordBreakProc() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (EDITWORDBREAKPROC)::SendMessage(m_hWnd, EM_GETWORDBREAKPROC, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (EDITWORDBREAKPROC)::SendMessage(this->m_hWnd, EM_GETWORDBREAKPROC, 0, 0L);
}
void SetWordBreakProc(EDITWORDBREAKPROC ewbprc)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETWORDBREAKPROC, 0, (LPARAM)ewbprc);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETWORDBREAKPROC, 0, (LPARAM)ewbprc);
}
-#endif // !_WIN32_WCE
int GetFirstVisibleLine() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_GETFIRSTVISIBLELINE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_GETFIRSTVISIBLELINE, 0, 0L);
}
-#ifndef _WIN32_WCE
int GetThumb() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & ES_MULTILINE) != 0);
- return (int)::SendMessage(m_hWnd, EM_GETTHUMB, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & ES_MULTILINE) != 0);
+ return (int)::SendMessage(this->m_hWnd, EM_GETTHUMB, 0, 0L);
}
-#endif // !_WIN32_WCE
BOOL SetReadOnly(BOOL bReadOnly = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SETREADONLY, bReadOnly, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETREADONLY, bReadOnly, 0L);
}
-#if (WINVER >= 0x0500) && !defined(_WIN32_WCE)
UINT GetImeStatus(UINT uStatus) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, EM_GETIMESTATUS, uStatus, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, EM_GETIMESTATUS, uStatus, 0L);
}
UINT SetImeStatus(UINT uStatus, UINT uData)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, EM_SETIMESTATUS, uStatus, uData);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, EM_SETIMESTATUS, uStatus, uData);
}
-#endif // (WINVER >= 0x0500) && !defined(_WIN32_WCE)
-#if (_WIN32_WINNT >= 0x0501)
BOOL GetCueBannerText(LPCWSTR lpstrText, int cchText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_GETCUEBANNER, (WPARAM)lpstrText, cchText);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_GETCUEBANNER, (WPARAM)lpstrText, cchText);
}
// bKeepWithFocus - Vista only
BOOL SetCueBannerText(LPCWSTR lpstrText, BOOL bKeepWithFocus = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SETCUEBANNER, (WPARAM)bKeepWithFocus, (LPARAM)(lpstrText));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETCUEBANNER, (WPARAM)bKeepWithFocus, (LPARAM)(lpstrText));
}
-#endif // (_WIN32_WINNT >= 0x0501)
// Operations
void EmptyUndoBuffer()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_EMPTYUNDOBUFFER, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_EMPTYUNDOBUFFER, 0, 0L);
}
BOOL FmtLines(BOOL bAddEOL)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_FMTLINES, bAddEOL, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_FMTLINES, bAddEOL, 0L);
}
void LimitText(int nChars = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_LIMITTEXT, nChars, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_LIMITTEXT, nChars, 0L);
}
int LineFromChar(int nIndex = -1) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_LINEFROMCHAR, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_LINEFROMCHAR, nIndex, 0L);
}
int LineIndex(int nLine = -1) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_LINEINDEX, nLine, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_LINEINDEX, nLine, 0L);
}
int LineLength(int nLine = -1) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_LINELENGTH, nLine, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_LINELENGTH, nLine, 0L);
}
void LineScroll(int nLines, int nChars = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_LINESCROLL, nChars, nLines);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_LINESCROLL, nChars, nLines);
}
void ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_REPLACESEL, (WPARAM) bCanUndo, (LPARAM)lpszNewText);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_REPLACESEL, (WPARAM) bCanUndo, (LPARAM)lpszNewText);
}
void SetRect(LPCRECT lpRect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETRECT, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETRECT, 0, (LPARAM)lpRect);
}
void SetRectNP(LPCRECT lpRect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETRECTNP, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETRECTNP, 0, (LPARAM)lpRect);
}
void SetSel(DWORD dwSelection, BOOL bNoScroll = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETSEL, LOWORD(dwSelection), HIWORD(dwSelection));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETSEL, LOWORD(dwSelection), HIWORD(dwSelection));
if(!bNoScroll)
- ::SendMessage(m_hWnd, EM_SCROLLCARET, 0, 0L);
+ ::SendMessage(this->m_hWnd, EM_SCROLLCARET, 0, 0L);
}
void SetSel(int nStartChar, int nEndChar, BOOL bNoScroll = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETSEL, nStartChar, nEndChar);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETSEL, nStartChar, nEndChar);
if(!bNoScroll)
- ::SendMessage(m_hWnd, EM_SCROLLCARET, 0, 0L);
+ ::SendMessage(this->m_hWnd, EM_SCROLLCARET, 0, 0L);
}
void SetSelAll(BOOL bNoScroll = FALSE)
@@ -1460,33 +1389,33 @@ class CEditT : public TBase
BOOL SetTabStops(int nTabStops, LPINT rgTabStops)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops);
}
BOOL SetTabStops()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETTABSTOPS, 0, 0L);
}
BOOL SetTabStops(const int& cxEachStop) // takes an 'int'
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop);
}
void ScrollCaret()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SCROLLCARET, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SCROLLCARET, 0, 0L);
}
int Scroll(int nScrollAction)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & ES_MULTILINE) != 0);
- LRESULT lRet = ::SendMessage(m_hWnd, EM_SCROLL, nScrollAction, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & ES_MULTILINE) != 0);
+ LRESULT lRet = ::SendMessage(this->m_hWnd, EM_SCROLL, nScrollAction, 0L);
if(!(BOOL)HIWORD(lRet))
return -1; // failed
return (int)(short)LOWORD(lRet);
@@ -1501,107 +1430,73 @@ class CEditT : public TBase
void AppendText(LPCTSTR lpstrText, BOOL bNoScroll = FALSE, BOOL bCanUndo = FALSE)
{
- InsertText(GetWindowTextLength(), lpstrText, bNoScroll, bCanUndo);
+ InsertText(this->GetWindowTextLength(), lpstrText, bNoScroll, bCanUndo);
}
-#if (_WIN32_WINNT >= 0x0501)
BOOL ShowBalloonTip(PEDITBALLOONTIP pEditBaloonTip)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SHOWBALLOONTIP, 0, (LPARAM)pEditBaloonTip);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SHOWBALLOONTIP, 0, (LPARAM)pEditBaloonTip);
}
BOOL HideBalloonTip()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_HIDEBALLOONTIP, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_HIDEBALLOONTIP, 0, 0L);
}
-#endif // (_WIN32_WINNT >= 0x0501)
#if (_WIN32_WINNT >= 0x0600)
DWORD GetHilite() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, EM_GETHILITE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETHILITE, 0, 0L);
}
void GetHilite(int& nStartChar, int& nEndChar) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, EM_GETHILITE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, EM_GETHILITE, 0, 0L);
nStartChar = (int)(short)LOWORD(dwRet);
nEndChar = (int)(short)HIWORD(dwRet);
}
void SetHilite(int nStartChar, int nEndChar)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETHILITE, nStartChar, nEndChar);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETHILITE, nStartChar, nEndChar);
}
#endif // (_WIN32_WINNT >= 0x0600)
// Clipboard operations
BOOL Undo()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_UNDO, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_UNDO, 0, 0L);
}
void Clear()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, WM_CLEAR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, WM_CLEAR, 0, 0L);
}
void Copy()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, WM_COPY, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, WM_COPY, 0, 0L);
}
void Cut()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, WM_CUT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, WM_CUT, 0, 0L);
}
void Paste()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, WM_PASTE, 0, 0L);
- }
-
-#ifdef WIN32_PLATFORM_WFSP // SmartPhone only messages
- DWORD GetExtendedStyle()
- {
- return SendMessage(EM_GETEXTENDEDSTYLE);
- }
-
- DWORD SetExtendedStyle(DWORD dwMask, DWORD dwExStyle)
- {
- return SendMessage(EM_SETEXTENDEDSTYLE, (WPARAM)dwMask, (LPARAM)dwExStyle);
- }
-
- DWORD GetInputMode(BOOL bCurrentMode = TRUE)
- {
- return SendMessage(EM_GETINPUTMODE, 0, (LPARAM)bCurrentMode);
- }
-
- BOOL SetInputMode(DWORD dwMode)
- {
- return SendMessage(EM_SETINPUTMODE, 0, (LPARAM)dwMode);
- }
-
- BOOL SetSymbols(LPCTSTR szSymbols)
- {
- return SendMessage(EM_SETSYMBOLS, 0, (LPARAM)szSymbols);
- }
-
- BOOL ResetSymbols()
- {
- return SendMessage(EM_SETSYMBOLS);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, WM_PASTE, 0, 0L);
}
-#endif // WIN32_PLATFORM_WFSP
};
typedef CEditT CEdit;
@@ -1717,7 +1612,7 @@ class CEditCommands
BOOL HasSelection() const
{
const T* pT = static_cast(this);
- int nMin, nMax;
+ int nMin = 0, nMax = 0;
::SendMessage(pT->m_hWnd, EM_GETSEL, (WPARAM)&nMin, (LPARAM)&nMax);
return (nMin != nMax);
}
@@ -1743,7 +1638,7 @@ class CScrollBarT : public TBase
CScrollBarT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -1760,83 +1655,70 @@ class CScrollBarT : public TBase
return _T("SCROLLBAR");
}
-#ifndef _WIN32_WCE
int GetScrollPos() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return ::GetScrollPos(m_hWnd, SB_CTL);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return ::GetScrollPos(this->m_hWnd, SB_CTL);
}
-#endif // !_WIN32_WCE
int SetScrollPos(int nPos, BOOL bRedraw = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return ::SetScrollPos(m_hWnd, SB_CTL, nPos, bRedraw);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return ::SetScrollPos(this->m_hWnd, SB_CTL, nPos, bRedraw);
}
-#ifndef _WIN32_WCE
void GetScrollRange(LPINT lpMinPos, LPINT lpMaxPos) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::GetScrollRange(m_hWnd, SB_CTL, lpMinPos, lpMaxPos);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::GetScrollRange(this->m_hWnd, SB_CTL, lpMinPos, lpMaxPos);
}
-#endif // !_WIN32_WCE
void SetScrollRange(int nMinPos, int nMaxPos, BOOL bRedraw = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SetScrollRange(m_hWnd, SB_CTL, nMinPos, nMaxPos, bRedraw);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SetScrollRange(this->m_hWnd, SB_CTL, nMinPos, nMaxPos, bRedraw);
}
BOOL GetScrollInfo(LPSCROLLINFO lpScrollInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return ::GetScrollInfo(m_hWnd, SB_CTL, lpScrollInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return ::GetScrollInfo(this->m_hWnd, SB_CTL, lpScrollInfo);
}
int SetScrollInfo(LPSCROLLINFO lpScrollInfo, BOOL bRedraw = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return ::SetScrollInfo(m_hWnd, SB_CTL, lpScrollInfo, bRedraw);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return ::SetScrollInfo(this->m_hWnd, SB_CTL, lpScrollInfo, bRedraw);
}
-#ifndef _WIN32_WCE
int GetScrollLimit() const
{
- int nMin = 0, nMax = 0;
- ::GetScrollRange(m_hWnd, SB_CTL, &nMin, &nMax);
- SCROLLINFO info = { sizeof(SCROLLINFO), SIF_PAGE };
- if(::GetScrollInfo(m_hWnd, SB_CTL, &info))
- nMax -= ((info.nPage - 1) > 0) ? (info.nPage - 1) : 0;
+ SCROLLINFO info = { sizeof(SCROLLINFO), SIF_RANGE | SIF_PAGE };
+ ::GetScrollInfo(this->m_hWnd, SB_CTL, &info);
+ if(info.nPage > 1)
+ info.nMax -= info.nPage - 1;
- return nMax;
+ return info.nMax;
}
-#if (WINVER >= 0x0500)
BOOL GetScrollBarInfo(PSCROLLBARINFO pScrollBarInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
-#if (_WIN32_WINNT >= 0x0501)
- return (BOOL)::SendMessage(m_hWnd, SBM_GETSCROLLBARINFO, 0, (LPARAM)pScrollBarInfo);
-#else // !(_WIN32_WINNT >= 0x0501)
- return ::GetScrollBarInfo(m_hWnd, OBJID_CLIENT, pScrollBarInfo);
-#endif // !(_WIN32_WINNT >= 0x0501)
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, SBM_GETSCROLLBARINFO, 0, (LPARAM)pScrollBarInfo);
}
-#endif // (WINVER >= 0x0500)
// Operations
void ShowScrollBar(BOOL bShow = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::ShowScrollBar(m_hWnd, SB_CTL, bShow);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::ShowScrollBar(this->m_hWnd, SB_CTL, bShow);
}
BOOL EnableScrollBar(UINT nArrowFlags = ESB_ENABLE_BOTH)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return ::EnableScrollBar(m_hWnd, SB_CTL, nArrowFlags);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return ::EnableScrollBar(this->m_hWnd, SB_CTL, nArrowFlags);
}
-#endif // !_WIN32_WCE
};
typedef CScrollBarT CScrollBar;
@@ -1847,28 +1729,39 @@ typedef CScrollBarT CScrollBar;
///////////////////////////////////////////////////////////////////////////////
// CImageList
-class CImageList
+// forward declarations
+template class CImageListT;
+typedef CImageListT CImageList;
+typedef CImageListT CImageListManaged;
+
+
+template
+class CImageListT
{
public:
+// Data members
HIMAGELIST m_hImageList;
-// Constructor
- CImageList(HIMAGELIST hImageList = NULL) : m_hImageList(hImageList)
+// Constructor/destructor/operators
+ CImageListT(HIMAGELIST hImageList = NULL) : m_hImageList(hImageList)
{ }
-// Operators, etc.
- CImageList& operator =(HIMAGELIST hImageList)
+ ~CImageListT()
{
- m_hImageList = hImageList;
- return *this;
+ if(t_bManaged && (m_hImageList != NULL))
+ Destroy();
}
- operator HIMAGELIST() const { return m_hImageList; }
+ CImageListT& operator =(HIMAGELIST hImageList)
+ {
+ Attach(hImageList);
+ return *this;
+ }
void Attach(HIMAGELIST hImageList)
{
- ATLASSERT(m_hImageList == NULL);
- ATLASSERT(hImageList != NULL);
+ if(t_bManaged && (m_hImageList != NULL) && (m_hImageList != hImageList))
+ ImageList_Destroy(m_hImageList);
m_hImageList = hImageList;
}
@@ -1879,6 +1772,8 @@ class CImageList
return hImageList;
}
+ operator HIMAGELIST() const { return m_hImageList; }
+
bool IsNull() const { return (m_hImageList == NULL); }
// Attributes
@@ -1977,7 +1872,6 @@ class CImageList
return (m_hImageList != NULL) ? TRUE : FALSE;
}
-#ifndef _WIN32_WCE
#ifdef __IStream_INTERFACE_DEFINED__
BOOL CreateFromStream(LPSTREAM lpStream)
{
@@ -1986,7 +1880,6 @@ class CImageList
return (m_hImageList != NULL) ? TRUE : FALSE;
}
#endif // __IStream_INTERFACE_DEFINED__
-#endif // !_WIN32_WCE
BOOL Destroy()
{
@@ -2086,7 +1979,6 @@ class CImageList
}
#ifdef __IStream_INTERFACE_DEFINED__
-#ifndef _WIN32_WCE
static HIMAGELIST Read(LPSTREAM lpStream)
{
return ImageList_Read(lpStream);
@@ -2097,9 +1989,7 @@ class CImageList
ATLASSERT(m_hImageList != NULL);
return ImageList_Write(m_hImageList, lpStream);
}
-#endif // !_WIN32_WCE
-#if (_WIN32_WINNT >= 0x0501)
static HRESULT ReadEx(DWORD dwFlags, LPSTREAM lpStream, REFIID riid, PVOID* ppv)
{
return ImageList_ReadEx(dwFlags, lpStream, riid, ppv);
@@ -2110,7 +2000,6 @@ class CImageList
ATLASSERT(m_hImageList != NULL);
return ImageList_WriteEx(m_hImageList, dwFlags, lpStream);
}
-#endif // (_WIN32_WINNT >= 0x0501)
#endif // __IStream_INTERFACE_DEFINED__
// Drag operations
@@ -2178,7 +2067,6 @@ class CImageList
return ImageList_DragLeave(hWnd);
}
-#if (_WIN32_IE >= 0x0400)
CImageList Duplicate() const
{
ATLASSERT(m_hImageList != NULL);
@@ -2190,19 +2078,16 @@ class CImageList
ATLASSERT(hImageList != NULL);
return CImageList(ImageList_Duplicate(hImageList));
}
-#endif // (_WIN32_IE >= 0x0400)
};
///////////////////////////////////////////////////////////////////////////////
// CToolTipCtrl
-#ifndef _WIN32_WCE
-
class CToolInfo : public TOOLINFO
{
public:
- CToolInfo(UINT nFlags, HWND hWnd, UINT nIDTool = 0, LPRECT lpRect = NULL, LPTSTR lpstrText = LPSTR_TEXTCALLBACK, LPARAM lUserParam = NULL)
+ CToolInfo(UINT nFlags, HWND hWnd, UINT_PTR nIDTool = 0, LPRECT lpRect = NULL, LPTSTR lpstrText = LPSTR_TEXTCALLBACK, LPARAM lUserParam = NULL)
{
Init(nFlags, hWnd, nIDTool, lpRect, lpstrText, lUserParam);
}
@@ -2211,11 +2096,11 @@ class CToolInfo : public TOOLINFO
operator LPARAM() { return (LPARAM)this; }
- void Init(UINT nFlags, HWND hWnd, UINT nIDTool = 0, LPRECT lpRect = NULL, LPTSTR lpstrText = LPSTR_TEXTCALLBACK, LPARAM lUserParam = NULL)
+ void Init(UINT nFlags, HWND hWnd, UINT_PTR nIDTool = 0, LPRECT lpRect = NULL, LPTSTR lpstrText = LPSTR_TEXTCALLBACK, LPARAM lUserParam = NULL)
{
ATLASSERT(::IsWindow(hWnd));
memset(this, 0, sizeof(TOOLINFO));
- cbSize = sizeof(TOOLINFO);
+ cbSize = RunTimeHelper::SizeOf_TOOLINFO();
uFlags = nFlags;
if(nIDTool == 0)
{
@@ -2246,7 +2131,7 @@ class CToolTipCtrlT : public TBase
CToolTipCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -2265,32 +2150,32 @@ class CToolTipCtrlT : public TBase
void GetText(LPTOOLINFO lpToolInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_GETTEXT, 0, (LPARAM)&lpToolInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_GETTEXT, 0, (LPARAM)&lpToolInfo);
}
- void GetText(LPTSTR lpstrText, HWND hWnd, UINT nIDTool = 0) const
+ void GetText(LPTSTR lpstrText, HWND hWnd, UINT_PTR nIDTool = 0) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(hWnd != NULL);
CToolInfo ti(0, hWnd, nIDTool, NULL, lpstrText);
- ::SendMessage(m_hWnd, TTM_GETTEXT, 0, ti);
+ ::SendMessage(this->m_hWnd, TTM_GETTEXT, 0, ti);
}
BOOL GetToolInfo(LPTOOLINFO lpToolInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TTM_GETTOOLINFO, 0, (LPARAM)lpToolInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TTM_GETTOOLINFO, 0, (LPARAM)lpToolInfo);
}
- BOOL GetToolInfo(HWND hWnd, UINT nIDTool, UINT* puFlags, LPRECT lpRect, LPTSTR lpstrText) const
+ BOOL GetToolInfo(HWND hWnd, UINT_PTR nIDTool, UINT* puFlags, LPRECT lpRect, LPTSTR lpstrText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(hWnd != NULL);
ATLASSERT(puFlags != NULL);
ATLASSERT(lpRect != NULL);
CToolInfo ti(0, hWnd, nIDTool, NULL, lpstrText);
- BOOL bRet = (BOOL)::SendMessage(m_hWnd, TTM_GETTOOLINFO, 0, ti);
+ BOOL bRet = (BOOL)::SendMessage(this->m_hWnd, TTM_GETTOOLINFO, 0, ti);
if(bRet != FALSE)
{
*puFlags = ti.uFlags;
@@ -2301,185 +2186,188 @@ class CToolTipCtrlT : public TBase
void SetToolInfo(LPTOOLINFO lpToolInfo)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_SETTOOLINFO, 0, (LPARAM)lpToolInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_SETTOOLINFO, 0, (LPARAM)lpToolInfo);
}
void SetToolRect(LPTOOLINFO lpToolInfo)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_NEWTOOLRECT, 0, (LPARAM)lpToolInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_NEWTOOLRECT, 0, (LPARAM)lpToolInfo);
}
- void SetToolRect(HWND hWnd, UINT nIDTool, LPCRECT lpRect)
+ void SetToolRect(HWND hWnd, UINT_PTR nIDTool, LPCRECT lpRect)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(hWnd != NULL);
ATLASSERT(nIDTool != 0);
CToolInfo ti(0, hWnd, nIDTool, (LPRECT)lpRect, NULL);
- ::SendMessage(m_hWnd, TTM_NEWTOOLRECT, 0, ti);
+ ::SendMessage(this->m_hWnd, TTM_NEWTOOLRECT, 0, ti);
}
int GetToolCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TTM_GETTOOLCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TTM_GETTOOLCOUNT, 0, 0L);
}
int GetDelayTime(DWORD dwType) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TTM_GETDELAYTIME, dwType, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TTM_GETDELAYTIME, dwType, 0L);
}
void SetDelayTime(DWORD dwType, int nTime)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_SETDELAYTIME, dwType, MAKELPARAM(nTime, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_SETDELAYTIME, dwType, MAKELPARAM(nTime, 0));
}
void GetMargin(LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_GETMARGIN, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_GETMARGIN, 0, (LPARAM)lpRect);
}
void SetMargin(LPRECT lpRect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_SETMARGIN, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_SETMARGIN, 0, (LPARAM)lpRect);
}
int GetMaxTipWidth() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TTM_GETMAXTIPWIDTH, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TTM_GETMAXTIPWIDTH, 0, 0L);
}
int SetMaxTipWidth(int nWidth)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TTM_SETMAXTIPWIDTH, 0, nWidth);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TTM_SETMAXTIPWIDTH, 0, nWidth);
}
COLORREF GetTipBkColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, TTM_GETTIPBKCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, TTM_GETTIPBKCOLOR, 0, 0L);
}
void SetTipBkColor(COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_SETTIPBKCOLOR, (WPARAM)clr, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_SETTIPBKCOLOR, (WPARAM)clr, 0L);
}
COLORREF GetTipTextColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, TTM_GETTIPTEXTCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, TTM_GETTIPTEXTCOLOR, 0, 0L);
}
void SetTipTextColor(COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_SETTIPTEXTCOLOR, (WPARAM)clr, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_SETTIPTEXTCOLOR, (WPARAM)clr, 0L);
}
BOOL GetCurrentTool(LPTOOLINFO lpToolInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TTM_GETCURRENTTOOL, 0, (LPARAM)lpToolInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TTM_GETCURRENTTOOL, 0, (LPARAM)lpToolInfo);
}
-#if (_WIN32_IE >= 0x0500)
SIZE GetBubbleSize(LPTOOLINFO lpToolInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, TTM_GETBUBBLESIZE, 0, (LPARAM)lpToolInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, TTM_GETBUBBLESIZE, 0, (LPARAM)lpToolInfo);
SIZE size = { GET_X_LPARAM(dwRet), GET_Y_LPARAM(dwRet) };
return size;
}
- BOOL SetTitle(UINT uIcon, LPCTSTR lpstrTitle)
+ BOOL SetTitle(UINT_PTR uIcon, LPCTSTR lpstrTitle)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TTM_SETTITLE, uIcon, (LPARAM)lpstrTitle);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TTM_SETTITLE, uIcon, (LPARAM)lpstrTitle);
+ }
+
+
+ BOOL SetTitle(HICON hIcon, LPCTSTR lpstrTitle)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TTM_SETTITLE, (WPARAM)hIcon, (LPARAM)lpstrTitle);
}
-#endif // (_WIN32_IE >= 0x0500)
-#if (_WIN32_WINNT >= 0x0501)
void GetTitle(PTTGETTITLE pTTGetTitle) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_GETTITLE, 0, (LPARAM)pTTGetTitle);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_GETTITLE, 0, (LPARAM)pTTGetTitle);
}
void SetWindowTheme(LPCWSTR lpstrTheme)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);
}
-#endif // (_WIN32_WINNT >= 0x0501)
// Operations
void Activate(BOOL bActivate)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_ACTIVATE, bActivate, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_ACTIVATE, bActivate, 0L);
}
BOOL AddTool(LPTOOLINFO lpToolInfo)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TTM_ADDTOOL, 0, (LPARAM)lpToolInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TTM_ADDTOOL, 0, (LPARAM)lpToolInfo);
}
- BOOL AddTool(HWND hWnd, ATL::_U_STRINGorID text = LPSTR_TEXTCALLBACK, LPCRECT lpRectTool = NULL, UINT nIDTool = 0)
+ BOOL AddTool(HWND hWnd, ATL::_U_STRINGorID text = LPSTR_TEXTCALLBACK, LPCRECT lpRectTool = NULL, UINT_PTR nIDTool = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(hWnd != NULL);
// the toolrect and toolid must both be zero or both valid
- ATLASSERT((lpRectTool != NULL && nIDTool != 0) || (lpRectTool == NULL && nIDTool == 0));
+ ATLASSERT(((lpRectTool != NULL) && (nIDTool != 0)) || ((lpRectTool == NULL) && (nIDTool == 0)));
CToolInfo ti(0, hWnd, nIDTool, (LPRECT)lpRectTool, (LPTSTR)text.m_lpstr);
- return (BOOL)::SendMessage(m_hWnd, TTM_ADDTOOL, 0, ti);
+ return (BOOL)::SendMessage(this->m_hWnd, TTM_ADDTOOL, 0, ti);
}
void DelTool(LPTOOLINFO lpToolInfo)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_DELTOOL, 0, (LPARAM)lpToolInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_DELTOOL, 0, (LPARAM)lpToolInfo);
}
- void DelTool(HWND hWnd, UINT nIDTool = 0)
+ void DelTool(HWND hWnd, UINT_PTR nIDTool = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(hWnd != NULL);
CToolInfo ti(0, hWnd, nIDTool, NULL, NULL);
- ::SendMessage(m_hWnd, TTM_DELTOOL, 0, ti);
+ ::SendMessage(this->m_hWnd, TTM_DELTOOL, 0, ti);
}
BOOL HitTest(LPTTHITTESTINFO lpHitTestInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TTM_HITTEST, 0, (LPARAM)lpHitTestInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TTM_HITTEST, 0, (LPARAM)lpHitTestInfo);
}
BOOL HitTest(HWND hWnd, POINT pt, LPTOOLINFO lpToolInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(hWnd != NULL);
ATLASSERT(lpToolInfo != NULL);
TTHITTESTINFO hti = { 0 };
- hti.ti.cbSize = sizeof(TOOLINFO);
+ hti.ti.cbSize = RunTimeHelper::SizeOf_TOOLINFO();
hti.hwnd = hWnd;
hti.pt.x = pt.x;
hti.pt.y = pt.y;
- if((BOOL)::SendMessage(m_hWnd, TTM_HITTEST, 0, (LPARAM)&hti) != FALSE)
+ if((BOOL)::SendMessage(this->m_hWnd, TTM_HITTEST, 0, (LPARAM)&hti) != FALSE)
{
*lpToolInfo = hti.ti;
return TRUE;
@@ -2489,78 +2377,79 @@ class CToolTipCtrlT : public TBase
void RelayEvent(LPMSG lpMsg)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_RELAYEVENT, 0, (LPARAM)lpMsg);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_RELAYEVENT, 0, (LPARAM)lpMsg);
}
void UpdateTipText(LPTOOLINFO lpToolInfo)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_UPDATETIPTEXT, 0, (LPARAM)lpToolInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_UPDATETIPTEXT, 0, (LPARAM)lpToolInfo);
}
- void UpdateTipText(ATL::_U_STRINGorID text, HWND hWnd, UINT nIDTool = 0)
+ void UpdateTipText(ATL::_U_STRINGorID text, HWND hWnd, UINT_PTR nIDTool = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(hWnd != NULL);
CToolInfo ti(0, hWnd, nIDTool, NULL, (LPTSTR)text.m_lpstr);
- ::SendMessage(m_hWnd, TTM_UPDATETIPTEXT, 0, ti);
+ ::SendMessage(this->m_hWnd, TTM_UPDATETIPTEXT, 0, ti);
}
- BOOL EnumTools(UINT nTool, LPTOOLINFO lpToolInfo) const
+ BOOL EnumTools(UINT_PTR nTool, LPTOOLINFO lpToolInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TTM_ENUMTOOLS, nTool, (LPARAM)lpToolInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TTM_ENUMTOOLS, nTool, (LPARAM)lpToolInfo);
}
void Pop()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_POP, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_POP, 0, 0L);
}
void TrackActivate(LPTOOLINFO lpToolInfo, BOOL bActivate)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_TRACKACTIVATE, bActivate, (LPARAM)lpToolInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_TRACKACTIVATE, bActivate, (LPARAM)lpToolInfo);
+ }
+
+ void TrackActivate(HWND hWnd, UINT_PTR nIDTool, BOOL bActivate)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT(hWnd != NULL);
+
+ CToolInfo ti(0, hWnd, nIDTool);
+ ::SendMessage(this->m_hWnd, TTM_TRACKACTIVATE, bActivate, ti);
}
void TrackPosition(int xPos, int yPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_TRACKPOSITION, 0, MAKELPARAM(xPos, yPos));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_TRACKPOSITION, 0, MAKELPARAM(xPos, yPos));
}
-#if (_WIN32_IE >= 0x0400)
void Update()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_UPDATE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_UPDATE, 0, 0L);
}
-#endif // (_WIN32_IE >= 0x0400)
-#if (_WIN32_IE >= 0x0500)
BOOL AdjustRect(LPRECT lpRect, BOOL bLarger /*= TRUE*/)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TTM_ADJUSTRECT, bLarger, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TTM_ADJUSTRECT, bLarger, (LPARAM)lpRect);
}
-#endif // (_WIN32_IE >= 0x0500)
-#if (_WIN32_WINNT >= 0x0501)
void Popup()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TTM_POPUP, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TTM_POPUP, 0, 0L);
}
-#endif // (_WIN32_WINNT >= 0x0501)
};
typedef CToolTipCtrlT CToolTipCtrl;
-#endif // !_WIN32_WCE
-
///////////////////////////////////////////////////////////////////////////////
// CHeaderCtrl
@@ -2575,7 +2464,7 @@ class CHeaderCtrlT : public TBase
CHeaderCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -2594,123 +2483,119 @@ class CHeaderCtrlT : public TBase
int GetItemCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, HDM_GETITEMCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, HDM_GETITEMCOUNT, 0, 0L);
}
BOOL GetItem(int nIndex, LPHDITEM pHeaderItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, HDM_GETITEM, nIndex, (LPARAM)pHeaderItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, HDM_GETITEM, nIndex, (LPARAM)pHeaderItem);
}
BOOL SetItem(int nIndex, LPHDITEM pHeaderItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, HDM_SETITEM, nIndex, (LPARAM)pHeaderItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, HDM_SETITEM, nIndex, (LPARAM)pHeaderItem);
}
CImageList GetImageList() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, HDM_GETIMAGELIST, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, HDM_GETIMAGELIST, 0, 0L));
}
CImageList SetImageList(HIMAGELIST hImageList)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, HDM_SETIMAGELIST, 0, (LPARAM)hImageList));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, HDM_SETIMAGELIST, 0, (LPARAM)hImageList));
}
BOOL GetOrderArray(int nSize, int* lpnArray) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, HDM_GETORDERARRAY, nSize, (LPARAM)lpnArray);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, HDM_GETORDERARRAY, nSize, (LPARAM)lpnArray);
}
BOOL SetOrderArray(int nSize, int* lpnArray)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, HDM_SETORDERARRAY, nSize, (LPARAM)lpnArray);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, HDM_SETORDERARRAY, nSize, (LPARAM)lpnArray);
}
BOOL GetItemRect(int nIndex, LPRECT lpItemRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, HDM_GETITEMRECT, nIndex, (LPARAM)lpItemRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, HDM_GETITEMRECT, nIndex, (LPARAM)lpItemRect);
}
int SetHotDivider(BOOL bPos, DWORD dwInputValue)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, HDM_SETHOTDIVIDER, bPos, dwInputValue);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, HDM_SETHOTDIVIDER, bPos, dwInputValue);
}
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
BOOL GetUnicodeFormat() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, HDM_GETUNICODEFORMAT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, HDM_GETUNICODEFORMAT, 0, 0L);
}
BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, HDM_SETUNICODEFORMAT, bUnicode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, HDM_SETUNICODEFORMAT, bUnicode, 0L);
}
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
int GetBitmapMargin() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, HDM_GETBITMAPMARGIN, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, HDM_GETBITMAPMARGIN, 0, 0L);
}
int SetBitmapMargin(int nWidth)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, HDM_SETBITMAPMARGIN, nWidth, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, HDM_SETBITMAPMARGIN, nWidth, 0L);
}
int SetFilterChangeTimeout(DWORD dwTimeOut)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, HDM_SETFILTERCHANGETIMEOUT, 0, dwTimeOut);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, HDM_SETFILTERCHANGETIMEOUT, 0, dwTimeOut);
}
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
#if (_WIN32_WINNT >= 0x0600)
BOOL GetItemDropDownRect(int nIndex, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, HDM_GETITEMDROPDOWNRECT, nIndex, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, HDM_GETITEMDROPDOWNRECT, nIndex, (LPARAM)lpRect);
}
BOOL GetOverflowRect(LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, HDM_GETOVERFLOWRECT, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, HDM_GETOVERFLOWRECT, 0, (LPARAM)lpRect);
}
int GetFocusedItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, HDM_GETFOCUSEDITEM, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, HDM_GETFOCUSEDITEM, 0, 0L);
}
BOOL SetFocusedItem(int nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, HDM_SETFOCUSEDITEM, 0, nIndex);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, HDM_SETFOCUSEDITEM, 0, nIndex);
}
#endif // (_WIN32_WINNT >= 0x0600)
// Operations
int InsertItem(int nIndex, LPHDITEM phdi)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, HDM_INSERTITEM, nIndex, (LPARAM)phdi);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, HDM_INSERTITEM, nIndex, (LPARAM)phdi);
}
int AddItem(LPHDITEM phdi)
@@ -2720,53 +2605,51 @@ class CHeaderCtrlT : public TBase
BOOL DeleteItem(int nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, HDM_DELETEITEM, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, HDM_DELETEITEM, nIndex, 0L);
}
BOOL Layout(HD_LAYOUT* pHeaderLayout)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, HDM_LAYOUT, 0, (LPARAM)pHeaderLayout);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, HDM_LAYOUT, 0, (LPARAM)pHeaderLayout);
}
int HitTest(LPHDHITTESTINFO lpHitTestInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, HDM_HITTEST, 0, (LPARAM)lpHitTestInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, HDM_HITTEST, 0, (LPARAM)lpHitTestInfo);
}
int OrderToIndex(int nOrder)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, HDM_ORDERTOINDEX, nOrder, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, HDM_ORDERTOINDEX, nOrder, 0L);
}
CImageList CreateDragImage(int nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, HDM_CREATEDRAGIMAGE, nIndex, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, HDM_CREATEDRAGIMAGE, nIndex, 0L));
}
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
int EditFilter(int nColumn, BOOL bDiscardChanges)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, HDM_EDITFILTER, nColumn, MAKELPARAM(bDiscardChanges, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, HDM_EDITFILTER, nColumn, MAKELPARAM(bDiscardChanges, 0));
}
int ClearFilter(int nColumn)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, HDM_CLEARFILTER, nColumn, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, HDM_CLEARFILTER, nColumn, 0L);
}
int ClearAllFilters()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, HDM_CLEARFILTER, (WPARAM)-1, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, HDM_CLEARFILTER, (WPARAM)-1, 0L);
}
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
};
typedef CHeaderCtrlT CHeaderCtrl;
@@ -2785,7 +2668,7 @@ class CListViewCtrlT : public TBase
CListViewCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -2804,56 +2687,56 @@ class CListViewCtrlT : public TBase
COLORREF GetBkColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, LVM_GETBKCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, LVM_GETBKCOLOR, 0, 0L);
}
BOOL SetBkColor(COLORREF cr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETBKCOLOR, 0, cr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETBKCOLOR, 0, cr);
}
CImageList GetImageList(int nImageListType) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, LVM_GETIMAGELIST, nImageListType, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, LVM_GETIMAGELIST, nImageListType, 0L));
}
CImageList SetImageList(HIMAGELIST hImageList, int nImageList)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, LVM_SETIMAGELIST, nImageList, (LPARAM)hImageList));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, LVM_SETIMAGELIST, nImageList, (LPARAM)hImageList));
}
int GetItemCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETITEMCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETITEMCOUNT, 0, 0L);
}
BOOL SetItemCount(int nItems)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMCOUNT, nItems, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMCOUNT, nItems, 0L);
}
BOOL GetItem(LPLVITEM pItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETITEM, 0, (LPARAM)pItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETITEM, 0, (LPARAM)pItem);
}
BOOL SetItem(const LVITEM* pItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETITEM, 0, (LPARAM)pItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEM, 0, (LPARAM)pItem);
}
BOOL SetItem(int nItem, int nSubItem, UINT nMask, LPCTSTR lpszItem,
int nImage, UINT nState, UINT nStateMask, LPARAM lParam)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
LVITEM lvi = { 0 };
lvi.mask = nMask;
lvi.iItem = nItem;
@@ -2863,35 +2746,34 @@ class CListViewCtrlT : public TBase
lvi.pszText = (LPTSTR) lpszItem;
lvi.iImage = nImage;
lvi.lParam = lParam;
- return (BOOL)::SendMessage(m_hWnd, LVM_SETITEM, 0, (LPARAM)&lvi);
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEM, 0, (LPARAM)&lvi);
}
UINT GetItemState(int nItem, UINT nMask) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, LVM_GETITEMSTATE, nItem, nMask);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, LVM_GETITEMSTATE, nItem, nMask);
}
BOOL SetItemState(int nItem, UINT nState, UINT nStateMask)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
LVITEM lvi = { 0 };
lvi.state = nState;
lvi.stateMask = nStateMask;
- return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMSTATE, nItem, (LPARAM)&lvi);
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMSTATE, nItem, (LPARAM)&lvi);
}
BOOL SetItemState(int nItem, LPLVITEM pItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMSTATE, nItem, (LPARAM)pItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMSTATE, nItem, (LPARAM)pItem);
}
-#ifndef _ATL_NO_COM
BOOL GetItemText(int nItem, int nSubItem, BSTR& bstrText) const
{
USES_CONVERSION;
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(bstrText == NULL);
LVITEM lvi = { 0 };
lvi.iSubItem = nSubItem;
@@ -2906,7 +2788,7 @@ class CListViewCtrlT : public TBase
lpstrText[0] = NULL;
lvi.cchTextMax = nLen;
lvi.pszText = lpstrText;
- nRes = (int)::SendMessage(m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);
+ nRes = (int)::SendMessage(this->m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);
if(nRes < nLen - 1)
break;
delete [] lpstrText;
@@ -2922,12 +2804,11 @@ class CListViewCtrlT : public TBase
return (bstrText != NULL) ? TRUE : FALSE;
}
-#endif // !_ATL_NO_COM
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
- int GetItemText(int nItem, int nSubItem, _CSTRING_NS::CString& strText) const
+#ifdef __ATLSTR_H__
+ int GetItemText(int nItem, int nSubItem, ATL::CString& strText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
LVITEM lvi = { 0 };
lvi.iSubItem = nSubItem;
@@ -2942,297 +2823,287 @@ class CListViewCtrlT : public TBase
nRes = 0;
break;
}
- nRes = (int)::SendMessage(m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);
+ nRes = (int)::SendMessage(this->m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);
if(nRes < nLen - 1)
break;
}
strText.ReleaseBuffer();
return nRes;
}
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
+#endif // __ATLSTR_H__
int GetItemText(int nItem, int nSubItem, LPTSTR lpszText, int nLen) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
LVITEM lvi = { 0 };
lvi.iSubItem = nSubItem;
lvi.cchTextMax = nLen;
lvi.pszText = lpszText;
- return (int)::SendMessage(m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);
+ return (int)::SendMessage(this->m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);
}
BOOL SetItemText(int nItem, int nSubItem, LPCTSTR lpszText)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return SetItem(nItem, nSubItem, LVIF_TEXT, lpszText, 0, 0, 0, 0);
}
DWORD_PTR GetItemData(int nItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
LVITEM lvi = { 0 };
lvi.iItem = nItem;
lvi.mask = LVIF_PARAM;
- BOOL bRet = (BOOL)::SendMessage(m_hWnd, LVM_GETITEM, 0, (LPARAM)&lvi);
+ BOOL bRet = (BOOL)::SendMessage(this->m_hWnd, LVM_GETITEM, 0, (LPARAM)&lvi);
return (DWORD_PTR)(bRet ? lvi.lParam : NULL);
}
BOOL SetItemData(int nItem, DWORD_PTR dwData)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return SetItem(nItem, 0, LVIF_PARAM, NULL, 0, 0, 0, (LPARAM)dwData);
}
UINT GetCallbackMask() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, LVM_GETCALLBACKMASK, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, LVM_GETCALLBACKMASK, 0, 0L);
}
BOOL SetCallbackMask(UINT nMask)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETCALLBACKMASK, nMask, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETCALLBACKMASK, nMask, 0L);
}
BOOL GetItemPosition(int nItem, LPPOINT lpPoint) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETITEMPOSITION, nItem, (LPARAM)lpPoint);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETITEMPOSITION, nItem, (LPARAM)lpPoint);
}
BOOL SetItemPosition(int nItem, POINT pt)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT(((GetStyle() & LVS_TYPEMASK) == LVS_ICON) || ((GetStyle() & LVS_TYPEMASK) == LVS_SMALLICON));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMPOSITION32, nItem, (LPARAM)&pt);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT(((this->GetStyle() & LVS_TYPEMASK) == LVS_ICON) || ((this->GetStyle() & LVS_TYPEMASK) == LVS_SMALLICON));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMPOSITION32, nItem, (LPARAM)&pt);
}
BOOL SetItemPosition(int nItem, int x, int y)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT(((GetStyle() & LVS_TYPEMASK) == LVS_ICON) || ((GetStyle() & LVS_TYPEMASK) == LVS_SMALLICON));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT(((this->GetStyle() & LVS_TYPEMASK) == LVS_ICON) || ((this->GetStyle() & LVS_TYPEMASK) == LVS_SMALLICON));
POINT pt = { x, y };
- return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMPOSITION32, nItem, (LPARAM)&pt);
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMPOSITION32, nItem, (LPARAM)&pt);
}
int GetStringWidth(LPCTSTR lpsz) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETSTRINGWIDTH, 0, (LPARAM)lpsz);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETSTRINGWIDTH, 0, (LPARAM)lpsz);
}
CEdit GetEditControl() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CEdit((HWND)::SendMessage(m_hWnd, LVM_GETEDITCONTROL, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CEdit((HWND)::SendMessage(this->m_hWnd, LVM_GETEDITCONTROL, 0, 0L));
}
BOOL GetColumn(int nCol, LVCOLUMN* pColumn) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETCOLUMN, nCol, (LPARAM)pColumn);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETCOLUMN, nCol, (LPARAM)pColumn);
}
BOOL SetColumn(int nCol, const LVCOLUMN* pColumn)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETCOLUMN, nCol, (LPARAM)pColumn);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETCOLUMN, nCol, (LPARAM)pColumn);
}
int GetColumnWidth(int nCol) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETCOLUMNWIDTH, nCol, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETCOLUMNWIDTH, nCol, 0L);
}
BOOL SetColumnWidth(int nCol, int cx)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETCOLUMNWIDTH, nCol, MAKELPARAM(cx, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETCOLUMNWIDTH, nCol, MAKELPARAM(cx, 0));
}
BOOL GetViewRect(LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETVIEWRECT, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETVIEWRECT, 0, (LPARAM)lpRect);
}
COLORREF GetTextColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, LVM_GETTEXTCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, LVM_GETTEXTCOLOR, 0, 0L);
}
BOOL SetTextColor(COLORREF cr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETTEXTCOLOR, 0, cr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETTEXTCOLOR, 0, cr);
}
COLORREF GetTextBkColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, LVM_GETTEXTBKCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, LVM_GETTEXTBKCOLOR, 0, 0L);
}
BOOL SetTextBkColor(COLORREF cr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETTEXTBKCOLOR, 0, cr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETTEXTBKCOLOR, 0, cr);
}
int GetTopIndex() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETTOPINDEX, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETTOPINDEX, 0, 0L);
}
int GetCountPerPage() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETCOUNTPERPAGE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETCOUNTPERPAGE, 0, 0L);
}
BOOL GetOrigin(LPPOINT lpPoint) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETORIGIN, 0, (LPARAM)lpPoint);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETORIGIN, 0, (LPARAM)lpPoint);
}
UINT GetSelectedCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, LVM_GETSELECTEDCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, LVM_GETSELECTEDCOUNT, 0, 0L);
}
BOOL GetItemRect(int nItem, LPRECT lpRect, UINT nCode) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
lpRect->left = nCode;
- return (BOOL)::SendMessage(m_hWnd, LVM_GETITEMRECT, (WPARAM)nItem, (LPARAM)lpRect);
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETITEMRECT, (WPARAM)nItem, (LPARAM)lpRect);
}
-#ifndef _WIN32_WCE
HCURSOR GetHotCursor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HCURSOR)::SendMessage(m_hWnd, LVM_GETHOTCURSOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HCURSOR)::SendMessage(this->m_hWnd, LVM_GETHOTCURSOR, 0, 0L);
}
HCURSOR SetHotCursor(HCURSOR hHotCursor)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HCURSOR)::SendMessage(m_hWnd, LVM_SETHOTCURSOR, 0, (LPARAM)hHotCursor);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HCURSOR)::SendMessage(this->m_hWnd, LVM_SETHOTCURSOR, 0, (LPARAM)hHotCursor);
}
int GetHotItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETHOTITEM, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETHOTITEM, 0, 0L);
}
int SetHotItem(int nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_SETHOTITEM, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_SETHOTITEM, nIndex, 0L);
}
-#endif // !_WIN32_WCE
BOOL GetColumnOrderArray(int nCount, int* lpnArray) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETCOLUMNORDERARRAY, nCount, (LPARAM)lpnArray);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETCOLUMNORDERARRAY, nCount, (LPARAM)lpnArray);
}
BOOL SetColumnOrderArray(int nCount, int* lpnArray)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETCOLUMNORDERARRAY, nCount, (LPARAM)lpnArray);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETCOLUMNORDERARRAY, nCount, (LPARAM)lpnArray);
}
CHeaderCtrl GetHeader() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CHeaderCtrl((HWND)::SendMessage(m_hWnd, LVM_GETHEADER, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CHeaderCtrl((HWND)::SendMessage(this->m_hWnd, LVM_GETHEADER, 0, 0L));
}
BOOL GetSubItemRect(int nItem, int nSubItem, int nFlag, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & LVS_TYPEMASK) == LVS_REPORT);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & LVS_TYPEMASK) == LVS_REPORT);
ATLASSERT(lpRect != NULL);
lpRect->top = nSubItem;
lpRect->left = nFlag;
- return (BOOL)::SendMessage(m_hWnd, LVM_GETSUBITEMRECT, nItem, (LPARAM)lpRect);
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETSUBITEMRECT, nItem, (LPARAM)lpRect);
}
DWORD SetIconSpacing(int cx, int cy)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & LVS_TYPEMASK) == LVS_ICON);
- return (DWORD)::SendMessage(m_hWnd, LVM_SETICONSPACING, 0, MAKELPARAM(cx, cy));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & LVS_TYPEMASK) == LVS_ICON);
+ return (DWORD)::SendMessage(this->m_hWnd, LVM_SETICONSPACING, 0, MAKELPARAM(cx, cy));
}
int GetISearchString(LPTSTR lpstr) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETISEARCHSTRING, 0, (LPARAM)lpstr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETISEARCHSTRING, 0, (LPARAM)lpstr);
}
void GetItemSpacing(SIZE& sizeSpacing, BOOL bSmallIconView = FALSE) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, LVM_GETITEMSPACING, bSmallIconView, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, LVM_GETITEMSPACING, bSmallIconView, 0L);
sizeSpacing.cx = GET_X_LPARAM(dwRet);
sizeSpacing.cy = GET_Y_LPARAM(dwRet);
}
-#if (_WIN32_WCE >= 410)
- void SetItemSpacing(INT cySpacing)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- ListView_SetItemSpacing(m_hWnd, cySpacing);
- }
-#endif // (_WIN32_WCE >= 410)
-
// single-selection only
int GetSelectedIndex() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & LVS_SINGLESEL) != 0);
- return (int)::SendMessage(m_hWnd, LVM_GETNEXTITEM, (WPARAM)-1, MAKELPARAM(LVNI_ALL | LVNI_SELECTED, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & LVS_SINGLESEL) != 0);
+ return (int)::SendMessage(this->m_hWnd, LVM_GETNEXTITEM, (WPARAM)-1, MAKELPARAM(LVNI_ALL | LVNI_SELECTED, 0));
}
BOOL GetSelectedItem(LPLVITEM pItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & LVS_SINGLESEL) != 0);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & LVS_SINGLESEL) != 0);
ATLASSERT(pItem != NULL);
- pItem->iItem = (int)::SendMessage(m_hWnd, LVM_GETNEXTITEM, (WPARAM)-1, MAKELPARAM(LVNI_ALL | LVNI_SELECTED, 0));
+ pItem->iItem = (int)::SendMessage(this->m_hWnd, LVM_GETNEXTITEM, (WPARAM)-1, MAKELPARAM(LVNI_ALL | LVNI_SELECTED, 0));
if(pItem->iItem == -1)
return FALSE;
- return (BOOL)::SendMessage(m_hWnd, LVM_GETITEM, 0, (LPARAM)pItem);
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETITEM, 0, (LPARAM)pItem);
}
// extended list view styles
DWORD GetExtendedListViewStyle() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0L);
}
// dwExMask = 0 means all styles
DWORD SetExtendedListViewStyle(DWORD dwExStyle, DWORD dwExMask = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, dwExMask, dwExStyle);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, dwExMask, dwExStyle);
}
// checkboxes only
BOOL GetCheckState(int nIndex) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT((GetExtendedListViewStyle() & LVS_EX_CHECKBOXES) != 0);
UINT uRet = GetItemState(nIndex, LVIS_STATEIMAGEMASK);
return (uRet >> 12) - 1;
@@ -3247,304 +3118,294 @@ class CListViewCtrlT : public TBase
// view type
DWORD GetViewType() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (GetStyle() & LVS_TYPEMASK);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (this->GetStyle() & LVS_TYPEMASK);
}
DWORD SetViewType(DWORD dwType)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT(dwType == LVS_ICON || dwType == LVS_SMALLICON || dwType == LVS_LIST || dwType == LVS_REPORT);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((dwType == LVS_ICON) || (dwType == LVS_SMALLICON) || (dwType == LVS_LIST) || (dwType == LVS_REPORT));
DWORD dwOldType = GetViewType();
if(dwType != dwOldType)
ModifyStyle(LVS_TYPEMASK, (dwType & LVS_TYPEMASK));
return dwOldType;
}
-#if (_WIN32_IE >= 0x0400)
-#ifndef _WIN32_WCE
BOOL GetBkImage(LPLVBKIMAGE plvbki) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETBKIMAGE, 0, (LPARAM)plvbki);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETBKIMAGE, 0, (LPARAM)plvbki);
}
BOOL SetBkImage(LPLVBKIMAGE plvbki)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETBKIMAGE, 0, (LPARAM)plvbki);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETBKIMAGE, 0, (LPARAM)plvbki);
}
-#endif // !_WIN32_WCE
int GetSelectionMark() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETSELECTIONMARK, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETSELECTIONMARK, 0, 0L);
}
int SetSelectionMark(int nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_SETSELECTIONMARK, 0, nIndex);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_SETSELECTIONMARK, 0, nIndex);
}
-#ifndef _WIN32_WCE
BOOL GetWorkAreas(int nWorkAreas, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETWORKAREAS, nWorkAreas, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETWORKAREAS, nWorkAreas, (LPARAM)lpRect);
}
BOOL SetWorkAreas(int nWorkAreas, LPRECT lpRect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETWORKAREAS, nWorkAreas, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETWORKAREAS, nWorkAreas, (LPARAM)lpRect);
}
DWORD GetHoverTime() const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT((GetExtendedListViewStyle() & (LVS_EX_TRACKSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_TWOCLICKACTIVATE)) != 0);
- return (DWORD)::SendMessage(m_hWnd, LVM_GETHOVERTIME, 0, 0L);
+ return (DWORD)::SendMessage(this->m_hWnd, LVM_GETHOVERTIME, 0, 0L);
}
DWORD SetHoverTime(DWORD dwHoverTime)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT((GetExtendedListViewStyle() & (LVS_EX_TRACKSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_TWOCLICKACTIVATE)) != 0);
- return (DWORD)::SendMessage(m_hWnd, LVM_SETHOVERTIME, 0, dwHoverTime);
+ return (DWORD)::SendMessage(this->m_hWnd, LVM_SETHOVERTIME, 0, dwHoverTime);
}
BOOL GetNumberOfWorkAreas(int* pnWorkAreas) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETNUMBEROFWORKAREAS, 0, (LPARAM)pnWorkAreas);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETNUMBEROFWORKAREAS, 0, (LPARAM)pnWorkAreas);
}
-#endif // !_WIN32_WCE
BOOL SetItemCountEx(int nItems, DWORD dwFlags)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT(((GetStyle() & LVS_OWNERDATA) != 0) && (((GetStyle() & LVS_TYPEMASK) == LVS_REPORT) || ((GetStyle() & LVS_TYPEMASK) == LVS_LIST)));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMCOUNT, nItems, dwFlags);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT(((this->GetStyle() & LVS_OWNERDATA) != 0) && (((this->GetStyle() & LVS_TYPEMASK) == LVS_REPORT) || ((this->GetStyle() & LVS_TYPEMASK) == LVS_LIST)));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMCOUNT, nItems, dwFlags);
}
-#ifndef _WIN32_WCE
CToolTipCtrl GetToolTips() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CToolTipCtrl((HWND)::SendMessage(m_hWnd, LVM_GETTOOLTIPS, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, LVM_GETTOOLTIPS, 0, 0L));
}
CToolTipCtrl SetToolTips(HWND hWndTT)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CToolTipCtrl((HWND)::SendMessage(m_hWnd, LVM_SETTOOLTIPS, (WPARAM)hWndTT, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, LVM_SETTOOLTIPS, (WPARAM)hWndTT, 0L));
}
BOOL GetUnicodeFormat() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETUNICODEFORMAT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETUNICODEFORMAT, 0, 0L);
}
BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETUNICODEFORMAT, bUnicode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETUNICODEFORMAT, bUnicode, 0L);
}
-#endif // !_WIN32_WCE
-#endif // (_WIN32_IE >= 0x0400)
-#if (_WIN32_WINNT >= 0x0501)
int GetSelectedColumn() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETSELECTEDCOLUMN, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETSELECTEDCOLUMN, 0, 0L);
}
void SetSelectedColumn(int nColumn)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LVM_SETSELECTEDCOLUMN, nColumn, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LVM_SETSELECTEDCOLUMN, nColumn, 0L);
}
DWORD GetView() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, LVM_GETVIEW, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, LVM_GETVIEW, 0, 0L);
}
int SetView(DWORD dwView)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_SETVIEW, dwView, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_SETVIEW, dwView, 0L);
}
BOOL IsGroupViewEnabled() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_ISGROUPVIEWENABLED, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_ISGROUPVIEWENABLED, 0, 0L);
}
int GetGroupInfo(int nGroupID, PLVGROUP pGroup) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETGROUPINFO, nGroupID, (LPARAM)pGroup);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETGROUPINFO, nGroupID, (LPARAM)pGroup);
}
int SetGroupInfo(int nGroupID, PLVGROUP pGroup)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_SETGROUPINFO, nGroupID, (LPARAM)pGroup);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_SETGROUPINFO, nGroupID, (LPARAM)pGroup);
}
void GetGroupMetrics(PLVGROUPMETRICS pGroupMetrics) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LVM_GETGROUPMETRICS, 0, (LPARAM)pGroupMetrics);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LVM_GETGROUPMETRICS, 0, (LPARAM)pGroupMetrics);
}
void SetGroupMetrics(PLVGROUPMETRICS pGroupMetrics)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LVM_SETGROUPMETRICS, 0, (LPARAM)pGroupMetrics);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LVM_SETGROUPMETRICS, 0, (LPARAM)pGroupMetrics);
}
void GetTileViewInfo(PLVTILEVIEWINFO pTileViewInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LVM_GETTILEVIEWINFO, 0, (LPARAM)pTileViewInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LVM_GETTILEVIEWINFO, 0, (LPARAM)pTileViewInfo);
}
BOOL SetTileViewInfo(PLVTILEVIEWINFO pTileViewInfo)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETTILEVIEWINFO, 0, (LPARAM)pTileViewInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETTILEVIEWINFO, 0, (LPARAM)pTileViewInfo);
}
void GetTileInfo(PLVTILEINFO pTileInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LVM_GETTILEINFO, 0, (LPARAM)pTileInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LVM_GETTILEINFO, 0, (LPARAM)pTileInfo);
}
BOOL SetTileInfo(PLVTILEINFO pTileInfo)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETTILEINFO, 0, (LPARAM)pTileInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETTILEINFO, 0, (LPARAM)pTileInfo);
}
BOOL GetInsertMark(LPLVINSERTMARK pInsertMark) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETINSERTMARK, 0, (LPARAM)pInsertMark);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETINSERTMARK, 0, (LPARAM)pInsertMark);
}
BOOL SetInsertMark(LPLVINSERTMARK pInsertMark)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETINSERTMARK, 0, (LPARAM)pInsertMark);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETINSERTMARK, 0, (LPARAM)pInsertMark);
}
int GetInsertMarkRect(LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETINSERTMARKRECT, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETINSERTMARKRECT, 0, (LPARAM)lpRect);
}
COLORREF GetInsertMarkColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, LVM_GETINSERTMARKCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, LVM_GETINSERTMARKCOLOR, 0, 0L);
}
COLORREF SetInsertMarkColor(COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, LVM_SETINSERTMARKCOLOR, 0, clr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, LVM_SETINSERTMARKCOLOR, 0, clr);
}
COLORREF GetOutlineColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, LVM_GETOUTLINECOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, LVM_GETOUTLINECOLOR, 0, 0L);
}
COLORREF SetOutlineColor(COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, LVM_SETOUTLINECOLOR, 0, clr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, LVM_SETOUTLINECOLOR, 0, clr);
}
-#endif // (_WIN32_WINNT >= 0x0501)
#if (_WIN32_WINNT >= 0x0600)
int GetGroupCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETGROUPCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETGROUPCOUNT, 0, 0L);
}
BOOL GetGroupInfoByIndex(int nIndex, PLVGROUP pGroup) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETGROUPINFOBYINDEX, nIndex, (LPARAM)pGroup);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETGROUPINFOBYINDEX, nIndex, (LPARAM)pGroup);
}
BOOL GetGroupRect(int nGroupID, int nType, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(lpRect != NULL);
if(lpRect != NULL)
lpRect->top = nType;
- return (BOOL)::SendMessage(m_hWnd, LVM_GETGROUPRECT, nGroupID, (LPARAM)lpRect);
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETGROUPRECT, nGroupID, (LPARAM)lpRect);
}
UINT GetGroupState(int nGroupID, UINT uMask) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, LVM_GETGROUPSTATE, nGroupID, (LPARAM)uMask);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, LVM_GETGROUPSTATE, nGroupID, (LPARAM)uMask);
}
int GetFocusedGroup() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETFOCUSEDGROUP, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETFOCUSEDGROUP, 0, 0L);
}
BOOL GetEmptyText(LPWSTR lpstrText, int cchText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETEMPTYTEXT, cchText, (LPARAM)lpstrText);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETEMPTYTEXT, cchText, (LPARAM)lpstrText);
}
BOOL GetFooterRect(LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETFOOTERRECT, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETFOOTERRECT, 0, (LPARAM)lpRect);
}
BOOL GetFooterInfo(LPLVFOOTERINFO lpFooterInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETFOOTERINFO, 0, (LPARAM)lpFooterInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETFOOTERINFO, 0, (LPARAM)lpFooterInfo);
}
BOOL GetFooterItemRect(int nItem, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETFOOTERITEMRECT, nItem, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETFOOTERITEMRECT, nItem, (LPARAM)lpRect);
}
BOOL GetFooterItem(int nItem, LPLVFOOTERITEM lpFooterItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETFOOTERITEM, nItem, (LPARAM)lpFooterItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETFOOTERITEM, nItem, (LPARAM)lpFooterItem);
}
BOOL GetItemIndexRect(PLVITEMINDEX pItemIndex, int nSubItem, int nType, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(pItemIndex != NULL);
ATLASSERT(lpRect != NULL);
if(lpRect != NULL)
@@ -3552,30 +3413,30 @@ class CListViewCtrlT : public TBase
lpRect->top = nSubItem;
lpRect->left = nType;
}
- return (BOOL)::SendMessage(m_hWnd, LVM_GETITEMINDEXRECT, (WPARAM)pItemIndex, (LPARAM)lpRect);
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETITEMINDEXRECT, (WPARAM)pItemIndex, (LPARAM)lpRect);
}
BOOL SetItemIndexState(PLVITEMINDEX pItemIndex, UINT uState, UINT dwMask)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
LVITEM lvi = { 0 };
lvi.state = uState;
lvi.stateMask = dwMask;
- return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMINDEXSTATE, (WPARAM)pItemIndex, (LPARAM)&lvi);
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMINDEXSTATE, (WPARAM)pItemIndex, (LPARAM)&lvi);
}
BOOL GetNextItemIndex(PLVITEMINDEX pItemIndex, WORD wFlags) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_GETNEXTITEMINDEX, (WPARAM)pItemIndex, MAKELPARAM(wFlags, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_GETNEXTITEMINDEX, (WPARAM)pItemIndex, MAKELPARAM(wFlags, 0));
}
#endif // (_WIN32_WINNT >= 0x0600)
// Operations
int InsertColumn(int nCol, const LVCOLUMN* pColumn)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_INSERTCOLUMN, nCol, (LPARAM)pColumn);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_INSERTCOLUMN, nCol, (LPARAM)pColumn);
}
int InsertColumn(int nCol, LPCTSTR lpszColumnHeading, int nFormat = LVCFMT_LEFT,
@@ -3610,13 +3471,13 @@ class CListViewCtrlT : public TBase
BOOL DeleteColumn(int nCol)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_DELETECOLUMN, nCol, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_DELETECOLUMN, nCol, 0L);
}
int InsertItem(UINT nMask, int nItem, LPCTSTR lpszItem, UINT nState, UINT nStateMask, int nImage, LPARAM lParam)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
LVITEM item = { 0 };
item.mask = nMask;
item.iItem = nItem;
@@ -3631,58 +3492,67 @@ class CListViewCtrlT : public TBase
int InsertItem(const LVITEM* pItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_INSERTITEM, 0, (LPARAM)pItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_INSERTITEM, 0, (LPARAM)pItem);
}
int InsertItem(int nItem, LPCTSTR lpszItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return InsertItem(LVIF_TEXT, nItem, lpszItem, 0, 0, 0, 0);
}
int InsertItem(int nItem, LPCTSTR lpszItem, int nImage)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return InsertItem(LVIF_TEXT|LVIF_IMAGE, nItem, lpszItem, 0, 0, nImage, 0);
}
int GetNextItem(int nItem, int nFlags) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_GETNEXTITEM, nItem, MAKELPARAM(nFlags, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_GETNEXTITEM, nItem, MAKELPARAM(nFlags, 0));
}
BOOL DeleteItem(int nItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_DELETEITEM, nItem, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_DELETEITEM, nItem, 0L);
}
BOOL DeleteAllItems()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_DELETEALLITEMS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_DELETEALLITEMS, 0, 0L);
+ }
+
+ int FindItem(LVFINDINFO* pFindInfo, int nStart = -1) const
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_FINDITEM, nStart, (LPARAM)pFindInfo);
}
- int FindItem(LVFINDINFO* pFindInfo, int nStart) const
+ int FindItem(LPCTSTR lpstrFind, bool bPartial = true, bool bWrap = false, int nStart = -1) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_FINDITEM, nStart, (LPARAM)pFindInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ LVFINDINFO lvfi = { 0 };
+ lvfi.flags = LVFI_STRING | (bWrap ? LVFI_WRAP : 0) | (bPartial ? LVFI_PARTIAL : 0);
+ lvfi.psz = lpstrFind;
+ return (int)::SendMessage(this->m_hWnd, LVM_FINDITEM, nStart, (LPARAM)&lvfi);
}
int HitTest(LVHITTESTINFO* pHitTestInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_HITTEST, 0, (LPARAM)pHitTestInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_HITTEST, 0, (LPARAM)pHitTestInfo);
}
int HitTest(POINT pt, UINT* pFlags) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
LVHITTESTINFO hti = { 0 };
hti.pt = pt;
- int nRes = (int)::SendMessage(m_hWnd, LVM_HITTEST, 0, (LPARAM)&hti);
+ int nRes = (int)::SendMessage(this->m_hWnd, LVM_HITTEST, 0, (LPARAM)&hti);
if (pFlags != NULL)
*pFlags = hti.flags;
return nRes;
@@ -3690,68 +3560,68 @@ class CListViewCtrlT : public TBase
BOOL EnsureVisible(int nItem, BOOL bPartialOK)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_ENSUREVISIBLE, nItem, MAKELPARAM(bPartialOK, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_ENSUREVISIBLE, nItem, MAKELPARAM(bPartialOK, 0));
}
BOOL Scroll(SIZE size)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SCROLL, size.cx, size.cy);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SCROLL, size.cx, size.cy);
}
BOOL RedrawItems(int nFirst, int nLast)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_REDRAWITEMS, nFirst, nLast);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_REDRAWITEMS, nFirst, nLast);
}
BOOL Arrange(UINT nCode)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_ARRANGE, nCode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_ARRANGE, nCode, 0L);
}
CEdit EditLabel(int nItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CEdit((HWND)::SendMessage(m_hWnd, LVM_EDITLABEL, nItem, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CEdit((HWND)::SendMessage(this->m_hWnd, LVM_EDITLABEL, nItem, 0L));
}
BOOL Update(int nItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_UPDATE, nItem, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_UPDATE, nItem, 0L);
}
BOOL SortItems(PFNLVCOMPARE pfnCompare, LPARAM lParamSort)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SORTITEMS, (WPARAM)lParamSort, (LPARAM)pfnCompare);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SORTITEMS, (WPARAM)lParamSort, (LPARAM)pfnCompare);
}
CImageList RemoveImageList(int nImageList)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, LVM_SETIMAGELIST, (WPARAM)nImageList, NULL));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, LVM_SETIMAGELIST, (WPARAM)nImageList, NULL));
}
CImageList CreateDragImage(int nItem, LPPOINT lpPoint)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, LVM_CREATEDRAGIMAGE, nItem, (LPARAM)lpPoint));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, LVM_CREATEDRAGIMAGE, nItem, (LPARAM)lpPoint));
}
DWORD ApproximateViewRect(int cx = -1, int cy = -1, int nCount = -1)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, LVM_APPROXIMATEVIEWRECT, nCount, MAKELPARAM(cx, cy));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, LVM_APPROXIMATEVIEWRECT, nCount, MAKELPARAM(cx, cy));
}
int SubItemHitTest(LPLVHITTESTINFO lpInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_SUBITEMHITTEST, 0, (LPARAM)lpInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_SUBITEMHITTEST, 0, (LPARAM)lpInfo);
}
int AddColumn(LPCTSTR strItem, int nItem, int nSubItem = -1,
@@ -3759,7 +3629,7 @@ class CListViewCtrlT : public TBase
int nFmt = LVCFMT_LEFT)
{
const int cxOffset = 15;
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
LVCOLUMN lvc = { 0 };
lvc.mask = nMask;
lvc.fmt = nFmt;
@@ -3770,15 +3640,15 @@ class CListViewCtrlT : public TBase
return InsertColumn(nItem, &lvc);
}
- int AddItem(int nItem, int nSubItem, LPCTSTR strItem, int nImageIndex = -1)
+ int AddItem(int nItem, int nSubItem, LPCTSTR strItem, int nImageIndex = -3)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
LVITEM lvItem = { 0 };
lvItem.mask = LVIF_TEXT;
lvItem.iItem = nItem;
lvItem.iSubItem = nSubItem;
lvItem.pszText = (LPTSTR)strItem;
- if(nImageIndex != -1)
+ if(nImageIndex != -3)
{
lvItem.mask |= LVIF_IMAGE;
lvItem.iImage = nImageIndex;
@@ -3788,19 +3658,16 @@ class CListViewCtrlT : public TBase
return SetItem(&lvItem) ? nItem : -1;
}
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
BOOL SortItemsEx(PFNLVCOMPARE pfnCompare, LPARAM lParamSort)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SORTITEMSEX, (WPARAM)lParamSort, (LPARAM)pfnCompare);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SORTITEMSEX, (WPARAM)lParamSort, (LPARAM)pfnCompare);
}
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
-#if (_WIN32_WINNT >= 0x0501)
int InsertGroup(int nItem, PLVGROUP pGroup)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_INSERTGROUP, nItem, (LPARAM)pGroup);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_INSERTGROUP, nItem, (LPARAM)pGroup);
}
int AddGroup(PLVGROUP pGroup)
@@ -3810,96 +3677,95 @@ class CListViewCtrlT : public TBase
int RemoveGroup(int nGroupID)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_REMOVEGROUP, nGroupID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_REMOVEGROUP, nGroupID, 0L);
}
void MoveGroup(int nGroupID, int nItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LVM_MOVEGROUP, nGroupID, nItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LVM_MOVEGROUP, nGroupID, nItem);
}
void MoveItemToGroup(int nItem, int nGroupID)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LVM_MOVEITEMTOGROUP, nItem, nGroupID);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LVM_MOVEITEMTOGROUP, nItem, nGroupID);
}
int EnableGroupView(BOOL bEnable)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_ENABLEGROUPVIEW, bEnable, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_ENABLEGROUPVIEW, bEnable, 0L);
}
int SortGroups(PFNLVGROUPCOMPARE pCompareFunc, LPVOID lpVoid = NULL)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_SORTGROUPS, (WPARAM)pCompareFunc, (LPARAM)lpVoid);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_SORTGROUPS, (WPARAM)pCompareFunc, (LPARAM)lpVoid);
}
void InsertGroupSorted(PLVINSERTGROUPSORTED pInsertGroupSorted)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LVM_INSERTGROUPSORTED, (WPARAM)pInsertGroupSorted, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LVM_INSERTGROUPSORTED, (WPARAM)pInsertGroupSorted, 0L);
}
void RemoveAllGroups()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LVM_REMOVEALLGROUPS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LVM_REMOVEALLGROUPS, 0, 0L);
}
BOOL HasGroup(int nGroupID)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_HASGROUP, nGroupID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_HASGROUP, nGroupID, 0L);
}
BOOL InsertMarkHitTest(LPPOINT lpPoint, LPLVINSERTMARK pInsertMark) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_INSERTMARKHITTEST, (WPARAM)lpPoint, (LPARAM)pInsertMark);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_INSERTMARKHITTEST, (WPARAM)lpPoint, (LPARAM)pInsertMark);
}
BOOL SetInfoTip(PLVSETINFOTIP pSetInfoTip)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LVM_SETINFOTIP, 0, (LPARAM)pSetInfoTip);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LVM_SETINFOTIP, 0, (LPARAM)pSetInfoTip);
}
void CancelEditLabel()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, LVM_CANCELEDITLABEL, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, LVM_CANCELEDITLABEL, 0, 0L);
}
UINT MapIndexToID(int nIndex) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, LVM_MAPINDEXTOID, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, LVM_MAPINDEXTOID, nIndex, 0L);
}
int MapIDToIndex(UINT uID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_MAPIDTOINDEX, uID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_MAPIDTOINDEX, uID, 0L);
}
-#endif // (_WIN32_WINNT >= 0x0501)
#if (_WIN32_WINNT >= 0x0600)
int HitTestEx(LPLVHITTESTINFO lpHitTestInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_HITTEST, (WPARAM)-1, (LPARAM)lpHitTestInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_HITTEST, (WPARAM)-1, (LPARAM)lpHitTestInfo);
}
int HitTestEx(POINT pt, UINT* pFlags) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
LVHITTESTINFO hti = { 0 };
hti.pt = pt;
- int nRes = (int)::SendMessage(m_hWnd, LVM_HITTEST, (WPARAM)-1, (LPARAM)&hti);
+ int nRes = (int)::SendMessage(this->m_hWnd, LVM_HITTEST, (WPARAM)-1, (LPARAM)&hti);
if (pFlags != NULL)
*pFlags = hti.flags;
return nRes;
@@ -3907,18 +3773,18 @@ class CListViewCtrlT : public TBase
int SubItemHitTestEx(LPLVHITTESTINFO lpHitTestInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LVM_SUBITEMHITTEST, (WPARAM)-1, (LPARAM)lpHitTestInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LVM_SUBITEMHITTEST, (WPARAM)-1, (LPARAM)lpHitTestInfo);
}
#endif // (_WIN32_WINNT >= 0x0600)
// Note: selects only one item
BOOL SelectItem(int nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
// multi-selection only: de-select all items
- if((GetStyle() & LVS_SINGLESEL) == 0)
+ if((this->GetStyle() & LVS_SINGLESEL) == 0)
SetItemState(-1, 0, LVIS_SELECTED);
BOOL bRet = SetItemState(nIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
@@ -3945,7 +3811,7 @@ class CTreeViewCtrlT : public TBase
CTreeViewCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -3964,50 +3830,50 @@ class CTreeViewCtrlT : public TBase
UINT GetCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, TVM_GETCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, TVM_GETCOUNT, 0, 0L);
}
UINT GetIndent() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, TVM_GETINDENT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, TVM_GETINDENT, 0, 0L);
}
void SetIndent(UINT nIndent)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TVM_SETINDENT, nIndent, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TVM_SETINDENT, nIndent, 0L);
}
CImageList GetImageList(int nImageListType = TVSIL_NORMAL) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TVM_GETIMAGELIST, (WPARAM)nImageListType, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TVM_GETIMAGELIST, (WPARAM)nImageListType, 0L));
}
CImageList SetImageList(HIMAGELIST hImageList, int nImageListType = TVSIL_NORMAL)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TVM_SETIMAGELIST, (WPARAM)nImageListType, (LPARAM)hImageList));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TVM_SETIMAGELIST, (WPARAM)nImageListType, (LPARAM)hImageList));
}
BOOL GetItem(LPTVITEM pItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)pItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)pItem);
}
BOOL SetItem(LPTVITEM pItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_SETITEM, 0, (LPARAM)pItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SETITEM, 0, (LPARAM)pItem);
}
BOOL SetItem(HTREEITEM hItem, UINT nMask, LPCTSTR lpszItem, int nImage,
int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TVITEM item = { 0 };
item.hItem = hItem;
item.mask = nMask;
@@ -4017,12 +3883,12 @@ class CTreeViewCtrlT : public TBase
item.state = nState;
item.stateMask = nStateMask;
item.lParam = lParam;
- return (BOOL)::SendMessage(m_hWnd, TVM_SETITEM, 0, (LPARAM)&item);
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SETITEM, 0, (LPARAM)&item);
}
BOOL GetItemText(HTREEITEM hItem, LPTSTR lpstrText, int nLen) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(lpstrText != NULL);
TVITEM item = { 0 };
@@ -4031,14 +3897,13 @@ class CTreeViewCtrlT : public TBase
item.pszText = lpstrText;
item.cchTextMax = nLen;
- return (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
}
-#ifndef _ATL_NO_COM
BOOL GetItemText(HTREEITEM hItem, BSTR& bstrText) const
{
USES_CONVERSION;
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(bstrText == NULL);
TVITEM item = { 0 };
item.hItem = hItem;
@@ -4054,8 +3919,8 @@ class CTreeViewCtrlT : public TBase
lpstrText[0] = NULL;
item.pszText = lpstrText;
item.cchTextMax = nLen;
- bRet = (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
- if(!bRet || (lstrlen(item.pszText) < nLen - 1))
+ bRet = (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
+ if(!bRet || (lstrlen(item.pszText) < (nLen - 1)))
break;
delete [] lpstrText;
lpstrText = NULL;
@@ -4070,12 +3935,11 @@ class CTreeViewCtrlT : public TBase
return (bstrText != NULL) ? TRUE : FALSE;
}
-#endif // !_ATL_NO_COM
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
- BOOL GetItemText(HTREEITEM hItem, _CSTRING_NS::CString& strText) const
+#ifdef __ATLSTR_H__
+ BOOL GetItemText(HTREEITEM hItem, ATL::CString& strText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TVITEM item = { 0 };
item.hItem = hItem;
item.mask = TVIF_TEXT;
@@ -4091,28 +3955,28 @@ class CTreeViewCtrlT : public TBase
break;
}
item.cchTextMax = nLen;
- bRet = (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
- if(!bRet || (lstrlen(item.pszText) < nLen - 1))
+ bRet = (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
+ if(!bRet || (lstrlen(item.pszText) < (nLen - 1)))
break;
}
strText.ReleaseBuffer();
return bRet;
}
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
+#endif // __ATLSTR_H__
BOOL SetItemText(HTREEITEM hItem, LPCTSTR lpszItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return SetItem(hItem, TVIF_TEXT, lpszItem, 0, 0, 0, 0, NULL);
}
BOOL GetItemImage(HTREEITEM hItem, int& nImage, int& nSelectedImage) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TVITEM item = { 0 };
item.hItem = hItem;
item.mask = TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- BOOL bRes = (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
+ BOOL bRes = (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
if (bRes)
{
nImage = item.iImage;
@@ -4123,102 +3987,90 @@ class CTreeViewCtrlT : public TBase
BOOL SetItemImage(HTREEITEM hItem, int nImage, int nSelectedImage)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return SetItem(hItem, TVIF_IMAGE|TVIF_SELECTEDIMAGE, NULL, nImage, nSelectedImage, 0, 0, NULL);
}
UINT GetItemState(HTREEITEM hItem, UINT nStateMask) const
{
- ATLASSERT(::IsWindow(m_hWnd));
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
- return (((UINT)::SendMessage(m_hWnd, TVM_GETITEMSTATE, (WPARAM)hItem, (LPARAM)nStateMask)) & nStateMask);
-#else // !((_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE))
- TVITEM item = { 0 };
- item.hItem = hItem;
- item.mask = TVIF_STATE;
- item.state = 0;
- item.stateMask = nStateMask;
- ::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
- return (item.state & nStateMask);
-#endif // !((_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE))
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (((UINT)::SendMessage(this->m_hWnd, TVM_GETITEMSTATE, (WPARAM)hItem, (LPARAM)nStateMask)) & nStateMask);
}
BOOL SetItemState(HTREEITEM hItem, UINT nState, UINT nStateMask)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return SetItem(hItem, TVIF_STATE, NULL, 0, 0, nState, nStateMask, NULL);
}
DWORD_PTR GetItemData(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TVITEM item = { 0 };
item.hItem = hItem;
item.mask = TVIF_PARAM;
- BOOL bRet = (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
+ BOOL bRet = (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
return (DWORD_PTR)(bRet ? item.lParam : NULL);
}
BOOL SetItemData(HTREEITEM hItem, DWORD_PTR dwData)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return SetItem(hItem, TVIF_PARAM, NULL, 0, 0, 0, 0, (LPARAM)dwData);
}
CEdit GetEditControl() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CEdit((HWND)::SendMessage(m_hWnd, TVM_GETEDITCONTROL, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CEdit((HWND)::SendMessage(this->m_hWnd, TVM_GETEDITCONTROL, 0, 0L));
}
UINT GetVisibleCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, TVM_GETVISIBLECOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, TVM_GETVISIBLECOUNT, 0, 0L);
}
BOOL GetItemRect(HTREEITEM hItem, LPRECT lpRect, BOOL bTextOnly) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
*(HTREEITEM*)lpRect = hItem;
- return (BOOL)::SendMessage(m_hWnd, TVM_GETITEMRECT, (WPARAM)bTextOnly, (LPARAM)lpRect);
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEMRECT, (WPARAM)bTextOnly, (LPARAM)lpRect);
}
BOOL ItemHasChildren(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TVITEM item = { 0 };
item.hItem = hItem;
item.mask = TVIF_CHILDREN;
- ::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
+ ::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
return item.cChildren;
}
-#ifndef _WIN32_WCE
CToolTipCtrl GetToolTips() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CToolTipCtrl((HWND)::SendMessage(m_hWnd, TVM_GETTOOLTIPS, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, TVM_GETTOOLTIPS, 0, 0L));
}
CToolTipCtrl SetToolTips(HWND hWndTT)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CToolTipCtrl((HWND)::SendMessage(m_hWnd, TVM_SETTOOLTIPS, (WPARAM)hWndTT, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, TVM_SETTOOLTIPS, (WPARAM)hWndTT, 0L));
}
-#endif // !_WIN32_WCE
int GetISearchString(LPTSTR lpstr) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TVM_GETISEARCHSTRING, 0, (LPARAM)lpstr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TVM_GETISEARCHSTRING, 0, (LPARAM)lpstr);
}
// checkboxes only
BOOL GetCheckState(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & TVS_CHECKBOXES) != 0);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & TVS_CHECKBOXES) != 0);
UINT uRet = GetItemState(hItem, TVIS_STATEIMAGEMASK);
return (uRet >> 12) - 1;
}
@@ -4229,164 +4081,152 @@ class CTreeViewCtrlT : public TBase
return SetItemState(hItem, INDEXTOSTATEIMAGEMASK(nCheck), TVIS_STATEIMAGEMASK);
}
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
COLORREF GetBkColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, TVM_GETBKCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, TVM_GETBKCOLOR, 0, 0L);
}
COLORREF SetBkColor(COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, TVM_SETBKCOLOR, 0, (LPARAM)clr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, TVM_SETBKCOLOR, 0, (LPARAM)clr);
}
COLORREF GetInsertMarkColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, TVM_GETINSERTMARKCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, TVM_GETINSERTMARKCOLOR, 0, 0L);
}
COLORREF SetInsertMarkColor(COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, TVM_SETINSERTMARKCOLOR, 0, (LPARAM)clr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, TVM_SETINSERTMARKCOLOR, 0, (LPARAM)clr);
}
int GetItemHeight() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TVM_GETITEMHEIGHT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TVM_GETITEMHEIGHT, 0, 0L);
}
int SetItemHeight(int cyHeight)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TVM_SETITEMHEIGHT, cyHeight, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TVM_SETITEMHEIGHT, cyHeight, 0L);
}
int GetScrollTime() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TVM_GETSCROLLTIME, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TVM_GETSCROLLTIME, 0, 0L);
}
int SetScrollTime(int nScrollTime)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TVM_SETSCROLLTIME, nScrollTime, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TVM_SETSCROLLTIME, nScrollTime, 0L);
}
COLORREF GetTextColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, TVM_GETTEXTCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, TVM_GETTEXTCOLOR, 0, 0L);
}
COLORREF SetTextColor(COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, TVM_SETTEXTCOLOR, 0, (LPARAM)clr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, TVM_SETTEXTCOLOR, 0, (LPARAM)clr);
}
BOOL GetUnicodeFormat() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_GETUNICODEFORMAT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_GETUNICODEFORMAT, 0, 0L);
}
BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_SETUNICODEFORMAT, bUnicode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SETUNICODEFORMAT, bUnicode, 0L);
}
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
COLORREF GetLineColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, TVM_GETLINECOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, TVM_GETLINECOLOR, 0, 0L);
}
COLORREF SetLineColor(COLORREF clrNew /*= CLR_DEFAULT*/)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, TVM_SETLINECOLOR, 0, (LPARAM)clrNew);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, TVM_SETLINECOLOR, 0, (LPARAM)clrNew);
}
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
BOOL GetItem(LPTVITEMEX pItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)pItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)pItem);
}
BOOL SetItem(LPTVITEMEX pItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_SETITEM, 0, (LPARAM)pItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SETITEM, 0, (LPARAM)pItem);
}
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
DWORD GetExtendedStyle() const
{
-#ifndef TVM_GETEXTENDEDSTYLE
- const UINT TVM_GETEXTENDEDSTYLE = (TV_FIRST + 45);
-#endif
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, TVM_GETEXTENDEDSTYLE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, TVM_GETEXTENDEDSTYLE, 0, 0L);
}
DWORD SetExtendedStyle(DWORD dwStyle, DWORD dwMask)
{
-#ifndef TVM_SETEXTENDEDSTYLE
- const UINT TVM_SETEXTENDEDSTYLE = (TV_FIRST + 44);
-#endif
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, TVM_SETEXTENDEDSTYLE, dwMask, dwStyle);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, TVM_SETEXTENDEDSTYLE, dwMask, dwStyle);
}
#if (_WIN32_WINNT >= 0x0600)
BOOL SetAutoScrollInfo(UINT uPixPerSec, UINT uUpdateTime)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_SETAUTOSCROLLINFO, (WPARAM)uPixPerSec, (LPARAM)uUpdateTime);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SETAUTOSCROLLINFO, (WPARAM)uPixPerSec, (LPARAM)uUpdateTime);
}
DWORD GetSelectedCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, TVM_GETSELECTEDCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, TVM_GETSELECTEDCOUNT, 0, 0L);
}
BOOL GetItemPartRect(HTREEITEM hItem, TVITEMPART partID, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TVGETITEMPARTRECTINFO gipri = { hItem, lpRect, partID };
- return (BOOL)::SendMessage(m_hWnd, TVM_GETITEMPARTRECT, 0, (LPARAM)&gipri);
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEMPARTRECT, 0, (LPARAM)&gipri);
}
#endif // (_WIN32_WINNT >= 0x0600)
// Operations
HTREEITEM InsertItem(LPTVINSERTSTRUCT lpInsertStruct)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_INSERTITEM, 0, (LPARAM)lpInsertStruct);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_INSERTITEM, 0, (LPARAM)lpInsertStruct);
}
HTREEITEM InsertItem(LPCTSTR lpszItem, int nImage,
int nSelectedImage, HTREEITEM hParent, HTREEITEM hInsertAfter)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return InsertItem(TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE, lpszItem, nImage, nSelectedImage, 0, 0, 0, hParent, hInsertAfter);
}
HTREEITEM InsertItem(LPCTSTR lpszItem, HTREEITEM hParent, HTREEITEM hInsertAfter)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return InsertItem(TVIF_TEXT, lpszItem, 0, 0, 0, 0, 0, hParent, hInsertAfter);
}
@@ -4394,7 +4234,7 @@ class CTreeViewCtrlT : public TBase
int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam,
HTREEITEM hParent, HTREEITEM hInsertAfter)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TVINSERTSTRUCT tvis = { 0 };
tvis.hParent = hParent;
tvis.hInsertAfter = hInsertAfter;
@@ -4405,157 +4245,153 @@ class CTreeViewCtrlT : public TBase
tvis.item.state = nState;
tvis.item.stateMask = nStateMask;
tvis.item.lParam = lParam;
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_INSERTITEM, 0, (LPARAM)&tvis);
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_INSERTITEM, 0, (LPARAM)&tvis);
}
BOOL DeleteItem(HTREEITEM hItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_DELETEITEM, 0, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_DELETEITEM, 0, (LPARAM)hItem);
}
BOOL DeleteAllItems()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT);
}
BOOL Expand(HTREEITEM hItem, UINT nCode = TVE_EXPAND)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_EXPAND, nCode, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_EXPAND, nCode, (LPARAM)hItem);
}
HTREEITEM GetNextItem(HTREEITEM hItem, UINT nCode) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, nCode, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, nCode, (LPARAM)hItem);
}
HTREEITEM GetChildItem(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)hItem);
}
HTREEITEM GetNextSiblingItem(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hItem);
}
HTREEITEM GetPrevSiblingItem(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUS, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUS, (LPARAM)hItem);
}
HTREEITEM GetParentItem(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hItem);
}
HTREEITEM GetFirstVisibleItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_FIRSTVISIBLE, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_FIRSTVISIBLE, 0L);
}
HTREEITEM GetNextVisibleItem(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTVISIBLE, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTVISIBLE, (LPARAM)hItem);
}
HTREEITEM GetPrevVisibleItem(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUSVISIBLE, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUSVISIBLE, (LPARAM)hItem);
}
HTREEITEM GetSelectedItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_CARET, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_CARET, 0L);
}
HTREEITEM GetDropHilightItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_DROPHILITE, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_DROPHILITE, 0L);
}
HTREEITEM GetRootItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0L);
}
-#if !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)
HTREEITEM GetLastVisibleItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_LASTVISIBLE, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_LASTVISIBLE, 0L);
}
-#endif // !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)
-#if (_WIN32_IE >= 0x0600)
HTREEITEM GetNextSelectedItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, 0L);
}
-#endif // (_WIN32_IE >= 0x0600)
BOOL Select(HTREEITEM hItem, UINT nCode)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_SELECTITEM, nCode, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SELECTITEM, nCode, (LPARAM)hItem);
}
BOOL SelectItem(HTREEITEM hItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hItem);
}
BOOL SelectDropTarget(HTREEITEM hItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_SELECTITEM, TVGN_DROPHILITE, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SELECTITEM, TVGN_DROPHILITE, (LPARAM)hItem);
}
BOOL SelectSetFirstVisible(HTREEITEM hItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_SELECTITEM, TVGN_FIRSTVISIBLE, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SELECTITEM, TVGN_FIRSTVISIBLE, (LPARAM)hItem);
}
CEdit EditLabel(HTREEITEM hItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CEdit((HWND)::SendMessage(m_hWnd, TVM_EDITLABEL, 0, (LPARAM)hItem));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CEdit((HWND)::SendMessage(this->m_hWnd, TVM_EDITLABEL, 0, (LPARAM)hItem));
}
BOOL EndEditLabelNow(BOOL bCancel)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_ENDEDITLABELNOW, bCancel, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_ENDEDITLABELNOW, bCancel, 0L);
}
HTREEITEM HitTest(TVHITTESTINFO* pHitTestInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_HITTEST, 0, (LPARAM)pHitTestInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_HITTEST, 0, (LPARAM)pHitTestInfo);
}
HTREEITEM HitTest(POINT pt, UINT* pFlags) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TVHITTESTINFO hti = { 0 };
hti.pt = pt;
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_HITTEST, 0, (LPARAM)&hti);
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_HITTEST, 0, (LPARAM)&hti);
if (pFlags != NULL)
*pFlags = hti.flags;
return hTreeItem;
@@ -4563,67 +4399,63 @@ class CTreeViewCtrlT : public TBase
BOOL SortChildren(HTREEITEM hItem, BOOL bRecurse = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_SORTCHILDREN, (WPARAM)bRecurse, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SORTCHILDREN, (WPARAM)bRecurse, (LPARAM)hItem);
}
BOOL EnsureVisible(HTREEITEM hItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_ENSUREVISIBLE, 0, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_ENSUREVISIBLE, 0, (LPARAM)hItem);
}
BOOL SortChildrenCB(LPTVSORTCB pSort, BOOL bRecurse = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_SORTCHILDRENCB, (WPARAM)bRecurse, (LPARAM)pSort);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SORTCHILDRENCB, (WPARAM)bRecurse, (LPARAM)pSort);
}
CImageList RemoveImageList(int nImageList)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TVM_SETIMAGELIST, (WPARAM)nImageList, NULL));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TVM_SETIMAGELIST, (WPARAM)nImageList, NULL));
}
CImageList CreateDragImage(HTREEITEM hItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TVM_CREATEDRAGIMAGE, 0, (LPARAM)hItem));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TVM_CREATEDRAGIMAGE, 0, (LPARAM)hItem));
}
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
BOOL SetInsertMark(HTREEITEM hTreeItem, BOOL bAfter)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_SETINSERTMARK, bAfter, (LPARAM)hTreeItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SETINSERTMARK, bAfter, (LPARAM)hTreeItem);
}
BOOL RemoveInsertMark()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TVM_SETINSERTMARK, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TVM_SETINSERTMARK, 0, 0L);
}
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
-#if (_WIN32_WINNT >= 0x0501)
HTREEITEM MapAccIDToHTREEITEM(UINT uID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HTREEITEM)::SendMessage(m_hWnd, TVM_MAPACCIDTOHTREEITEM, uID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HTREEITEM)::SendMessage(this->m_hWnd, TVM_MAPACCIDTOHTREEITEM, uID, 0L);
}
UINT MapHTREEITEMToAccID(HTREEITEM hTreeItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, TVM_MAPHTREEITEMTOACCID, (WPARAM)hTreeItem, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, TVM_MAPHTREEITEMTOACCID, (WPARAM)hTreeItem, 0L);
}
-#endif // (_WIN32_WINNT >= 0x0501)
#if (_WIN32_WINNT >= 0x0600)
void ShowInfoTip(HTREEITEM hItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TVM_SHOWINFOTIP, 0, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TVM_SHOWINFOTIP, 0, (LPARAM)hItem);
}
#endif // (_WIN32_WINNT >= 0x0600)
};
@@ -4672,12 +4504,10 @@ class CTreeItemT
BOOL GetRect(LPRECT lpRect, BOOL bTextOnly) const;
BOOL GetText(LPTSTR lpstrText, int nLen) const;
-#ifndef _ATL_NO_COM
BOOL GetText(BSTR& bstrText) const;
-#endif // !_ATL_NO_COM
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
- BOOL GetText(_CSTRING_NS::CString& strText) const;
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
+#ifdef __ATLSTR_H__
+ BOOL GetText(ATL::CString& strText) const;
+#endif // __ATLSTR_H__
BOOL SetText(LPCTSTR lpszItem);
BOOL GetImage(int& nImage, int& nSelectedImage) const;
BOOL SetImage(int nImage, int nSelectedImage);
@@ -4714,12 +4544,8 @@ class CTreeItemT
CTreeItemT GetSelected() const;
CTreeItemT GetDropHilight() const;
CTreeItemT GetRoot() const;
-#if !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)
CTreeItemT GetLastVisible() const;
-#endif // !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)
-#if (_WIN32_IE >= 0x0600)
CTreeItemT GetNextSelected() const;
-#endif // (_WIN32_IE >= 0x0600)
BOOL HasChildren() const;
BOOL Delete();
BOOL Expand(UINT nCode = TVE_EXPAND);
@@ -4733,12 +4559,8 @@ class CTreeItemT
BOOL EnsureVisible();
CTreeItemT _Insert(LPCTSTR lpstrItem, int nImageIndex, HTREEITEM hItemAfter);
int GetImageIndex() const;
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
BOOL SetInsertMark(BOOL bAfter);
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
-#if (_WIN32_WINNT >= 0x0501)
UINT MapHTREEITEMToAccID() const;
-#endif // (_WIN32_WINNT >= 0x0501)
#if (_WIN32_WINNT >= 0x0600)
void ShowInfoTip();
BOOL GetPartRect(TVITEMPART partID, LPRECT lpRect) const;
@@ -4758,130 +4580,126 @@ class CTreeViewCtrlExT : public CTreeViewCtrlT< TBase >
CTreeViewCtrlExT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
// Operations (overides that return CTreeItem)
CTreeItemT InsertItem(LPTVINSERTSTRUCT lpInsertStruct)
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_INSERTITEM, 0, (LPARAM)lpInsertStruct);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_INSERTITEM, 0, (LPARAM)lpInsertStruct);
return CTreeItemT(hTreeItem, this);
}
CTreeItemT InsertItem(LPCTSTR lpszItem, int nImage,
int nSelectedImage, HTREEITEM hParent, HTREEITEM hInsertAfter)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return InsertItem(TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE, lpszItem, nImage, nSelectedImage, 0, 0, 0, hParent, hInsertAfter);
}
CTreeItemT InsertItem(LPCTSTR lpszItem, HTREEITEM hParent, HTREEITEM hInsertAfter)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return InsertItem(TVIF_TEXT, lpszItem, 0, 0, 0, 0, 0, hParent, hInsertAfter);
}
CTreeItemT GetNextItem(HTREEITEM hItem, UINT nCode) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, nCode, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, nCode, (LPARAM)hItem);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
CTreeItemT GetChildItem(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)hItem);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
CTreeItemT GetNextSiblingItem(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hItem);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
CTreeItemT GetPrevSiblingItem(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUS, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUS, (LPARAM)hItem);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
CTreeItemT GetParentItem(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hItem);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
CTreeItemT GetFirstVisibleItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_FIRSTVISIBLE, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_FIRSTVISIBLE, 0L);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
CTreeItemT GetNextVisibleItem(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTVISIBLE, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTVISIBLE, (LPARAM)hItem);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
CTreeItemT GetPrevVisibleItem(HTREEITEM hItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUSVISIBLE, (LPARAM)hItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUSVISIBLE, (LPARAM)hItem);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
CTreeItemT GetSelectedItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_CARET, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_CARET, 0L);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
CTreeItemT GetDropHilightItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_DROPHILITE, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_DROPHILITE, 0L);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
CTreeItemT GetRootItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0L);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
-#if !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)
CTreeItemT GetLastVisibleItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_LASTVISIBLE, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_LASTVISIBLE, 0L);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
-#endif // !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)
-#if (_WIN32_IE >= 0x0600)
CTreeItemT GetNextSelectedItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, 0L);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
-#endif // (_WIN32_IE >= 0x0600)
CTreeItemT HitTest(TVHITTESTINFO* pHitTestInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_HITTEST, 0, (LPARAM)pHitTestInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_HITTEST, 0, (LPARAM)pHitTestInfo);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
@@ -4889,7 +4707,7 @@ class CTreeViewCtrlExT : public CTreeViewCtrlT< TBase >
int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam,
HTREEITEM hParent, HTREEITEM hInsertAfter)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TVINSERTSTRUCT tvis = { 0 };
tvis.hParent = hParent;
tvis.hInsertAfter = hInsertAfter;
@@ -4900,29 +4718,27 @@ class CTreeViewCtrlExT : public CTreeViewCtrlT< TBase >
tvis.item.state = nState;
tvis.item.stateMask = nStateMask;
tvis.item.lParam = lParam;
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_INSERTITEM, 0, (LPARAM)&tvis);
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_INSERTITEM, 0, (LPARAM)&tvis);
return CTreeItemT(hTreeItem, this);
}
CTreeItemT HitTest(POINT pt, UINT* pFlags) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TVHITTESTINFO hti = { 0 };
hti.pt = pt;
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_HITTEST, 0, (LPARAM)&hti);
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_HITTEST, 0, (LPARAM)&hti);
if (pFlags != NULL)
*pFlags = hti.flags;
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
-#if (_WIN32_WINNT >= 0x0501)
CTreeItemT MapAccIDToHTREEITEM(UINT uID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_MAPACCIDTOHTREEITEM, uID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_MAPACCIDTOHTREEITEM, uID, 0L);
return CTreeItemT(hTreeItem, (CTreeViewCtrlExT*)this);
}
-#endif // (_WIN32_WINNT >= 0x0501)
};
typedef CTreeViewCtrlExT CTreeViewCtrlEx;
@@ -5013,23 +4829,19 @@ inline CTreeItemT CTreeItemT::GetRoot() const
return m_pTreeView->GetRootItem();
}
-#if !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)
template
inline CTreeItemT CTreeItemT::GetLastVisible() const
{
ATLASSERT(m_pTreeView != NULL);
return m_pTreeView->GetLastVisibleItem();
}
-#endif // !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)
-#if (_WIN32_IE >= 0x0600)
template
inline CTreeItemT CTreeItemT::GetNextSelected() const
{
ATLASSERT(m_pTreeView != NULL);
return m_pTreeView->GetNextSelectedItem();
}
-#endif // (_WIN32_IE >= 0x0600)
template
inline BOOL CTreeItemT::GetText(LPTSTR lpstrText, int nLen) const
@@ -5038,7 +4850,6 @@ inline BOOL CTreeItemT::GetText(LPTSTR lpstrText, int nLen) const
return m_pTreeView->GetItemText(m_hTreeItem, lpstrText, nLen);
}
-#ifndef _ATL_NO_COM
#ifdef _OLEAUTO_H_
template
inline BOOL CTreeItemT::GetText(BSTR& bstrText) const
@@ -5047,16 +4858,15 @@ inline BOOL CTreeItemT::GetText(BSTR& bstrText) const
return m_pTreeView->GetItemText(m_hTreeItem, bstrText);
}
#endif // _OLEAUTO_H_
-#endif // !_ATL_NO_COM
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
+#ifdef __ATLSTR_H__
template
-inline BOOL CTreeItemT::GetText(_CSTRING_NS::CString& strText) const
+inline BOOL CTreeItemT::GetText(ATL::CString& strText) const
{
ATLASSERT(m_pTreeView != NULL);
return m_pTreeView->GetItemText(m_hTreeItem, strText);
}
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
+#endif // __ATLSTR_H__
template
inline BOOL CTreeItemT::GetImage(int& nImage, int& nSelectedImage) const
@@ -5221,23 +5031,19 @@ inline int CTreeItemT::GetImageIndex() const
return item.iImage;
}
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
template
inline BOOL CTreeItemT::SetInsertMark(BOOL bAfter)
{
ATLASSERT(m_pTreeView != NULL);
return m_pTreeView->SetInsertMark(m_hTreeItem, bAfter);
}
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
-#if (_WIN32_WINNT >= 0x0501)
template
inline UINT CTreeItemT::MapHTREEITEMToAccID() const
{
ATLASSERT(m_pTreeView != NULL);
return m_pTreeView->MapHTREEITEMToAccID(m_hTreeItem);
}
-#endif // (_WIN32_WINNT >= 0x0501)
#if (_WIN32_WINNT >= 0x0600)
template
@@ -5269,7 +5075,7 @@ class CToolBarCtrlT : public TBase
CToolBarCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -5288,281 +5094,274 @@ class CToolBarCtrlT : public TBase
BOOL IsButtonEnabled(int nID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_ISBUTTONENABLED, nID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_ISBUTTONENABLED, nID, 0L);
}
BOOL IsButtonChecked(int nID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_ISBUTTONCHECKED, nID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_ISBUTTONCHECKED, nID, 0L);
}
BOOL IsButtonPressed(int nID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_ISBUTTONPRESSED, nID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_ISBUTTONPRESSED, nID, 0L);
}
BOOL IsButtonHidden(int nID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return(BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONHIDDEN, nID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return(BOOL) ::SendMessage(this->m_hWnd, TB_ISBUTTONHIDDEN, nID, 0L);
}
BOOL IsButtonIndeterminate(int nID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_ISBUTTONINDETERMINATE, nID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_ISBUTTONINDETERMINATE, nID, 0L);
}
int GetState(int nID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_GETSTATE, nID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_GETSTATE, nID, 0L);
}
BOOL SetState(int nID, UINT nState)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_SETSTATE, nID, MAKELPARAM(nState, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETSTATE, nID, MAKELPARAM(nState, 0));
}
BOOL GetButton(int nIndex, LPTBBUTTON lpButton) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_GETBUTTON, nIndex, (LPARAM)lpButton);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_GETBUTTON, nIndex, (LPARAM)lpButton);
}
int GetButtonCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_BUTTONCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_BUTTONCOUNT, 0, 0L);
}
BOOL GetItemRect(int nIndex, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_GETITEMRECT, nIndex, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_GETITEMRECT, nIndex, (LPARAM)lpRect);
}
void SetButtonStructSize(int nSize = sizeof(TBBUTTON))
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_BUTTONSTRUCTSIZE, nSize, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_BUTTONSTRUCTSIZE, nSize, 0L);
}
BOOL SetButtonSize(SIZE size)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(size.cx, size.cy));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(size.cx, size.cy));
}
BOOL SetButtonSize(int cx, int cy)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(cx, cy));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(cx, cy));
}
BOOL SetBitmapSize(SIZE size)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(size.cx, size.cy));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(size.cx, size.cy));
}
BOOL SetBitmapSize(int cx, int cy)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(cx, cy));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(cx, cy));
}
-#ifndef _WIN32_WCE
CToolTipCtrl GetToolTips() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CToolTipCtrl((HWND)::SendMessage(m_hWnd, TB_GETTOOLTIPS, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, TB_GETTOOLTIPS, 0, 0L));
}
void SetToolTips(HWND hWndToolTip)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_SETTOOLTIPS, (WPARAM)hWndToolTip, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_SETTOOLTIPS, (WPARAM)hWndToolTip, 0L);
}
-#endif // !_WIN32_WCE
void SetNotifyWnd(HWND hWnd)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_SETPARENT, (WPARAM)hWnd, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_SETPARENT, (WPARAM)hWnd, 0L);
}
int GetRows() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_GETROWS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_GETROWS, 0, 0L);
}
void SetRows(int nRows, BOOL bLarger, LPRECT lpRect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_SETROWS, MAKELPARAM(nRows, bLarger), (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_SETROWS, MAKELPARAM(nRows, bLarger), (LPARAM)lpRect);
}
BOOL SetCmdID(int nIndex, UINT nID)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_SETCMDID, nIndex, nID);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETCMDID, nIndex, nID);
}
DWORD GetBitmapFlags() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, TB_GETBITMAPFLAGS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, TB_GETBITMAPFLAGS, 0, 0L);
}
int GetBitmap(int nID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_GETBITMAP, nID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_GETBITMAP, nID, 0L);
}
int GetButtonText(int nID, LPTSTR lpstrText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_GETBUTTONTEXT, nID, (LPARAM)lpstrText);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_GETBUTTONTEXT, nID, (LPARAM)lpstrText);
}
// nIndex - IE5 or higher only
CImageList GetImageList(int nIndex = 0) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_GETIMAGELIST, nIndex, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_GETIMAGELIST, nIndex, 0L));
}
// nIndex - IE5 or higher only
CImageList SetImageList(HIMAGELIST hImageList, int nIndex = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_SETIMAGELIST, nIndex, (LPARAM)hImageList));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_SETIMAGELIST, nIndex, (LPARAM)hImageList));
}
// nIndex - IE5 or higher only
CImageList GetDisabledImageList(int nIndex = 0) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_GETDISABLEDIMAGELIST, nIndex, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_GETDISABLEDIMAGELIST, nIndex, 0L));
}
// nIndex - IE5 or higher only
CImageList SetDisabledImageList(HIMAGELIST hImageList, int nIndex = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_SETDISABLEDIMAGELIST, nIndex, (LPARAM)hImageList));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_SETDISABLEDIMAGELIST, nIndex, (LPARAM)hImageList));
}
-#ifndef _WIN32_WCE
// nIndex - IE5 or higher only
CImageList GetHotImageList(int nIndex = 0) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_GETHOTIMAGELIST, nIndex, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_GETHOTIMAGELIST, nIndex, 0L));
}
// nIndex - IE5 or higher only
CImageList SetHotImageList(HIMAGELIST hImageList, int nIndex = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_SETHOTIMAGELIST, nIndex, (LPARAM)hImageList));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_SETHOTIMAGELIST, nIndex, (LPARAM)hImageList));
}
-#endif // !_WIN32_WCE
DWORD GetStyle() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, TB_GETSTYLE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, TB_GETSTYLE, 0, 0L);
}
void SetStyle(DWORD dwStyle)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_SETSTYLE, 0, dwStyle);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_SETSTYLE, 0, dwStyle);
}
DWORD GetButtonSize() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, TB_GETBUTTONSIZE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, TB_GETBUTTONSIZE, 0, 0L);
}
void GetButtonSize(SIZE& size) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, TB_GETBUTTONSIZE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, TB_GETBUTTONSIZE, 0, 0L);
size.cx = LOWORD(dwRet);
size.cy = HIWORD(dwRet);
}
BOOL GetRect(int nID, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_GETRECT, nID, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_GETRECT, nID, (LPARAM)lpRect);
}
int GetTextRows() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_GETTEXTROWS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_GETTEXTROWS, 0, 0L);
}
BOOL SetButtonWidth(int cxMin, int cxMax)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_SETBUTTONWIDTH, 0, MAKELPARAM(cxMin, cxMax));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETBUTTONWIDTH, 0, MAKELPARAM(cxMin, cxMax));
}
BOOL SetIndent(int nIndent)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_SETINDENT, nIndent, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETINDENT, nIndent, 0L);
}
BOOL SetMaxTextRows(int nMaxTextRows)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_SETMAXTEXTROWS, nMaxTextRows, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETMAXTEXTROWS, nMaxTextRows, 0L);
}
-#if (_WIN32_IE >= 0x0400)
-#ifndef _WIN32_WCE
BOOL GetAnchorHighlight() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_GETANCHORHIGHLIGHT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_GETANCHORHIGHLIGHT, 0, 0L);
}
BOOL SetAnchorHighlight(BOOL bEnable = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_SETANCHORHIGHLIGHT, bEnable, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETANCHORHIGHLIGHT, bEnable, 0L);
}
-#endif // !_WIN32_WCE
int GetButtonInfo(int nID, LPTBBUTTONINFO lptbbi) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_GETBUTTONINFO, nID, (LPARAM)lptbbi);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_GETBUTTONINFO, nID, (LPARAM)lptbbi);
}
BOOL SetButtonInfo(int nID, LPTBBUTTONINFO lptbbi)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_SETBUTTONINFO, nID, (LPARAM)lptbbi);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETBUTTONINFO, nID, (LPARAM)lptbbi);
}
BOOL SetButtonInfo(int nID, DWORD dwMask, BYTE Style, BYTE State, LPCTSTR lpszItem,
int iImage, WORD cx, int iCommand, DWORD_PTR lParam)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TBBUTTONINFO tbbi = { 0 };
tbbi.cbSize = sizeof(TBBUTTONINFO);
tbbi.dwMask = dwMask;
@@ -5573,103 +5372,100 @@ class CToolBarCtrlT : public TBase
tbbi.cx = cx;
tbbi.pszText = (LPTSTR) lpszItem;
tbbi.lParam = lParam;
- return (BOOL)::SendMessage(m_hWnd, TB_SETBUTTONINFO, nID, (LPARAM)&tbbi);
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETBUTTONINFO, nID, (LPARAM)&tbbi);
}
-#ifndef _WIN32_WCE
int GetHotItem() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_GETHOTITEM, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_GETHOTITEM, 0, 0L);
}
int SetHotItem(int nItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_SETHOTITEM, nItem, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_SETHOTITEM, nItem, 0L);
}
-#endif // !_WIN32_WCE
BOOL IsButtonHighlighted(int nButtonID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_ISBUTTONHIGHLIGHTED, nButtonID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_ISBUTTONHIGHLIGHTED, nButtonID, 0L);
}
DWORD SetDrawTextFlags(DWORD dwMask, DWORD dwFlags)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, TB_SETDRAWTEXTFLAGS, dwMask, dwFlags);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, TB_SETDRAWTEXTFLAGS, dwMask, dwFlags);
}
-#ifndef _WIN32_WCE
BOOL GetColorScheme(LPCOLORSCHEME lpcs) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_GETCOLORSCHEME, 0, (LPARAM)lpcs);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_GETCOLORSCHEME, 0, (LPARAM)lpcs);
}
void SetColorScheme(LPCOLORSCHEME lpcs)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_SETCOLORSCHEME, 0, (LPARAM)lpcs);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_SETCOLORSCHEME, 0, (LPARAM)lpcs);
}
DWORD GetExtendedStyle() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, TB_GETEXTENDEDSTYLE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, TB_GETEXTENDEDSTYLE, 0, 0L);
}
DWORD SetExtendedStyle(DWORD dwStyle)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, TB_SETEXTENDEDSTYLE, 0, dwStyle);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, TB_SETEXTENDEDSTYLE, 0, dwStyle);
}
void GetInsertMark(LPTBINSERTMARK lptbim) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_GETINSERTMARK, 0, (LPARAM)lptbim);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_GETINSERTMARK, 0, (LPARAM)lptbim);
}
void SetInsertMark(LPTBINSERTMARK lptbim)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_SETINSERTMARK, 0, (LPARAM)lptbim);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_SETINSERTMARK, 0, (LPARAM)lptbim);
}
COLORREF GetInsertMarkColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, TB_GETINSERTMARKCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, TB_GETINSERTMARKCOLOR, 0, 0L);
}
COLORREF SetInsertMarkColor(COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, TB_SETINSERTMARKCOLOR, 0, (LPARAM)clr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, TB_SETINSERTMARKCOLOR, 0, (LPARAM)clr);
}
BOOL GetMaxSize(LPSIZE lpSize) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_GETMAXSIZE, 0, (LPARAM)lpSize);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_GETMAXSIZE, 0, (LPARAM)lpSize);
}
void GetPadding(LPSIZE lpSizePadding) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(lpSizePadding != NULL);
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, TB_GETPADDING, 0, 0L);
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, TB_GETPADDING, 0, 0L);
lpSizePadding->cx = GET_X_LPARAM(dwRet);
lpSizePadding->cy = GET_Y_LPARAM(dwRet);
}
void SetPadding(int cx, int cy, LPSIZE lpSizePadding = NULL)
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, TB_SETPADDING, 0, MAKELPARAM(cx, cy));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, TB_SETPADDING, 0, MAKELPARAM(cx, cy));
if(lpSizePadding != NULL)
{
lpSizePadding->cx = GET_X_LPARAM(dwRet);
@@ -5679,38 +5475,35 @@ class CToolBarCtrlT : public TBase
BOOL GetUnicodeFormat() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_GETUNICODEFORMAT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_GETUNICODEFORMAT, 0, 0L);
}
BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_SETUNICODEFORMAT, bUnicode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_SETUNICODEFORMAT, bUnicode, 0L);
}
-#endif // !_WIN32_WCE
-#endif // (_WIN32_IE >= 0x0400)
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
int GetString(int nString, LPTSTR lpstrString, int cchMaxLen) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_GETSTRING, MAKEWPARAM(cchMaxLen, nString), (LPARAM)lpstrString);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_GETSTRING, MAKEWPARAM(cchMaxLen, nString), (LPARAM)lpstrString);
}
int GetStringBSTR(int nString, BSTR& bstrString) const
{
USES_CONVERSION;
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(bstrString == NULL);
- int nLength = (int)(short)LOWORD(::SendMessage(m_hWnd, TB_GETSTRING, MAKEWPARAM(0, nString), NULL));
+ int nLength = (int)(short)LOWORD(::SendMessage(this->m_hWnd, TB_GETSTRING, MAKEWPARAM(0, nString), NULL));
if(nLength != -1)
{
- CTempBuffer buff;
+ ATL::CTempBuffer buff;
LPTSTR lpstrText = buff.Allocate(nLength + 1);
if(lpstrText != NULL)
{
- nLength = (int)::SendMessage(m_hWnd, TB_GETSTRING, MAKEWPARAM(nLength + 1, nString), (LPARAM)lpstrText);
+ nLength = (int)::SendMessage(this->m_hWnd, TB_GETSTRING, MAKEWPARAM(nLength + 1, nString), (LPARAM)lpstrText);
if(nLength != -1)
bstrString = ::SysAllocString(T2OLE(lpstrText));
}
@@ -5723,125 +5516,133 @@ class CToolBarCtrlT : public TBase
return nLength;
}
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
- int GetString(int nString, _CSTRING_NS::CString& str) const
+#ifdef __ATLSTR_H__
+ int GetString(int nString, ATL::CString& str) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- int nLength = (int)(short)LOWORD(::SendMessage(m_hWnd, TB_GETSTRING, MAKEWPARAM(0, nString), NULL));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ int nLength = (int)(short)LOWORD(::SendMessage(this->m_hWnd, TB_GETSTRING, MAKEWPARAM(0, nString), NULL));
if(nLength != -1)
{
LPTSTR lpstr = str.GetBufferSetLength(nLength + 1);
if(lpstr != NULL)
- nLength = (int)::SendMessage(m_hWnd, TB_GETSTRING, MAKEWPARAM(nLength + 1, nString), (LPARAM)lpstr);
+ nLength = (int)::SendMessage(this->m_hWnd, TB_GETSTRING, MAKEWPARAM(nLength + 1, nString), (LPARAM)lpstr);
else
nLength = -1;
str.ReleaseBuffer();
}
return nLength;
}
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
+#endif // __ATLSTR_H__
-#if (_WIN32_WINNT >= 0x0501)
void GetMetrics(LPTBMETRICS lptbm) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_GETMETRICS, 0, (LPARAM)lptbm);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_GETMETRICS, 0, (LPARAM)lptbm);
}
void SetMetrics(LPTBMETRICS lptbm)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_SETMETRICS, 0, (LPARAM)lptbm);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_SETMETRICS, 0, (LPARAM)lptbm);
}
void SetWindowTheme(LPCWSTR lpstrTheme)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);
}
-#endif // (_WIN32_WINNT >= 0x0501)
#if (_WIN32_WINNT >= 0x0600)
CImageList GetPressedImageList(int nIndex = 0) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_GETPRESSEDIMAGELIST, nIndex, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_GETPRESSEDIMAGELIST, nIndex, 0L));
}
CImageList SetPressedImageList(HIMAGELIST hImageList, int nIndex = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_SETPRESSEDIMAGELIST, nIndex, (LPARAM)hImageList));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_SETPRESSEDIMAGELIST, nIndex, (LPARAM)hImageList));
+ }
+
+ void GetItemDropDownRect(int nIndex, LPRECT lpRect) const
+ {
+#ifndef TB_GETITEMDROPDOWNRECT
+ const int TB_GETITEMDROPDOWNRECT = WM_USER + 103;
+#endif
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ BOOL bRet = (BOOL)::SendMessage(this->m_hWnd, TB_GETITEMDROPDOWNRECT, nIndex, (LPARAM)lpRect);
+ bRet; // avoid level 4 warning
+ ATLASSERT(bRet != FALSE);
}
#endif // (_WIN32_WINNT >= 0x0600)
// Operations
BOOL EnableButton(int nID, BOOL bEnable = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_ENABLEBUTTON, nID, MAKELPARAM(bEnable, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_ENABLEBUTTON, nID, MAKELPARAM(bEnable, 0));
}
BOOL CheckButton(int nID, BOOL bCheck = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_CHECKBUTTON, nID, MAKELPARAM(bCheck, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_CHECKBUTTON, nID, MAKELPARAM(bCheck, 0));
}
BOOL PressButton(int nID, BOOL bPress = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_PRESSBUTTON, nID, MAKELPARAM(bPress, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_PRESSBUTTON, nID, MAKELPARAM(bPress, 0));
}
BOOL HideButton(int nID, BOOL bHide = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_HIDEBUTTON, nID, MAKELPARAM(bHide, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_HIDEBUTTON, nID, MAKELPARAM(bHide, 0));
}
BOOL Indeterminate(int nID, BOOL bIndeterminate = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_INDETERMINATE, nID, MAKELPARAM(bIndeterminate, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_INDETERMINATE, nID, MAKELPARAM(bIndeterminate, 0));
}
int AddBitmap(int nNumButtons, UINT nBitmapID)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TBADDBITMAP tbab = { 0 };
tbab.hInst = ModuleHelper::GetResourceInstance();
ATLASSERT(tbab.hInst != NULL);
tbab.nID = nBitmapID;
- return (int)::SendMessage(m_hWnd, TB_ADDBITMAP, (WPARAM)nNumButtons, (LPARAM)&tbab);
+ return (int)::SendMessage(this->m_hWnd, TB_ADDBITMAP, (WPARAM)nNumButtons, (LPARAM)&tbab);
}
int AddBitmap(int nNumButtons, HBITMAP hBitmap)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TBADDBITMAP tbab = { 0 };
tbab.hInst = NULL;
tbab.nID = (UINT_PTR)hBitmap;
- return (int)::SendMessage(m_hWnd, TB_ADDBITMAP, (WPARAM)nNumButtons, (LPARAM)&tbab);
+ return (int)::SendMessage(this->m_hWnd, TB_ADDBITMAP, (WPARAM)nNumButtons, (LPARAM)&tbab);
}
BOOL AddButtons(int nNumButtons, LPTBBUTTON lpButtons)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_ADDBUTTONS, nNumButtons, (LPARAM)lpButtons);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_ADDBUTTONS, nNumButtons, (LPARAM)lpButtons);
}
BOOL InsertButton(int nIndex, LPTBBUTTON lpButton)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_INSERTBUTTON, nIndex, (LPARAM)lpButton);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_INSERTBUTTON, nIndex, (LPARAM)lpButton);
}
BOOL InsertButton(int nIndex, int iCommand, BYTE Style, BYTE State, int iBitmap,
INT_PTR iString, DWORD_PTR lParam)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TBBUTTON tbb = { 0 };
tbb.fsStyle = Style;
tbb.fsState = State;
@@ -5849,7 +5650,7 @@ class CToolBarCtrlT : public TBase
tbb.iBitmap = iBitmap;
tbb.iString = iString;
tbb.dwData = lParam;
- return (BOOL)::SendMessage(m_hWnd, TB_INSERTBUTTON, nIndex, (LPARAM)&tbb);
+ return (BOOL)::SendMessage(this->m_hWnd, TB_INSERTBUTTON, nIndex, (LPARAM)&tbb);
}
BOOL InsertButton(int nIndex, int iCommand, BYTE Style, BYTE State, int iBitmap,
@@ -5875,132 +5676,136 @@ class CToolBarCtrlT : public TBase
BOOL DeleteButton(int nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_DELETEBUTTON, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_DELETEBUTTON, nIndex, 0L);
}
- UINT CommandToIndex(UINT nID) const
+ BOOL InsertSeparator(int nIndex, int cxWidth = 8)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, TB_COMMANDTOINDEX, nID, 0L);
+ return InsertButton(nIndex, 0, BTNS_SEP, 0, cxWidth, (INT_PTR)0, 0);
+ }
+
+ BOOL AddSeparator(int cxWidth = 8)
+ {
+ return AddButton(0, BTNS_SEP, 0, cxWidth, (INT_PTR)0, 0);
+ }
+
+ int CommandToIndex(UINT nID) const
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_COMMANDTOINDEX, nID, 0L);
}
-#ifndef _WIN32_WCE
void SaveState(HKEY hKeyRoot, LPCTSTR lpszSubKey, LPCTSTR lpszValueName)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TBSAVEPARAMS tbs = { 0 };
tbs.hkr = hKeyRoot;
tbs.pszSubKey = lpszSubKey;
tbs.pszValueName = lpszValueName;
- ::SendMessage(m_hWnd, TB_SAVERESTORE, (WPARAM)TRUE, (LPARAM)&tbs);
+ ::SendMessage(this->m_hWnd, TB_SAVERESTORE, (WPARAM)TRUE, (LPARAM)&tbs);
}
void RestoreState(HKEY hKeyRoot, LPCTSTR lpszSubKey, LPCTSTR lpszValueName)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TBSAVEPARAMS tbs = { 0 };
tbs.hkr = hKeyRoot;
tbs.pszSubKey = lpszSubKey;
tbs.pszValueName = lpszValueName;
- ::SendMessage(m_hWnd, TB_SAVERESTORE, (WPARAM)FALSE, (LPARAM)&tbs);
+ ::SendMessage(this->m_hWnd, TB_SAVERESTORE, (WPARAM)FALSE, (LPARAM)&tbs);
}
void Customize()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_CUSTOMIZE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_CUSTOMIZE, 0, 0L);
}
-#endif // !_WIN32_WCE
int AddString(UINT nStringID)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_ADDSTRING, (WPARAM)ModuleHelper::GetResourceInstance(), (LPARAM)nStringID);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_ADDSTRING, (WPARAM)ModuleHelper::GetResourceInstance(), (LPARAM)nStringID);
}
int AddStrings(LPCTSTR lpszStrings)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_ADDSTRING, 0, (LPARAM)lpszStrings);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_ADDSTRING, 0, (LPARAM)lpszStrings);
}
void AutoSize()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TB_AUTOSIZE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TB_AUTOSIZE, 0, 0L);
}
BOOL ChangeBitmap(int nID, int nBitmap)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_CHANGEBITMAP, nID, MAKELPARAM(nBitmap, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_CHANGEBITMAP, nID, MAKELPARAM(nBitmap, 0));
}
int LoadImages(int nBitmapID)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_LOADIMAGES, nBitmapID, (LPARAM)ModuleHelper::GetResourceInstance());
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_LOADIMAGES, nBitmapID, (LPARAM)ModuleHelper::GetResourceInstance());
}
int LoadStdImages(int nBitmapID)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_LOADIMAGES, nBitmapID, (LPARAM)HINST_COMMCTRL);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_LOADIMAGES, nBitmapID, (LPARAM)HINST_COMMCTRL);
}
BOOL ReplaceBitmap(LPTBREPLACEBITMAP ptbrb)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_REPLACEBITMAP, 0, (LPARAM)ptbrb);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_REPLACEBITMAP, 0, (LPARAM)ptbrb);
}
-#if (_WIN32_IE >= 0x0400)
int HitTest(LPPOINT lpPoint) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TB_HITTEST, 0, (LPARAM)lpPoint);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TB_HITTEST, 0, (LPARAM)lpPoint);
}
-#ifndef _WIN32_WCE
BOOL InsertMarkHitTest(LPPOINT lpPoint, LPTBINSERTMARK lptbim) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_INSERTMARKHITTEST, (WPARAM)lpPoint, (LPARAM)lptbim);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_INSERTMARKHITTEST, (WPARAM)lpPoint, (LPARAM)lptbim);
}
BOOL InsertMarkHitTest(int x, int y, LPTBINSERTMARK lptbim) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
POINT pt = { x, y };
- return (BOOL)::SendMessage(m_hWnd, TB_INSERTMARKHITTEST, (WPARAM)&pt, (LPARAM)lptbim);
+ return (BOOL)::SendMessage(this->m_hWnd, TB_INSERTMARKHITTEST, (WPARAM)&pt, (LPARAM)lptbim);
}
BOOL MapAccelerator(TCHAR chAccel, int& nID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_MAPACCELERATOR, (WPARAM)chAccel, (LPARAM)&nID);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_MAPACCELERATOR, (WPARAM)chAccel, (LPARAM)&nID);
}
BOOL MarkButton(int nID, BOOL bHighlight = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_MARKBUTTON, nID, MAKELPARAM(bHighlight, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_MARKBUTTON, nID, MAKELPARAM(bHighlight, 0));
}
BOOL MoveButton(int nOldPos, int nNewPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TB_MOVEBUTTON, nOldPos, nNewPos);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TB_MOVEBUTTON, nOldPos, nNewPos);
}
HRESULT GetObject(REFIID iid, LPVOID* ppvObject)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HRESULT)::SendMessage(m_hWnd, TB_GETOBJECT, (WPARAM)&iid, (LPARAM)ppvObject);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HRESULT)::SendMessage(this->m_hWnd, TB_GETOBJECT, (WPARAM)&iid, (LPARAM)ppvObject);
}
-#endif // !_WIN32_WCE
-#endif // (_WIN32_IE >= 0x0400)
};
typedef CToolBarCtrlT CToolBarCtrl;
@@ -6019,7 +5824,7 @@ class CStatusBarCtrlT : public TBase
CStatusBarCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -6038,21 +5843,21 @@ class CStatusBarCtrlT : public TBase
int GetParts(int nParts, int* pParts) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, SB_GETPARTS, nParts, (LPARAM)pParts);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, SB_GETPARTS, nParts, (LPARAM)pParts);
}
BOOL SetParts(int nParts, int* pWidths)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, SB_SETPARTS, nParts, (LPARAM)pWidths);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, SB_SETPARTS, nParts, (LPARAM)pWidths);
}
int GetTextLength(int nPane, int* pType = NULL) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(nPane < 256);
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, SB_GETTEXTLENGTH, (WPARAM)nPane, 0L);
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, SB_GETTEXTLENGTH, (WPARAM)nPane, 0L);
if (pType != NULL)
*pType = (int)(short)HIWORD(dwRet);
return (int)(short)LOWORD(dwRet);
@@ -6060,26 +5865,25 @@ class CStatusBarCtrlT : public TBase
int GetText(int nPane, LPTSTR lpszText, int* pType = NULL) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(nPane < 256);
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, SB_GETTEXT, (WPARAM)nPane, (LPARAM)lpszText);
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, SB_GETTEXT, (WPARAM)nPane, (LPARAM)lpszText);
if(pType != NULL)
*pType = (int)(short)HIWORD(dwRet);
return (int)(short)LOWORD(dwRet);
}
-#ifndef _ATL_NO_COM
BOOL GetTextBSTR(int nPane, BSTR& bstrText, int* pType = NULL) const
{
USES_CONVERSION;
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(nPane < 256);
ATLASSERT(bstrText == NULL);
- int nLength = (int)(short)LOWORD(::SendMessage(m_hWnd, SB_GETTEXTLENGTH, (WPARAM)nPane, 0L));
+ int nLength = (int)(short)LOWORD(::SendMessage(this->m_hWnd, SB_GETTEXTLENGTH, (WPARAM)nPane, 0L));
if(nLength == 0)
return FALSE;
- CTempBuffer buff;
+ ATL::CTempBuffer buff;
LPTSTR lpstrText = buff.Allocate(nLength + 1);
if(lpstrText == NULL)
return FALSE;
@@ -6090,14 +5894,13 @@ class CStatusBarCtrlT : public TBase
bstrText = ::SysAllocString(T2OLE(lpstrText));
return (bstrText != NULL) ? TRUE : FALSE;
}
-#endif // !_ATL_NO_COM
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
- int GetText(int nPane, _CSTRING_NS::CString& strText, int* pType = NULL) const
+#ifdef __ATLSTR_H__
+ int GetText(int nPane, ATL::CString& strText, int* pType = NULL) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(nPane < 256);
- int nLength = (int)(short)LOWORD(::SendMessage(m_hWnd, SB_GETTEXTLENGTH, (WPARAM)nPane, 0L));
+ int nLength = (int)(short)LOWORD(::SendMessage(this->m_hWnd, SB_GETTEXTLENGTH, (WPARAM)nPane, 0L));
if(nLength == 0)
return 0;
@@ -6106,33 +5909,33 @@ class CStatusBarCtrlT : public TBase
return 0;
return GetText(nPane, lpstr, pType);
}
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
+#endif // __ATLSTR_H__
BOOL SetText(int nPane, LPCTSTR lpszText, int nType = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(nPane < 256);
- return (BOOL)::SendMessage(m_hWnd, SB_SETTEXT, (nPane | nType), (LPARAM)lpszText);
+ return (BOOL)::SendMessage(this->m_hWnd, SB_SETTEXT, (nPane | nType), (LPARAM)lpszText);
}
BOOL GetRect(int nPane, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(nPane < 256);
- return (BOOL)::SendMessage(m_hWnd, SB_GETRECT, nPane, (LPARAM)lpRect);
+ return (BOOL)::SendMessage(this->m_hWnd, SB_GETRECT, nPane, (LPARAM)lpRect);
}
BOOL GetBorders(int* pBorders) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, SB_GETBORDERS, 0, (LPARAM)pBorders);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, SB_GETBORDERS, 0, (LPARAM)pBorders);
}
BOOL GetBorders(int& nHorz, int& nVert, int& nSpacing) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
int borders[3] = { 0, 0, 0 };
- BOOL bResult = (BOOL)::SendMessage(m_hWnd, SB_GETBORDERS, 0, (LPARAM)&borders);
+ BOOL bResult = (BOOL)::SendMessage(this->m_hWnd, SB_GETBORDERS, 0, (LPARAM)&borders);
if(bResult)
{
nHorz = borders[0];
@@ -6144,71 +5947,67 @@ class CStatusBarCtrlT : public TBase
void SetMinHeight(int nMin)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, SB_SETMINHEIGHT, nMin, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, SB_SETMINHEIGHT, nMin, 0L);
}
BOOL SetSimple(BOOL bSimple = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, SB_SIMPLE, bSimple, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, SB_SIMPLE, bSimple, 0L);
}
BOOL IsSimple() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, SB_ISSIMPLE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, SB_ISSIMPLE, 0, 0L);
}
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
BOOL GetUnicodeFormat() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, SB_GETUNICODEFORMAT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, SB_GETUNICODEFORMAT, 0, 0L);
}
BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, SB_SETUNICODEFORMAT, bUnicode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, SB_SETUNICODEFORMAT, bUnicode, 0L);
}
void GetTipText(int nPane, LPTSTR lpstrText, int nSize) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(nPane < 256);
- ::SendMessage(m_hWnd, SB_GETTIPTEXT, MAKEWPARAM(nPane, nSize), (LPARAM)lpstrText);
+ ::SendMessage(this->m_hWnd, SB_GETTIPTEXT, MAKEWPARAM(nPane, nSize), (LPARAM)lpstrText);
}
void SetTipText(int nPane, LPCTSTR lpstrText)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(nPane < 256);
- ::SendMessage(m_hWnd, SB_SETTIPTEXT, nPane, (LPARAM)lpstrText);
+ ::SendMessage(this->m_hWnd, SB_SETTIPTEXT, nPane, (LPARAM)lpstrText);
}
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
-#if ((_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 0x0500))
COLORREF SetBkColor(COLORREF clrBk)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, SB_SETBKCOLOR, 0, (LPARAM)clrBk);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, SB_SETBKCOLOR, 0, (LPARAM)clrBk);
}
HICON GetIcon(int nPane) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(nPane < 256);
- return (HICON)::SendMessage(m_hWnd, SB_GETICON, nPane, 0L);
+ return (HICON)::SendMessage(this->m_hWnd, SB_GETICON, nPane, 0L);
}
BOOL SetIcon(int nPane, HICON hIcon)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(nPane < 256);
- return (BOOL)::SendMessage(m_hWnd, SB_SETICON, nPane, (LPARAM)hIcon);
+ return (BOOL)::SendMessage(this->m_hWnd, SB_SETICON, nPane, (LPARAM)hIcon);
}
-#endif // ((_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 0x0500))
};
typedef CStatusBarCtrlT CStatusBarCtrl;
@@ -6227,7 +6026,7 @@ class CTabCtrlT : public TBase
CTabCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -6246,37 +6045,37 @@ class CTabCtrlT : public TBase
CImageList GetImageList() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TCM_GETIMAGELIST, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TCM_GETIMAGELIST, 0, 0L));
}
CImageList SetImageList(HIMAGELIST hImageList)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TCM_SETIMAGELIST, 0, (LPARAM)hImageList));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TCM_SETIMAGELIST, 0, (LPARAM)hImageList));
}
int GetItemCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TCM_GETITEMCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TCM_GETITEMCOUNT, 0, 0L);
}
BOOL GetItem(int nItem, LPTCITEM pTabCtrlItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TCM_GETITEM, nItem, (LPARAM)pTabCtrlItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TCM_GETITEM, nItem, (LPARAM)pTabCtrlItem);
}
BOOL SetItem(int nItem, LPTCITEM pTabCtrlItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TCM_SETITEM, nItem, (LPARAM)pTabCtrlItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TCM_SETITEM, nItem, (LPARAM)pTabCtrlItem);
}
int SetItem(int nItem, UINT mask, LPCTSTR lpszItem, DWORD dwState, DWORD dwStateMask, int iImage, LPARAM lParam)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TCITEM tci = { 0 };
tci.mask = mask;
tci.pszText = (LPTSTR) lpszItem;
@@ -6284,145 +6083,145 @@ class CTabCtrlT : public TBase
tci.dwStateMask = dwStateMask;
tci.iImage = iImage;
tci.lParam = lParam;
- return (int)::SendMessage(m_hWnd, TCM_SETITEM, nItem, (LPARAM)&tci);
+ return (int)::SendMessage(this->m_hWnd, TCM_SETITEM, nItem, (LPARAM)&tci);
}
BOOL GetItemRect(int nItem, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TCM_GETITEMRECT, nItem, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TCM_GETITEMRECT, nItem, (LPARAM)lpRect);
}
int GetCurSel() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TCM_GETCURSEL, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TCM_GETCURSEL, 0, 0L);
}
int SetCurSel(int nItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TCM_SETCURSEL, nItem, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TCM_SETCURSEL, nItem, 0L);
}
SIZE SetItemSize(SIZE size)
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dwSize = (DWORD)::SendMessage(m_hWnd, TCM_SETITEMSIZE, 0, MAKELPARAM(size.cx, size.cy));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwSize = (DWORD)::SendMessage(this->m_hWnd, TCM_SETITEMSIZE, 0, MAKELPARAM(size.cx, size.cy));
SIZE sizeRet = { GET_X_LPARAM(dwSize), GET_Y_LPARAM(dwSize) };
return sizeRet;
}
void SetItemSize(int cx, int cy)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TCM_SETITEMSIZE, 0, MAKELPARAM(cx, cy));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TCM_SETITEMSIZE, 0, MAKELPARAM(cx, cy));
}
void SetPadding(SIZE size)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TCM_SETPADDING, 0, MAKELPARAM(size.cx, size.cy));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TCM_SETPADDING, 0, MAKELPARAM(size.cx, size.cy));
}
int GetRowCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TCM_GETROWCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TCM_GETROWCOUNT, 0, 0L);
}
-#ifndef _WIN32_WCE
- CToolTipCtrl GetTooltips() const
+ CToolTipCtrl GetToolTips() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CToolTipCtrl((HWND)::SendMessage(m_hWnd, TCM_GETTOOLTIPS, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, TCM_GETTOOLTIPS, 0, 0L));
}
- void SetTooltips(HWND hWndToolTip)
+ // this method is deprecated, please use GetToolTips
+ CToolTipCtrl GetTooltips() const { return GetToolTips(); }
+
+ void SetToolTips(HWND hWndToolTip)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TCM_SETTOOLTIPS, (WPARAM)hWndToolTip, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TCM_SETTOOLTIPS, (WPARAM)hWndToolTip, 0L);
}
-#endif // !_WIN32_WCE
+
+ // this method is deprecated, please use SetToolTips
+ void SetTooltips(HWND hWndToolTip) { SetToolTips(hWndToolTip); }
int GetCurFocus() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TCM_GETCURFOCUS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TCM_GETCURFOCUS, 0, 0L);
}
void SetCurFocus(int nItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TCM_SETCURFOCUS, nItem, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TCM_SETCURFOCUS, nItem, 0L);
}
BOOL SetItemExtra(int cbExtra)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(GetItemCount() == 0); // must be empty
- return (BOOL)::SendMessage(m_hWnd, TCM_SETITEMEXTRA, cbExtra, 0L);
+ return (BOOL)::SendMessage(this->m_hWnd, TCM_SETITEMEXTRA, cbExtra, 0L);
}
int SetMinTabWidth(int nWidth = -1)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TCM_SETMINTABWIDTH, 0, nWidth);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TCM_SETMINTABWIDTH, 0, nWidth);
}
-#if (_WIN32_IE >= 0x0400)
DWORD GetExtendedStyle() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, TCM_GETEXTENDEDSTYLE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, TCM_GETEXTENDEDSTYLE, 0, 0L);
}
DWORD SetExtendedStyle(DWORD dwExMask, DWORD dwExStyle)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, TCM_SETEXTENDEDSTYLE, dwExMask, dwExStyle);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, TCM_SETEXTENDEDSTYLE, dwExMask, dwExStyle);
}
-#ifndef _WIN32_WCE
BOOL GetUnicodeFormat() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TCM_GETUNICODEFORMAT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TCM_GETUNICODEFORMAT, 0, 0L);
}
BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TCM_SETUNICODEFORMAT, bUnicode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TCM_SETUNICODEFORMAT, bUnicode, 0L);
}
-#endif // !_WIN32_WCE
-#endif // (_WIN32_IE >= 0x0400)
// Operations
int InsertItem(int nItem, LPTCITEM pTabCtrlItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)pTabCtrlItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)pTabCtrlItem);
}
int InsertItem(int nItem, UINT mask, LPCTSTR lpszItem, int iImage, LPARAM lParam)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TCITEM tci = { 0 };
tci.mask = mask;
tci.pszText = (LPTSTR) lpszItem;
tci.iImage = iImage;
tci.lParam = lParam;
- return (int)::SendMessage(m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)&tci);
+ return (int)::SendMessage(this->m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)&tci);
}
int InsertItem(int nItem, LPCTSTR lpszItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TCITEM tci = { 0 };
tci.mask = TCIF_TEXT;
tci.pszText = (LPTSTR) lpszItem;
- return (int)::SendMessage(m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)&tci);
+ return (int)::SendMessage(this->m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)&tci);
}
int AddItem(LPTCITEM pTabCtrlItem)
@@ -6442,47 +6241,45 @@ class CTabCtrlT : public TBase
BOOL DeleteItem(int nItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TCM_DELETEITEM, nItem, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TCM_DELETEITEM, nItem, 0L);
}
BOOL DeleteAllItems()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TCM_DELETEALLITEMS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TCM_DELETEALLITEMS, 0, 0L);
}
void AdjustRect(BOOL bLarger, LPRECT lpRect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TCM_ADJUSTRECT, bLarger, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TCM_ADJUSTRECT, bLarger, (LPARAM)lpRect);
}
void RemoveImage(int nImage)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TCM_REMOVEIMAGE, nImage, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TCM_REMOVEIMAGE, nImage, 0L);
}
int HitTest(TC_HITTESTINFO* pHitTestInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TCM_HITTEST, 0, (LPARAM)pHitTestInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TCM_HITTEST, 0, (LPARAM)pHitTestInfo);
}
void DeselectAll(BOOL bExcludeFocus = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TCM_DESELECTALL, bExcludeFocus, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TCM_DESELECTALL, bExcludeFocus, 0L);
}
-#if (_WIN32_IE >= 0x0400)
BOOL HighlightItem(int nIndex, BOOL bHighlight = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TCM_HIGHLIGHTITEM, nIndex, MAKELPARAM(bHighlight, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TCM_HIGHLIGHTITEM, nIndex, MAKELPARAM(bHighlight, 0));
}
-#endif // (_WIN32_IE >= 0x0400)
};
typedef CTabCtrlT CTabCtrl;
@@ -6501,7 +6298,7 @@ class CTrackBarCtrlT : public TBase
CTrackBarCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -6520,50 +6317,50 @@ class CTrackBarCtrlT : public TBase
int GetLineSize() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_GETLINESIZE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_GETLINESIZE, 0, 0L);
}
int SetLineSize(int nSize)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_SETLINESIZE, 0, nSize);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_SETLINESIZE, 0, nSize);
}
int GetPageSize() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_GETPAGESIZE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_GETPAGESIZE, 0, 0L);
}
int SetPageSize(int nSize)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_SETPAGESIZE, 0, nSize);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_SETPAGESIZE, 0, nSize);
}
int GetRangeMin() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_GETRANGEMIN, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_GETRANGEMIN, 0, 0L);
}
void SetRangeMin(int nMin, BOOL bRedraw = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_SETRANGEMIN, bRedraw, nMin);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_SETRANGEMIN, bRedraw, nMin);
}
int GetRangeMax() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_GETRANGEMAX, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_GETRANGEMAX, 0, 0L);
}
void SetRangeMax(int nMax, BOOL bRedraw = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_SETRANGEMAX, bRedraw, nMax);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_SETRANGEMAX, bRedraw, nMax);
}
void GetRange(int& nMin, int& nMax) const
@@ -6574,32 +6371,32 @@ class CTrackBarCtrlT : public TBase
void SetRange(int nMin, int nMax, BOOL bRedraw = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_SETRANGE, bRedraw, MAKELPARAM(nMin, nMax));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_SETRANGE, bRedraw, MAKELPARAM(nMin, nMax));
}
int GetSelStart() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_GETSELSTART, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_GETSELSTART, 0, 0L);
}
- void SetSelStart(int nMin)
+ void SetSelStart(int nMin, BOOL bRedraw = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_SETSELSTART, 0, (LPARAM)nMin);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_SETSELSTART, bRedraw, (LPARAM)nMin);
}
int GetSelEnd() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_GETSELEND, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_GETSELEND, 0, 0L);
}
- void SetSelEnd(int nMax)
+ void SetSelEnd(int nMax, BOOL bRedraw = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_SETSELEND, 0, (LPARAM)nMax);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_SETSELEND, bRedraw, (LPARAM)nMax);
}
void GetSelection(int& nMin, int& nMax) const
@@ -6608,154 +6405,150 @@ class CTrackBarCtrlT : public TBase
nMax = GetSelEnd();
}
- void SetSelection(int nMin, int nMax)
+ void SetSelection(int nMin, int nMax, BOOL bRedraw = TRUE)
{
- SetSelStart(nMin);
- SetSelEnd(nMax);
+ SetSelStart(nMin, FALSE);
+ SetSelEnd(nMax, bRedraw);
}
void GetChannelRect(LPRECT lprc) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_GETCHANNELRECT, 0, (LPARAM)lprc);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_GETCHANNELRECT, 0, (LPARAM)lprc);
}
void GetThumbRect(LPRECT lprc) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_GETTHUMBRECT, 0, (LPARAM)lprc);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_GETTHUMBRECT, 0, (LPARAM)lprc);
}
int GetPos() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_GETPOS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_GETPOS, 0, 0L);
}
void SetPos(int nPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_SETPOS, TRUE, nPos);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_SETPOS, TRUE, nPos);
}
UINT GetNumTics() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, TBM_GETNUMTICS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, TBM_GETNUMTICS, 0, 0L);
}
DWORD* GetTicArray() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD*)::SendMessage(m_hWnd, TBM_GETPTICS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD*)::SendMessage(this->m_hWnd, TBM_GETPTICS, 0, 0L);
}
int GetTic(int nTic) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_GETTIC, nTic, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_GETTIC, nTic, 0L);
}
BOOL SetTic(int nTic)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TBM_SETTIC, 0, nTic);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TBM_SETTIC, 0, nTic);
}
int GetTicPos(int nTic) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_GETTICPOS, nTic, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_GETTICPOS, nTic, 0L);
}
void SetTicFreq(int nFreq)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_SETTICFREQ, nFreq, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_SETTICFREQ, nFreq, 0L);
}
int GetThumbLength() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_GETTHUMBLENGTH, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_GETTHUMBLENGTH, 0, 0L);
}
void SetThumbLength(int nLength)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_SETTHUMBLENGTH, nLength, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_SETTHUMBLENGTH, nLength, 0L);
}
void SetSel(int nStart, int nEnd, BOOL bRedraw = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & TBS_ENABLESELRANGE) != 0);
- ::SendMessage(m_hWnd, TBM_SETSEL, bRedraw, MAKELPARAM(nStart, nEnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & TBS_ENABLESELRANGE) != 0);
+ ::SendMessage(this->m_hWnd, TBM_SETSEL, bRedraw, MAKELPARAM(nStart, nEnd));
}
ATL::CWindow GetBuddy(BOOL bLeft = TRUE) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return ATL::CWindow((HWND)::SendMessage(m_hWnd, TBM_GETBUDDY, bLeft, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return ATL::CWindow((HWND)::SendMessage(this->m_hWnd, TBM_GETBUDDY, bLeft, 0L));
}
ATL::CWindow SetBuddy(HWND hWndBuddy, BOOL bLeft = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return ATL::CWindow((HWND)::SendMessage(m_hWnd, TBM_SETBUDDY, bLeft, (LPARAM)hWndBuddy));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return ATL::CWindow((HWND)::SendMessage(this->m_hWnd, TBM_SETBUDDY, bLeft, (LPARAM)hWndBuddy));
}
-#ifndef _WIN32_WCE
CToolTipCtrl GetToolTips() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CToolTipCtrl((HWND)::SendMessage(m_hWnd, TBM_GETTOOLTIPS, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, TBM_GETTOOLTIPS, 0, 0L));
}
void SetToolTips(HWND hWndTT)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_SETTOOLTIPS, (WPARAM)hWndTT, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_SETTOOLTIPS, (WPARAM)hWndTT, 0L);
}
int SetTipSide(int nSide)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, TBM_SETTIPSIDE, nSide, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, TBM_SETTIPSIDE, nSide, 0L);
}
-#endif // !_WIN32_WCE
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
BOOL GetUnicodeFormat() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TBM_GETUNICODEFORMAT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TBM_GETUNICODEFORMAT, 0, 0L);
}
BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, TBM_SETUNICODEFORMAT, bUnicode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, TBM_SETUNICODEFORMAT, bUnicode, 0L);
}
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
// Operations
void ClearSel(BOOL bRedraw = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_CLEARSEL, bRedraw, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_CLEARSEL, bRedraw, 0L);
}
void VerifyPos()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_SETPOS, FALSE, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_SETPOS, FALSE, 0L);
}
void ClearTics(BOOL bRedraw = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, TBM_CLEARTICS, bRedraw, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, TBM_CLEARTICS, bRedraw, 0L);
}
};
@@ -6775,7 +6568,7 @@ class CUpDownCtrlT : public TBase
CUpDownCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -6794,44 +6587,44 @@ class CUpDownCtrlT : public TBase
UINT GetAccel(int nAccel, UDACCEL* pAccel) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)LOWORD(::SendMessage(m_hWnd, UDM_GETACCEL, nAccel, (LPARAM)pAccel));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)LOWORD(::SendMessage(this->m_hWnd, UDM_GETACCEL, nAccel, (LPARAM)pAccel));
}
BOOL SetAccel(int nAccel, UDACCEL* pAccel)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)LOWORD(::SendMessage(m_hWnd, UDM_SETACCEL, nAccel, (LPARAM)pAccel));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)LOWORD(::SendMessage(this->m_hWnd, UDM_SETACCEL, nAccel, (LPARAM)pAccel));
}
UINT GetBase() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)LOWORD(::SendMessage(m_hWnd, UDM_GETBASE, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)LOWORD(::SendMessage(this->m_hWnd, UDM_GETBASE, 0, 0L));
}
int SetBase(int nBase)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, UDM_SETBASE, nBase, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, UDM_SETBASE, nBase, 0L);
}
ATL::CWindow GetBuddy() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return ATL::CWindow((HWND)::SendMessage(m_hWnd, UDM_GETBUDDY, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return ATL::CWindow((HWND)::SendMessage(this->m_hWnd, UDM_GETBUDDY, 0, 0L));
}
ATL::CWindow SetBuddy(HWND hWndBuddy)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return ATL::CWindow((HWND)::SendMessage(m_hWnd, UDM_SETBUDDY, (WPARAM)hWndBuddy, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return ATL::CWindow((HWND)::SendMessage(this->m_hWnd, UDM_SETBUDDY, (WPARAM)hWndBuddy, 0L));
}
int GetPos(LPBOOL lpbError = NULL) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, UDM_GETPOS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, UDM_GETPOS, 0, 0L);
// Note: Seems that Windows always sets error to TRUE if
// UDS_SETBUDDYINT style is not used
if(lpbError != NULL)
@@ -6841,73 +6634,67 @@ class CUpDownCtrlT : public TBase
int SetPos(int nPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)(short)LOWORD(::SendMessage(m_hWnd, UDM_SETPOS, 0, MAKELPARAM(nPos, 0)));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)(short)LOWORD(::SendMessage(this->m_hWnd, UDM_SETPOS, 0, MAKELPARAM(nPos, 0)));
}
DWORD GetRange() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, UDM_GETRANGE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, UDM_GETRANGE, 0, 0L);
}
void GetRange(int& nLower, int& nUpper) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, UDM_GETRANGE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, UDM_GETRANGE, 0, 0L);
nLower = (int)(short)HIWORD(dwRet);
nUpper = (int)(short)LOWORD(dwRet);
}
void SetRange(int nLower, int nUpper)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, UDM_SETRANGE, 0, MAKELPARAM(nUpper, nLower));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, UDM_SETRANGE, 0, MAKELPARAM(nUpper, nLower));
}
-#if (_WIN32_IE >= 0x0400)
void SetRange32(int nLower, int nUpper)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, UDM_SETRANGE32, nLower, nUpper);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, UDM_SETRANGE32, nLower, nUpper);
}
void GetRange32(int& nLower, int& nUpper) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, UDM_GETRANGE32, (WPARAM)&nLower, (LPARAM)&nUpper);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, UDM_GETRANGE32, (WPARAM)&nLower, (LPARAM)&nUpper);
}
-#ifndef _WIN32_WCE
BOOL GetUnicodeFormat() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, UDM_GETUNICODEFORMAT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, UDM_GETUNICODEFORMAT, 0, 0L);
}
BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, UDM_SETUNICODEFORMAT, bUnicode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, UDM_SETUNICODEFORMAT, bUnicode, 0L);
}
-#endif // !_WIN32_WCE
-#endif // (_WIN32_IE >= 0x0400)
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
int GetPos32(LPBOOL lpbError = NULL) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
// Note: Seems that Windows always sets error to TRUE if
// UDS_SETBUDDYINT style is not used
- return (int)::SendMessage(m_hWnd, UDM_GETPOS32, 0, (LPARAM)lpbError);
+ return (int)::SendMessage(this->m_hWnd, UDM_GETPOS32, 0, (LPARAM)lpbError);
}
int SetPos32(int nPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, UDM_SETPOS32, 0, (LPARAM)nPos);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, UDM_SETPOS32, 0, (LPARAM)nPos);
}
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
};
typedef CUpDownCtrlT CUpDownCtrl;
@@ -6926,7 +6713,7 @@ class CProgressBarCtrlT : public TBase
CProgressBarCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -6945,121 +6732,119 @@ class CProgressBarCtrlT : public TBase
DWORD SetRange(int nLower, int nUpper)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, PBM_SETRANGE, 0, MAKELPARAM(nLower, nUpper));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, PBM_SETRANGE, 0, MAKELPARAM(nLower, nUpper));
}
int SetPos(int nPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)(short)LOWORD(::SendMessage(m_hWnd, PBM_SETPOS, nPos, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)(short)LOWORD(::SendMessage(this->m_hWnd, PBM_SETPOS, nPos, 0L));
}
int OffsetPos(int nPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)(short)LOWORD(::SendMessage(m_hWnd, PBM_DELTAPOS, nPos, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)(short)LOWORD(::SendMessage(this->m_hWnd, PBM_DELTAPOS, nPos, 0L));
}
int SetStep(int nStep)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)(short)LOWORD(::SendMessage(m_hWnd, PBM_SETSTEP, nStep, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)(short)LOWORD(::SendMessage(this->m_hWnd, PBM_SETSTEP, nStep, 0L));
}
UINT GetPos() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, PBM_GETPOS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, PBM_GETPOS, 0, 0L);
}
void GetRange(PPBRANGE pPBRange) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(pPBRange != NULL);
- ::SendMessage(m_hWnd, PBM_GETRANGE, TRUE, (LPARAM)pPBRange);
+ ::SendMessage(this->m_hWnd, PBM_GETRANGE, TRUE, (LPARAM)pPBRange);
}
void GetRange(int& nLower, int& nUpper) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
PBRANGE range = { 0 };
- ::SendMessage(m_hWnd, PBM_GETRANGE, TRUE, (LPARAM)&range);
+ ::SendMessage(this->m_hWnd, PBM_GETRANGE, TRUE, (LPARAM)&range);
nLower = range.iLow;
nUpper = range.iHigh;
}
int GetRangeLimit(BOOL bLowLimit) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, PBM_GETRANGE, bLowLimit, (LPARAM)NULL);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, PBM_GETRANGE, bLowLimit, (LPARAM)NULL);
}
DWORD SetRange32(int nMin, int nMax)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, PBM_SETRANGE32, nMin, nMax);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, PBM_SETRANGE32, nMin, nMax);
}
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
COLORREF SetBarColor(COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, PBM_SETBARCOLOR, 0, (LPARAM)clr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, PBM_SETBARCOLOR, 0, (LPARAM)clr);
}
COLORREF SetBkColor(COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, PBM_SETBKCOLOR, 0, (LPARAM)clr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, PBM_SETBKCOLOR, 0, (LPARAM)clr);
}
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
-#if (_WIN32_WINNT >= 0x0501) && defined(PBM_SETMARQUEE)
+#ifdef PBM_SETMARQUEE
BOOL SetMarquee(BOOL bMarquee, UINT uUpdateTime = 0U)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, PBM_SETMARQUEE, (WPARAM)bMarquee, (LPARAM)uUpdateTime);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, PBM_SETMARQUEE, (WPARAM)bMarquee, (LPARAM)uUpdateTime);
}
-#endif // (_WIN32_WINNT >= 0x0501) && defined(PBM_SETMARQUEE)
+#endif
#if (_WIN32_WINNT >= 0x0600)
int GetStep() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, PBM_GETSTEP, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, PBM_GETSTEP, 0, 0L);
}
COLORREF GetBkColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, PBM_GETBKCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, PBM_GETBKCOLOR, 0, 0L);
}
COLORREF GetBarColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, PBM_GETBARCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, PBM_GETBARCOLOR, 0, 0L);
}
int GetState() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, PBM_GETSTATE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, PBM_GETSTATE, 0, 0L);
}
int SetState(int nState)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, PBM_SETSTATE, nState, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, PBM_SETSTATE, nState, 0L);
}
#endif // (_WIN32_WINNT >= 0x0600)
// Operations
int StepIt()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)(short)LOWORD(::SendMessage(m_hWnd, PBM_STEPIT, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)(short)LOWORD(::SendMessage(this->m_hWnd, PBM_STEPIT, 0, 0L));
}
};
@@ -7069,8 +6854,6 @@ typedef CProgressBarCtrlT CProgressBarCtrl;
///////////////////////////////////////////////////////////////////////////////
// CHotKeyCtrl
-#ifndef _WIN32_WCE
-
template
class CHotKeyCtrlT : public TBase
{
@@ -7081,7 +6864,7 @@ class CHotKeyCtrlT : public TBase
CHotKeyCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -7100,41 +6883,37 @@ class CHotKeyCtrlT : public TBase
DWORD GetHotKey() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, HKM_GETHOTKEY, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, HKM_GETHOTKEY, 0, 0L);
}
void GetHotKey(WORD &wVirtualKeyCode, WORD &wModifiers) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dw = (DWORD)::SendMessage(m_hWnd, HKM_GETHOTKEY, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dw = (DWORD)::SendMessage(this->m_hWnd, HKM_GETHOTKEY, 0, 0L);
wVirtualKeyCode = LOBYTE(LOWORD(dw));
wModifiers = HIBYTE(LOWORD(dw));
}
void SetHotKey(WORD wVirtualKeyCode, WORD wModifiers)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, HKM_SETHOTKEY, MAKEWORD(wVirtualKeyCode, wModifiers), 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, HKM_SETHOTKEY, MAKEWORD(wVirtualKeyCode, wModifiers), 0L);
}
void SetRules(WORD wInvalidComb, WORD wModifiers)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, HKM_SETRULES, wInvalidComb, MAKELPARAM(wModifiers, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, HKM_SETRULES, wInvalidComb, MAKELPARAM(wModifiers, 0));
}
};
typedef CHotKeyCtrlT CHotKeyCtrl;
-#endif // !_WIN32_WCE
-
///////////////////////////////////////////////////////////////////////////////
// CAnimateCtrl
-#ifndef _WIN32_WCE
-
template
class CAnimateCtrlT : public TBase
{
@@ -7145,7 +6924,7 @@ class CAnimateCtrlT : public TBase
CAnimateCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -7165,61 +6944,52 @@ class CAnimateCtrlT : public TBase
// Operations
BOOL Open(ATL::_U_STRINGorID FileName)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, ACM_OPEN, 0, (LPARAM)FileName.m_lpstr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, ACM_OPEN, 0, (LPARAM)FileName.m_lpstr);
}
BOOL Play(UINT nFrom, UINT nTo, UINT nRep)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, ACM_PLAY, nRep, MAKELPARAM(nFrom, nTo));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, ACM_PLAY, nRep, MAKELPARAM(nFrom, nTo));
}
BOOL Stop()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, ACM_STOP, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, ACM_STOP, 0, 0L);
}
BOOL Close()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, ACM_OPEN, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, ACM_OPEN, 0, 0L);
}
BOOL Seek(UINT nTo)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, ACM_PLAY, 0, MAKELPARAM(nTo, nTo));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, ACM_PLAY, 0, MAKELPARAM(nTo, nTo));
}
// Vista only
BOOL IsPlaying() const
{
-#ifndef ACM_ISPLAYING
- const UINT ACM_ISPLAYING = (WM_USER+104);
-#endif
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, ACM_ISPLAYING, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, ACM_ISPLAYING, 0, 0L);
}
};
typedef CAnimateCtrlT CAnimateCtrl;
-#endif // !_WIN32_WCE
-
///////////////////////////////////////////////////////////////////////////////
// CRichEditCtrl
-#ifndef _WIN32_WCE
-
-#ifdef _UNICODE
-#if (_RICHEDIT_VER == 0x0100)
-#undef RICHEDIT_CLASS
-#define RICHEDIT_CLASS L"RICHEDIT"
-#endif // (_RICHEDIT_VER == 0x0100)
-#endif // _UNICODE
+#if !defined(_UNICODE) && (_RICHEDIT_VER >= 0x0500)
+ #undef MSFTEDIT_CLASS
+ #define MSFTEDIT_CLASS "RICHEDIT50W"
+#endif
template
class CRichEditCtrlT : public TBase
@@ -7231,7 +7001,7 @@ class CRichEditCtrlT : public TBase
CRichEditCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -7245,106 +7015,110 @@ class CRichEditCtrlT : public TBase
// Attributes
static LPCTSTR GetWndClassName()
{
+#if (_RICHEDIT_VER >= 0x0500)
+ return MSFTEDIT_CLASS;
+#else
return RICHEDIT_CLASS;
+#endif
}
static LPCTSTR GetLibraryName()
{
-#if (_RICHEDIT_VER >= 0x0200)
- return _T("RICHED20.DLL");
+#if (_RICHEDIT_VER >= 0x0500)
+ return _T("MSFTEDIT.DLL");
#else
- return _T("RICHED32.DLL");
+ return _T("RICHED20.DLL");
#endif
}
int GetLineCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_GETLINECOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_GETLINECOUNT, 0, 0L);
}
BOOL GetModify() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_GETMODIFY, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_GETMODIFY, 0, 0L);
}
void SetModify(BOOL bModified = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETMODIFY, bModified, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETMODIFY, bModified, 0L);
}
void GetRect(LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_GETRECT, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_GETRECT, 0, (LPARAM)lpRect);
}
DWORD GetOptions() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, EM_GETOPTIONS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETOPTIONS, 0, 0L);
}
DWORD SetOptions(WORD wOperation, DWORD dwOptions)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, EM_SETOPTIONS, wOperation, dwOptions);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, EM_SETOPTIONS, wOperation, dwOptions);
}
// NOTE: first word in lpszBuffer must contain the size of the buffer!
int GetLine(int nIndex, LPTSTR lpszBuffer) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);
}
int GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
*(LPWORD)lpszBuffer = (WORD)nMaxLength;
- return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);
+ return (int)::SendMessage(this->m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);
}
BOOL CanUndo() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_CANUNDO, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_CANUNDO, 0, 0L);
}
BOOL CanPaste(UINT nFormat = 0) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_CANPASTE, nFormat, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_CANPASTE, nFormat, 0L);
}
void GetSel(LONG& nStartChar, LONG& nEndChar) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
CHARRANGE cr = { 0, 0 };
- ::SendMessage(m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);
+ ::SendMessage(this->m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);
nStartChar = cr.cpMin;
nEndChar = cr.cpMax;
}
void GetSel(CHARRANGE &cr) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);
}
int SetSel(LONG nStartChar, LONG nEndChar)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
CHARRANGE cr = { nStartChar, nEndChar };
- return (int)::SendMessage(m_hWnd, EM_EXSETSEL, 0, (LPARAM)&cr);
+ return (int)::SendMessage(this->m_hWnd, EM_EXSETSEL, 0, (LPARAM)&cr);
}
int SetSel(CHARRANGE &cr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_EXSETSEL, 0, (LPARAM)&cr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_EXSETSEL, 0, (LPARAM)&cr);
}
int SetSelAll()
@@ -7359,340 +7133,279 @@ class CRichEditCtrlT : public TBase
DWORD GetDefaultCharFormat(CHARFORMAT& cf) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
cf.cbSize = sizeof(CHARFORMAT);
- return (DWORD)::SendMessage(m_hWnd, EM_GETCHARFORMAT, 0, (LPARAM)&cf);
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETCHARFORMAT, 0, (LPARAM)&cf);
}
DWORD GetSelectionCharFormat(CHARFORMAT& cf) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
cf.cbSize = sizeof(CHARFORMAT);
- return (DWORD)::SendMessage(m_hWnd, EM_GETCHARFORMAT, 1, (LPARAM)&cf);
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETCHARFORMAT, 1, (LPARAM)&cf);
}
DWORD GetEventMask() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, EM_GETEVENTMASK, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETEVENTMASK, 0, 0L);
}
LONG GetLimitText() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (LONG)::SendMessage(m_hWnd, EM_GETLIMITTEXT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (LONG)::SendMessage(this->m_hWnd, EM_GETLIMITTEXT, 0, 0L);
}
DWORD GetParaFormat(PARAFORMAT& pf) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
pf.cbSize = sizeof(PARAFORMAT);
- return (DWORD)::SendMessage(m_hWnd, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
}
-#if (_RICHEDIT_VER >= 0x0200)
LONG GetSelText(LPTSTR lpstrBuff) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (LONG)::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrBuff);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (LONG)::SendMessage(this->m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrBuff);
}
-#else // !(_RICHEDIT_VER >= 0x0200)
- // RichEdit 1.0 EM_GETSELTEXT is ANSI only
- LONG GetSelText(LPSTR lpstrBuff) const
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return (LONG)::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrBuff);
- }
-#endif // !(_RICHEDIT_VER >= 0x0200)
-#ifndef _ATL_NO_COM
BOOL GetSelTextBSTR(BSTR& bstrText) const
{
USES_CONVERSION;
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(bstrText == NULL);
CHARRANGE cr = { 0, 0 };
- ::SendMessage(m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);
+ ::SendMessage(this->m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);
-#if (_RICHEDIT_VER >= 0x0200)
- CTempBuffer buff;
+ ATL::CTempBuffer buff;
LPTSTR lpstrText = buff.Allocate(cr.cpMax - cr.cpMin + 1);
if(lpstrText == NULL)
return FALSE;
- if(::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrText) == 0)
+ if(::SendMessage(this->m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrText) == 0)
return FALSE;
bstrText = ::SysAllocString(T2W(lpstrText));
-#else // !(_RICHEDIT_VER >= 0x0200)
- CTempBuffer buff;
- LPSTR lpstrText = buff.Allocate(cr.cpMax - cr.cpMin + 1);
- if(lpstrText == NULL)
- return FALSE;
- if(::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrText) == 0)
- return FALSE;
-
- bstrText = ::SysAllocString(A2W(lpstrText));
-#endif // !(_RICHEDIT_VER >= 0x0200)
return (bstrText != NULL) ? TRUE : FALSE;
}
-#endif // !_ATL_NO_COM
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
- LONG GetSelText(_CSTRING_NS::CString& strText) const
+#ifdef __ATLSTR_H__
+ LONG GetSelText(ATL::CString& strText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
CHARRANGE cr = { 0, 0 };
- ::SendMessage(m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);
+ ::SendMessage(this->m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);
-#if (_RICHEDIT_VER >= 0x0200)
LONG lLen = 0;
LPTSTR lpstrText = strText.GetBufferSetLength(cr.cpMax - cr.cpMin);
if(lpstrText != NULL)
{
- lLen = (LONG)::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrText);
+ lLen = (LONG)::SendMessage(this->m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrText);
strText.ReleaseBuffer();
}
-#else // !(_RICHEDIT_VER >= 0x0200)
- CTempBuffer buff;
- LPSTR lpstrText = buff.Allocate(cr.cpMax - cr.cpMin + 1);
- if(lpstrText == NULL)
- return 0;
- LONG lLen = (LONG)::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrText);
- if(lLen == 0)
- return 0;
-
- USES_CONVERSION;
- strText = A2T(lpstrText);
-#endif // !(_RICHEDIT_VER >= 0x0200)
return lLen;
}
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
+#endif // __ATLSTR_H__
WORD GetSelectionType() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (WORD)::SendMessage(m_hWnd, EM_SELECTIONTYPE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (WORD)::SendMessage(this->m_hWnd, EM_SELECTIONTYPE, 0, 0L);
}
COLORREF SetBackgroundColor(COLORREF cr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, EM_SETBKGNDCOLOR, 0, cr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, EM_SETBKGNDCOLOR, 0, cr);
}
COLORREF SetBackgroundColor() // sets to system background
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, EM_SETBKGNDCOLOR, 1, 0);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, EM_SETBKGNDCOLOR, 1, 0);
}
BOOL SetCharFormat(CHARFORMAT& cf, WORD wFlags)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
cf.cbSize = sizeof(CHARFORMAT);
- return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, (WPARAM)wFlags, (LPARAM)&cf);
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, (WPARAM)wFlags, (LPARAM)&cf);
}
BOOL SetDefaultCharFormat(CHARFORMAT& cf)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
cf.cbSize = sizeof(CHARFORMAT);
- return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, 0, (LPARAM)&cf);
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, 0, (LPARAM)&cf);
}
BOOL SetSelectionCharFormat(CHARFORMAT& cf)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
cf.cbSize = sizeof(CHARFORMAT);
- return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
}
BOOL SetWordCharFormat(CHARFORMAT& cf)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
cf.cbSize = sizeof(CHARFORMAT);
- return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION | SCF_WORD, (LPARAM)&cf);
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION | SCF_WORD, (LPARAM)&cf);
}
DWORD SetEventMask(DWORD dwEventMask)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, EM_SETEVENTMASK, 0, dwEventMask);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, EM_SETEVENTMASK, 0, dwEventMask);
}
BOOL SetParaFormat(PARAFORMAT& pf)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
pf.cbSize = sizeof(PARAFORMAT);
- return (BOOL)::SendMessage(m_hWnd, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
}
BOOL SetTargetDevice(HDC hDC, int cxLineWidth)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SETTARGETDEVICE, (WPARAM)hDC, cxLineWidth);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETTARGETDEVICE, (WPARAM)hDC, cxLineWidth);
}
int GetTextLength() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, WM_GETTEXTLENGTH, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, WM_GETTEXTLENGTH, 0, 0L);
}
BOOL SetReadOnly(BOOL bReadOnly = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SETREADONLY, bReadOnly, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETREADONLY, bReadOnly, 0L);
}
int GetFirstVisibleLine() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_GETFIRSTVISIBLELINE, 0, 0L);
- }
-
- EDITWORDBREAKPROCEX GetWordBreakProcEx() const
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return (EDITWORDBREAKPROCEX)::SendMessage(m_hWnd, EM_GETWORDBREAKPROCEX, 0, 0L);
- }
-
- EDITWORDBREAKPROCEX SetWordBreakProcEx(EDITWORDBREAKPROCEX pfnEditWordBreakProcEx)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return (EDITWORDBREAKPROCEX)::SendMessage(m_hWnd, EM_SETWORDBREAKPROCEX, 0, (LPARAM)pfnEditWordBreakProcEx);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_GETFIRSTVISIBLELINE, 0, 0L);
}
int GetTextRange(TEXTRANGE* pTextRange) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)pTextRange);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)pTextRange);
}
-#if (_RICHEDIT_VER >= 0x0200)
int GetTextRange(LONG nStartChar, LONG nEndChar, LPTSTR lpstrText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
TEXTRANGE tr = { 0 };
tr.chrg.cpMin = nStartChar;
tr.chrg.cpMax = nEndChar;
tr.lpstrText = lpstrText;
- return (int)::SendMessage(m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
+ return (int)::SendMessage(this->m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
}
-#else // !(_RICHEDIT_VER >= 0x0200)
- int GetTextRange(LONG nStartChar, LONG nEndChar, LPSTR lpstrText) const
- {
- ATLASSERT(::IsWindow(m_hWnd));
- TEXTRANGE tr = { 0 };
- tr.chrg.cpMin = nStartChar;
- tr.chrg.cpMax = nEndChar;
- tr.lpstrText = lpstrText;
- return (int)::SendMessage(m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
- }
-#endif // !(_RICHEDIT_VER >= 0x0200)
-
-#if (_RICHEDIT_VER >= 0x0200)
DWORD GetDefaultCharFormat(CHARFORMAT2& cf) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
cf.cbSize = sizeof(CHARFORMAT2);
- return (DWORD)::SendMessage(m_hWnd, EM_GETCHARFORMAT, 0, (LPARAM)&cf);
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETCHARFORMAT, 0, (LPARAM)&cf);
}
BOOL SetCharFormat(CHARFORMAT2& cf, WORD wFlags)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
cf.cbSize = sizeof(CHARFORMAT2);
- return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, (WPARAM)wFlags, (LPARAM)&cf);
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, (WPARAM)wFlags, (LPARAM)&cf);
}
BOOL SetDefaultCharFormat(CHARFORMAT2& cf)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
cf.cbSize = sizeof(CHARFORMAT2);
- return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, 0, (LPARAM)&cf);
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, 0, (LPARAM)&cf);
}
DWORD GetSelectionCharFormat(CHARFORMAT2& cf) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
cf.cbSize = sizeof(CHARFORMAT2);
- return (DWORD)::SendMessage(m_hWnd, EM_GETCHARFORMAT, 1, (LPARAM)&cf);
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETCHARFORMAT, 1, (LPARAM)&cf);
}
BOOL SetSelectionCharFormat(CHARFORMAT2& cf)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
cf.cbSize = sizeof(CHARFORMAT2);
- return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
}
BOOL SetWordCharFormat(CHARFORMAT2& cf)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
cf.cbSize = sizeof(CHARFORMAT2);
- return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION | SCF_WORD, (LPARAM)&cf);
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION | SCF_WORD, (LPARAM)&cf);
}
DWORD GetParaFormat(PARAFORMAT2& pf) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
pf.cbSize = sizeof(PARAFORMAT2);
- return (DWORD)::SendMessage(m_hWnd, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
}
BOOL SetParaFormat(PARAFORMAT2& pf)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
pf.cbSize = sizeof(PARAFORMAT2);
- return (BOOL)::SendMessage(m_hWnd, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
}
TEXTMODE GetTextMode() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (TEXTMODE)::SendMessage(m_hWnd, EM_GETTEXTMODE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (TEXTMODE)::SendMessage(this->m_hWnd, EM_GETTEXTMODE, 0, 0L);
}
BOOL SetTextMode(TEXTMODE enumTextMode)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return !(BOOL)::SendMessage(m_hWnd, EM_SETTEXTMODE, enumTextMode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return !(BOOL)::SendMessage(this->m_hWnd, EM_SETTEXTMODE, enumTextMode, 0L);
}
UNDONAMEID GetUndoName() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UNDONAMEID)::SendMessage(m_hWnd, EM_GETUNDONAME, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UNDONAMEID)::SendMessage(this->m_hWnd, EM_GETUNDONAME, 0, 0L);
}
UNDONAMEID GetRedoName() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UNDONAMEID)::SendMessage(m_hWnd, EM_GETREDONAME, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UNDONAMEID)::SendMessage(this->m_hWnd, EM_GETREDONAME, 0, 0L);
}
BOOL CanRedo() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_CANREDO, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_CANREDO, 0, 0L);
}
BOOL GetAutoURLDetect() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_GETAUTOURLDETECT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_GETAUTOURLDETECT, 0, 0L);
}
BOOL SetAutoURLDetect(BOOL bAutoDetect = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return !(BOOL)::SendMessage(m_hWnd, EM_AUTOURLDETECT, bAutoDetect, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return !(BOOL)::SendMessage(this->m_hWnd, EM_AUTOURLDETECT, bAutoDetect, 0L);
}
// this method is deprecated, please use SetAutoURLDetect
@@ -7700,266 +7413,281 @@ class CRichEditCtrlT : public TBase
UINT SetUndoLimit(UINT uUndoLimit)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, EM_SETUNDOLIMIT, uUndoLimit, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, EM_SETUNDOLIMIT, uUndoLimit, 0L);
}
void SetPalette(HPALETTE hPalette)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETPALETTE, (WPARAM)hPalette, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETPALETTE, (WPARAM)hPalette, 0L);
}
int GetTextEx(GETTEXTEX* pGetTextEx, LPTSTR lpstrText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_GETTEXTEX, (WPARAM)pGetTextEx, (LPARAM)lpstrText);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_GETTEXTEX, (WPARAM)pGetTextEx, (LPARAM)lpstrText);
}
int GetTextEx(LPTSTR lpstrText, int nTextLen, DWORD dwFlags = GT_DEFAULT, UINT uCodePage = CP_ACP, LPCSTR lpDefaultChar = NULL, LPBOOL lpUsedDefChar = NULL) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
GETTEXTEX gte = { 0 };
gte.cb = nTextLen * sizeof(TCHAR);
gte.codepage = uCodePage;
gte.flags = dwFlags;
gte.lpDefaultChar = lpDefaultChar;
gte.lpUsedDefChar = lpUsedDefChar;
- return (int)::SendMessage(m_hWnd, EM_GETTEXTEX, (WPARAM)>e, (LPARAM)lpstrText);
+ return (int)::SendMessage(this->m_hWnd, EM_GETTEXTEX, (WPARAM)>e, (LPARAM)lpstrText);
}
int GetTextLengthEx(GETTEXTLENGTHEX* pGetTextLengthEx) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_GETTEXTLENGTHEX, (WPARAM)pGetTextLengthEx, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_GETTEXTLENGTHEX, (WPARAM)pGetTextLengthEx, 0L);
}
int GetTextLengthEx(DWORD dwFlags = GTL_DEFAULT, UINT uCodePage = CP_ACP) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
GETTEXTLENGTHEX gtle = { 0 };
gtle.codepage = uCodePage;
gtle.flags = dwFlags;
- return (int)::SendMessage(m_hWnd, EM_GETTEXTLENGTHEX, (WPARAM)>le, 0L);
+ return (int)::SendMessage(this->m_hWnd, EM_GETTEXTLENGTHEX, (WPARAM)>le, 0L);
+ }
+
+ EDITWORDBREAKPROC GetWordBreakProc() const
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (EDITWORDBREAKPROC)::SendMessage(this->m_hWnd, EM_GETWORDBREAKPROC, 0, 0L);
+ }
+
+ void SetWordBreakProc(EDITWORDBREAKPROC ewbprc)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETWORDBREAKPROC, 0, (LPARAM)ewbprc);
}
-#endif // (_RICHEDIT_VER >= 0x0200)
-#if (_RICHEDIT_VER >= 0x0300)
int SetTextEx(SETTEXTEX* pSetTextEx, LPCTSTR lpstrText)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_SETTEXTEX, (WPARAM)pSetTextEx, (LPARAM)lpstrText);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_SETTEXTEX, (WPARAM)pSetTextEx, (LPARAM)lpstrText);
}
int SetTextEx(LPCTSTR lpstrText, DWORD dwFlags = ST_DEFAULT, UINT uCodePage = CP_ACP)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
SETTEXTEX ste = { 0 };
ste.flags = dwFlags;
ste.codepage = uCodePage;
- return (int)::SendMessage(m_hWnd, EM_SETTEXTEX, (WPARAM)&ste, (LPARAM)lpstrText);
+ return (int)::SendMessage(this->m_hWnd, EM_SETTEXTEX, (WPARAM)&ste, (LPARAM)lpstrText);
}
int GetEditStyle() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_GETEDITSTYLE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_GETEDITSTYLE, 0, 0L);
}
int SetEditStyle(int nStyle, int nMask = -1)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
if(nMask == -1)
nMask = nStyle; // set everything specified
- return (int)::SendMessage(m_hWnd, EM_SETEDITSTYLE, nStyle, nMask);
+ return (int)::SendMessage(this->m_hWnd, EM_SETEDITSTYLE, nStyle, nMask);
}
BOOL SetFontSize(int nFontSizeDelta)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT(nFontSizeDelta >= -1637 && nFontSizeDelta <= 1638);
- return (BOOL)::SendMessage(m_hWnd, EM_SETFONTSIZE, nFontSizeDelta, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((nFontSizeDelta >= -1637) && (nFontSizeDelta <= 1638));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETFONTSIZE, nFontSizeDelta, 0L);
}
void GetScrollPos(LPPOINT lpPoint) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(lpPoint != NULL);
- ::SendMessage(m_hWnd, EM_GETSCROLLPOS, 0, (LPARAM)lpPoint);
+ ::SendMessage(this->m_hWnd, EM_GETSCROLLPOS, 0, (LPARAM)lpPoint);
}
void SetScrollPos(LPPOINT lpPoint)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(lpPoint != NULL);
- ::SendMessage(m_hWnd, EM_SETSCROLLPOS, 0, (LPARAM)lpPoint);
+ ::SendMessage(this->m_hWnd, EM_SETSCROLLPOS, 0, (LPARAM)lpPoint);
}
BOOL GetZoom(int& nNum, int& nDen) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_GETZOOM, (WPARAM)&nNum, (LPARAM)&nDen);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_GETZOOM, (WPARAM)&nNum, (LPARAM)&nDen);
}
BOOL SetZoom(int nNum, int nDen)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT(nNum >= 0 && nNum <= 64);
- ATLASSERT(nDen >= 0 && nDen <= 64);
- return (BOOL)::SendMessage(m_hWnd, EM_SETZOOM, nNum, nDen);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((nNum >= 0) && (nNum <= 64));
+ ATLASSERT((nDen >= 0) && (nDen <= 64));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETZOOM, nNum, nDen);
}
BOOL SetZoomOff()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SETZOOM, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETZOOM, 0, 0L);
+ }
+
+ void SetMargins(UINT nLeft, UINT nRight, WORD wFlags = EC_LEFTMARGIN | EC_RIGHTMARGIN)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETMARGINS, wFlags, MAKELONG(nLeft, nRight));
}
-#endif // (_RICHEDIT_VER >= 0x0300)
// Operations
void LimitText(LONG nChars = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_EXLIMITTEXT, 0, nChars);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_EXLIMITTEXT, 0, nChars);
}
int LineFromChar(LONG nIndex) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_EXLINEFROMCHAR, 0, nIndex);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_EXLINEFROMCHAR, 0, nIndex);
}
POINT PosFromChar(LONG nChar) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
POINT point = { 0, 0 };
- ::SendMessage(m_hWnd, EM_POSFROMCHAR, (WPARAM)&point, nChar);
+ ::SendMessage(this->m_hWnd, EM_POSFROMCHAR, (WPARAM)&point, nChar);
return point;
}
int CharFromPos(POINT pt) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
POINTL ptl = { pt.x, pt.y };
- return (int)::SendMessage(m_hWnd, EM_CHARFROMPOS, 0, (LPARAM)&ptl);
+ return (int)::SendMessage(this->m_hWnd, EM_CHARFROMPOS, 0, (LPARAM)&ptl);
}
void EmptyUndoBuffer()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_EMPTYUNDOBUFFER, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_EMPTYUNDOBUFFER, 0, 0L);
}
int LineIndex(int nLine = -1) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_LINEINDEX, nLine, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_LINEINDEX, nLine, 0L);
}
int LineLength(int nLine = -1) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, EM_LINELENGTH, nLine, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, EM_LINELENGTH, nLine, 0L);
}
- BOOL LineScroll(int nLines, int nChars = 0)
+ BOOL LineScroll(int nLines)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_LINESCROLL, nChars, nLines);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_LINESCROLL, 0, nLines);
}
void ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_REPLACESEL, (WPARAM) bCanUndo, (LPARAM)lpszNewText);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_REPLACESEL, (WPARAM) bCanUndo, (LPARAM)lpszNewText);
}
void SetRect(LPCRECT lpRect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SETRECT, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETRECT, 0, (LPARAM)lpRect);
}
BOOL DisplayBand(LPRECT pDisplayRect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_DISPLAYBAND, 0, (LPARAM)pDisplayRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_DISPLAYBAND, 0, (LPARAM)pDisplayRect);
}
LONG FindText(DWORD dwFlags, FINDTEXT& ft) const
{
- ATLASSERT(::IsWindow(m_hWnd));
-#if (_RICHEDIT_VER >= 0x0200) && defined(_UNICODE)
- return (LONG)::SendMessage(m_hWnd, EM_FINDTEXTW, dwFlags, (LPARAM)&ft);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+#ifdef _UNICODE
+ return (LONG)::SendMessage(this->m_hWnd, EM_FINDTEXTW, dwFlags, (LPARAM)&ft);
#else
- return (LONG)::SendMessage(m_hWnd, EM_FINDTEXT, dwFlags, (LPARAM)&ft);
+ return (LONG)::SendMessage(this->m_hWnd, EM_FINDTEXT, dwFlags, (LPARAM)&ft);
#endif
}
LONG FindText(DWORD dwFlags, FINDTEXTEX& ft) const
{
- ATLASSERT(::IsWindow(m_hWnd));
-#if (_RICHEDIT_VER >= 0x0200) && defined(_UNICODE)
- return (LONG)::SendMessage(m_hWnd, EM_FINDTEXTEXW, dwFlags, (LPARAM)&ft);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+#ifdef _UNICODE
+ return (LONG)::SendMessage(this->m_hWnd, EM_FINDTEXTEXW, dwFlags, (LPARAM)&ft);
#else
- return (LONG)::SendMessage(m_hWnd, EM_FINDTEXTEX, dwFlags, (LPARAM)&ft);
+ return (LONG)::SendMessage(this->m_hWnd, EM_FINDTEXTEX, dwFlags, (LPARAM)&ft);
#endif
}
LONG FormatRange(FORMATRANGE& fr, BOOL bDisplay = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (LONG)::SendMessage(m_hWnd, EM_FORMATRANGE, bDisplay, (LPARAM)&fr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (LONG)::SendMessage(this->m_hWnd, EM_FORMATRANGE, bDisplay, (LPARAM)&fr);
}
LONG FormatRange(FORMATRANGE* pFormatRange, BOOL bDisplay = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (LONG)::SendMessage(m_hWnd, EM_FORMATRANGE, bDisplay, (LPARAM)pFormatRange);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (LONG)::SendMessage(this->m_hWnd, EM_FORMATRANGE, bDisplay, (LPARAM)pFormatRange);
}
void HideSelection(BOOL bHide = TRUE, BOOL bChangeStyle = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_HIDESELECTION, bHide, bChangeStyle);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_HIDESELECTION, bHide, bChangeStyle);
}
void PasteSpecial(UINT uClipFormat, DWORD dwAspect = 0, HMETAFILE hMF = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
REPASTESPECIAL reps = { dwAspect, (DWORD_PTR)hMF };
- ::SendMessage(m_hWnd, EM_PASTESPECIAL, uClipFormat, (LPARAM)&reps);
+ ::SendMessage(this->m_hWnd, EM_PASTESPECIAL, uClipFormat, (LPARAM)&reps);
}
void RequestResize()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_REQUESTRESIZE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_REQUESTRESIZE, 0, 0L);
}
LONG StreamIn(UINT uFormat, EDITSTREAM& es)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (LONG)::SendMessage(m_hWnd, EM_STREAMIN, uFormat, (LPARAM)&es);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (LONG)::SendMessage(this->m_hWnd, EM_STREAMIN, uFormat, (LPARAM)&es);
}
LONG StreamOut(UINT uFormat, EDITSTREAM& es)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (LONG)::SendMessage(m_hWnd, EM_STREAMOUT, uFormat, (LPARAM)&es);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (LONG)::SendMessage(this->m_hWnd, EM_STREAMOUT, uFormat, (LPARAM)&es);
}
DWORD FindWordBreak(int nCode, LONG nStartChar)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, EM_FINDWORDBREAK, nCode, nStartChar);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, EM_FINDWORDBREAK, nCode, nStartChar);
}
// Additional operations
void ScrollCaret()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SCROLLCARET, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SCROLLCARET, 0, 0L);
}
int InsertText(long nInsertAfterChar, LPCTSTR lpstrText, BOOL bCanUndo = FALSE)
@@ -7971,106 +7699,208 @@ class CRichEditCtrlT : public TBase
int AppendText(LPCTSTR lpstrText, BOOL bCanUndo = FALSE)
{
- return InsertText(GetWindowTextLength(), lpstrText, bCanUndo);
+ return InsertText(this->GetWindowTextLength(), lpstrText, bCanUndo);
}
// Clipboard operations
BOOL Undo()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_UNDO, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_UNDO, 0, 0L);
}
void Clear()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, WM_CLEAR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, WM_CLEAR, 0, 0L);
}
void Copy()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, WM_COPY, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, WM_COPY, 0, 0L);
}
void Cut()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, WM_CUT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, WM_CUT, 0, 0L);
}
void Paste()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, WM_PASTE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, WM_PASTE, 0, 0L);
}
// OLE support
IRichEditOle* GetOleInterface() const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
IRichEditOle *pRichEditOle = NULL;
- ::SendMessage(m_hWnd, EM_GETOLEINTERFACE, 0, (LPARAM)&pRichEditOle);
+ ::SendMessage(this->m_hWnd, EM_GETOLEINTERFACE, 0, (LPARAM)&pRichEditOle);
return pRichEditOle;
}
BOOL SetOleCallback(IRichEditOleCallback* pCallback)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SETOLECALLBACK, 0, (LPARAM)pCallback);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETOLECALLBACK, 0, (LPARAM)pCallback);
}
-#if (_RICHEDIT_VER >= 0x0200)
BOOL Redo()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_REDO, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_REDO, 0, 0L);
}
void StopGroupTyping()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_STOPGROUPTYPING, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_STOPGROUPTYPING, 0, 0L);
}
void ShowScrollBar(int nBarType, BOOL bVisible = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, EM_SHOWSCROLLBAR, nBarType, bVisible);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SHOWSCROLLBAR, nBarType, bVisible);
}
-#endif // (_RICHEDIT_VER >= 0x0200)
-#if (_RICHEDIT_VER >= 0x0300)
BOOL SetTabStops(int nTabStops, LPINT rgTabStops)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops);
}
BOOL SetTabStops()
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETTABSTOPS, 0, 0L);
}
BOOL SetTabStops(const int& cxEachStop) // takes an 'int'
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop);
+ }
+
+#if (_RICHEDIT_VER >= 0x0800)
+ AutoCorrectProc GetAutoCorrectProc() const
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (AutoCorrectProc)::SendMessage(this->m_hWnd, EM_GETAUTOCORRECTPROC, 0, 0L);
+ }
+
+ BOOL SetAutoCorrectProc(AutoCorrectProc pfn)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETAUTOCORRECTPROC, (WPARAM)pfn, 0L);
+ }
+
+ BOOL CallAutoCorrectProc(WCHAR ch)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_CALLAUTOCORRECTPROC, (WPARAM)ch, 0L);
+ }
+
+ DWORD GetEditStyleEx() const
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETEDITSTYLEEX, 0, 0L);
+ }
+
+ DWORD SetEditStyleEx(DWORD dwStyleEx, DWORD dwMask)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, EM_SETEDITSTYLEEX, dwStyleEx, dwMask);
+ }
+
+ DWORD GetStoryType(int nStoryIndex) const
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, EM_GETSTORYTYPE, nStoryIndex, 0L);
+ }
+
+ DWORD SetStoryType(int nStoryIndex, DWORD dwStoryType)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, EM_SETSTORYTYPE, nStoryIndex, dwStoryType);
}
-#endif // (_RICHEDIT_VER >= 0x0300)
+
+ DWORD GetEllipsisMode() const
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+
+ DWORD dwMode = 0;
+ BOOL bRet = (BOOL)::SendMessage(this->m_hWnd, EM_GETELLIPSISMODE, 0, (LPARAM)&dwMode);
+ bRet; // avoid level 4 warning
+ ATLASSERT(bRet != FALSE);
+
+ return dwMode;
+ }
+
+ BOOL SetEllipsisMode(DWORD dwEllipsisMode)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETELLIPSISMODE, 0, dwEllipsisMode);
+ }
+
+ BOOL GetEllipsisState() const
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_GETELLIPSISSTATE, 0, 0L);
+ }
+
+ BOOL GetTouchOptions(int nTouchOptions) const
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_GETTOUCHOPTIONS, nTouchOptions, 0L);
+ }
+
+ void SetTouchOptions(int nTouchOptions, BOOL bEnable)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, EM_SETTOUCHOPTIONS, nTouchOptions, bEnable);
+ }
+
+ HRESULT InsertTable(TABLEROWPARMS* pRowParams, TABLECELLPARMS* pCellParams)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HRESULT)::SendMessage(this->m_hWnd, EM_INSERTTABLE, (WPARAM)pRowParams, (LPARAM)pCellParams);
+ }
+
+ HRESULT GetTableParams(TABLEROWPARMS* pRowParams, TABLECELLPARMS* pCellParams) const
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HRESULT)::SendMessage(this->m_hWnd, EM_GETTABLEPARMS, (WPARAM)pRowParams, (LPARAM)pCellParams);
+ }
+
+ HRESULT SetTableParams(TABLEROWPARMS* pRowParams, TABLECELLPARMS* pCellParams)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HRESULT)::SendMessage(this->m_hWnd, EM_SETTABLEPARMS, (WPARAM)pRowParams, (LPARAM)pCellParams);
+ }
+
+ HRESULT InsertImage(RICHEDIT_IMAGE_PARAMETERS* pParams)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HRESULT)::SendMessage(this->m_hWnd, EM_INSERTIMAGE, 0, (LPARAM)pParams);
+ }
+
+ BOOL SetUiaName(LPCTSTR lpstrName)
+ {
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, EM_SETUIANAME, 0, (LPARAM)lpstrName);
+ }
+#endif // (_RICHEDIT_VER >= 0x0800)
};
typedef CRichEditCtrlT CRichEditCtrl;
-#endif // !_WIN32_WCE
-
///////////////////////////////////////////////////////////////////////////////
// CRichEditCommands - message handlers for standard EDIT commands
-#ifndef _WIN32_WCE
-
// Chain to CRichEditCommands message map. Your class must also derive from CRichEditCtrl.
// Example:
// class CMyRichEdit : public CWindowImpl,
@@ -8097,19 +7927,15 @@ class CRichEditCommands : public CEditCommands< T >
COMMAND_ID_HANDLER(ID_EDIT_PASTE, CEditCommands< T >::OnEditPaste)
COMMAND_ID_HANDLER(ID_EDIT_SELECT_ALL, CEditCommands< T >::OnEditSelectAll)
COMMAND_ID_HANDLER(ID_EDIT_UNDO, CEditCommands< T >::OnEditUndo)
-#if (_RICHEDIT_VER >= 0x0200)
COMMAND_ID_HANDLER(ID_EDIT_REDO, OnEditRedo)
-#endif // (_RICHEDIT_VER >= 0x0200)
END_MSG_MAP()
-#if (_RICHEDIT_VER >= 0x0200)
LRESULT OnEditRedo(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
T* pT = static_cast(this);
pT->Redo();
return 0;
}
-#endif // (_RICHEDIT_VER >= 0x0200)
// State (update UI) helpers
BOOL CanCut() const
@@ -8129,14 +7955,10 @@ class CRichEditCommands : public CEditCommands< T >
}
};
-#endif // _WIN32_WCE
-
///////////////////////////////////////////////////////////////////////////////
// CDragListBox
-#ifndef _WIN32_WCE
-
template
class CDragListBoxT : public CListBoxT< TBase >
{
@@ -8147,7 +7969,7 @@ class CDragListBoxT : public CListBoxT< TBase >
CDragListBoxT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -8164,21 +7986,21 @@ class CDragListBoxT : public CListBoxT< TBase >
// Operations
BOOL MakeDragList()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == 0);
- return ::MakeDragList(m_hWnd);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == 0);
+ return ::MakeDragList(this->m_hWnd);
}
int LBItemFromPt(POINT pt, BOOL bAutoScroll = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return ::LBItemFromPt(m_hWnd, pt, bAutoScroll);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return ::LBItemFromPt(this->m_hWnd, pt, bAutoScroll);
}
void DrawInsert(int nItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::DrawInsert(GetParent(), m_hWnd, nItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::DrawInsert(GetParent(), this->m_hWnd, nItem);
}
static UINT GetDragListMessage()
@@ -8265,8 +8087,6 @@ class CDragListNotifyImpl
}
};
-#endif // _WIN32_WCE
-
///////////////////////////////////////////////////////////////////////////////
// CReBarCtrl
@@ -8281,7 +8101,7 @@ class CReBarCtrlT : public TBase
CReBarCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -8300,202 +8120,192 @@ class CReBarCtrlT : public TBase
UINT GetBandCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, RB_GETBANDCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, RB_GETBANDCOUNT, 0, 0L);
}
BOOL GetBandInfo(int nBand, LPREBARBANDINFO lprbbi) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, RB_GETBANDINFO, nBand, (LPARAM)lprbbi);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_GETBANDINFO, nBand, (LPARAM)lprbbi);
}
BOOL SetBandInfo(int nBand, LPREBARBANDINFO lprbbi)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, RB_SETBANDINFO, nBand, (LPARAM)lprbbi);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_SETBANDINFO, nBand, (LPARAM)lprbbi);
}
BOOL GetBarInfo(LPREBARINFO lprbi) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, RB_GETBARINFO, 0, (LPARAM)lprbi);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_GETBARINFO, 0, (LPARAM)lprbi);
}
BOOL SetBarInfo(LPREBARINFO lprbi)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, RB_SETBARINFO, 0, (LPARAM)lprbi);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_SETBARINFO, 0, (LPARAM)lprbi);
}
CImageList GetImageList() const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
REBARINFO rbi = { 0 };
rbi.cbSize = sizeof(REBARINFO);
rbi.fMask = RBIM_IMAGELIST;
- BOOL bRet = (BOOL)::SendMessage(m_hWnd, RB_GETBARINFO, 0, (LPARAM)&rbi);
+ BOOL bRet = (BOOL)::SendMessage(this->m_hWnd, RB_GETBARINFO, 0, (LPARAM)&rbi);
return CImageList((bRet != FALSE) ? rbi.himl : NULL);
}
BOOL SetImageList(HIMAGELIST hImageList)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
REBARINFO rbi = { 0 };
rbi.cbSize = sizeof(REBARINFO);
rbi.fMask = RBIM_IMAGELIST;
rbi.himl = hImageList;
- return (BOOL)::SendMessage(m_hWnd, RB_SETBARINFO, 0, (LPARAM)&rbi);
+ return (BOOL)::SendMessage(this->m_hWnd, RB_SETBARINFO, 0, (LPARAM)&rbi);
}
UINT GetRowCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, RB_GETROWCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, RB_GETROWCOUNT, 0, 0L);
}
UINT GetRowHeight(int nBand) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, RB_GETROWHEIGHT, nBand, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, RB_GETROWHEIGHT, nBand, 0L);
}
-#if (_WIN32_IE >= 0x0400)
COLORREF GetTextColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, RB_GETTEXTCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, RB_GETTEXTCOLOR, 0, 0L);
}
COLORREF SetTextColor(COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, RB_SETTEXTCOLOR, 0, (LPARAM)clr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, RB_SETTEXTCOLOR, 0, (LPARAM)clr);
}
COLORREF GetBkColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, RB_GETBKCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, RB_GETBKCOLOR, 0, 0L);
}
COLORREF SetBkColor(COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, RB_SETBKCOLOR, 0, (LPARAM)clr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, RB_SETBKCOLOR, 0, (LPARAM)clr);
}
UINT GetBarHeight() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (UINT)::SendMessage(m_hWnd, RB_GETBARHEIGHT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (UINT)::SendMessage(this->m_hWnd, RB_GETBARHEIGHT, 0, 0L);
}
BOOL GetRect(int nBand, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, RB_GETRECT, nBand, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_GETRECT, nBand, (LPARAM)lpRect);
}
-#ifndef _WIN32_WCE
CToolTipCtrl GetToolTips() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CToolTipCtrl((HWND)::SendMessage(m_hWnd, RB_GETTOOLTIPS, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, RB_GETTOOLTIPS, 0, 0L));
}
void SetToolTips(HWND hwndToolTip)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, RB_SETTOOLTIPS, (WPARAM)hwndToolTip, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, RB_SETTOOLTIPS, (WPARAM)hwndToolTip, 0L);
}
-#endif // !_WIN32_WCE
void GetBandBorders(int nBand, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(lpRect != NULL);
- ::SendMessage(m_hWnd, RB_GETBANDBORDERS, nBand, (LPARAM)lpRect);
+ ::SendMessage(this->m_hWnd, RB_GETBANDBORDERS, nBand, (LPARAM)lpRect);
}
-#ifndef _WIN32_WCE
BOOL GetColorScheme(LPCOLORSCHEME lpColorScheme) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(lpColorScheme != NULL);
- return (BOOL)::SendMessage(m_hWnd, RB_GETCOLORSCHEME, 0, (LPARAM)lpColorScheme);
+ return (BOOL)::SendMessage(this->m_hWnd, RB_GETCOLORSCHEME, 0, (LPARAM)lpColorScheme);
}
void SetColorScheme(LPCOLORSCHEME lpColorScheme)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(lpColorScheme != NULL);
- ::SendMessage(m_hWnd, RB_SETCOLORSCHEME, 0, (LPARAM)lpColorScheme);
+ ::SendMessage(this->m_hWnd, RB_SETCOLORSCHEME, 0, (LPARAM)lpColorScheme);
}
HPALETTE GetPalette() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HPALETTE)::SendMessage(m_hWnd, RB_GETPALETTE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HPALETTE)::SendMessage(this->m_hWnd, RB_GETPALETTE, 0, 0L);
}
HPALETTE SetPalette(HPALETTE hPalette)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (HPALETTE)::SendMessage(m_hWnd, RB_SETPALETTE, 0, (LPARAM)hPalette);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (HPALETTE)::SendMessage(this->m_hWnd, RB_SETPALETTE, 0, (LPARAM)hPalette);
}
BOOL GetUnicodeFormat() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, RB_GETUNICODEFORMAT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_GETUNICODEFORMAT, 0, 0L);
}
BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, RB_SETUNICODEFORMAT, bUnicode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_SETUNICODEFORMAT, bUnicode, 0L);
}
-#endif // !_WIN32_WCE
-#endif // (_WIN32_IE >= 0x0400)
-#if (_WIN32_WINNT >= 0x0501)
// requires uxtheme.h to be included to use MARGINS struct
#ifndef _UXTHEME_H_
typedef struct _MARGINS* PMARGINS;
#endif // !_UXTHEME_H_
void GetBandMargins(PMARGINS pMargins) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, RB_GETBANDMARGINS, 0, (LPARAM)pMargins);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, RB_GETBANDMARGINS, 0, (LPARAM)pMargins);
}
void SetWindowTheme(LPCWSTR lpstrTheme)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, RB_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, RB_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);
}
-#endif // (_WIN32_WINNT >= 0x0501)
-#if (_WIN32_IE >= 0x0600)
DWORD GetExtendedStyle() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, RB_GETEXTENDEDSTYLE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, RB_GETEXTENDEDSTYLE, 0, 0L);
}
DWORD SetExtendedStyle(DWORD dwStyle, DWORD dwMask)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, RB_SETEXTENDEDSTYLE, dwMask, dwStyle);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, RB_SETEXTENDEDSTYLE, dwMask, dwStyle);
}
-#endif // (_WIN32_IE >= 0x0600)
// Operations
BOOL InsertBand(int nBand, LPREBARBANDINFO lprbbi)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, RB_INSERTBAND, nBand, (LPARAM)lprbbi);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_INSERTBAND, nBand, (LPARAM)lprbbi);
}
BOOL AddBand(LPREBARBANDINFO lprbbi)
@@ -8505,111 +8315,102 @@ class CReBarCtrlT : public TBase
BOOL DeleteBand(int nBand)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, RB_DELETEBAND, nBand, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_DELETEBAND, nBand, 0L);
}
ATL::CWindow SetNotifyWnd(HWND hWnd)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return ATL::CWindow((HWND)::SendMessage(m_hWnd, RB_SETPARENT, (WPARAM)hWnd, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return ATL::CWindow((HWND)::SendMessage(this->m_hWnd, RB_SETPARENT, (WPARAM)hWnd, 0L));
}
-#if (_WIN32_IE >= 0x0400)
void BeginDrag(int nBand, DWORD dwPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, RB_BEGINDRAG, nBand, dwPos);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, RB_BEGINDRAG, nBand, dwPos);
}
void BeginDrag(int nBand, int xPos, int yPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, RB_BEGINDRAG, nBand, MAKELPARAM(xPos, yPos));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, RB_BEGINDRAG, nBand, MAKELPARAM(xPos, yPos));
}
void EndDrag()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, RB_ENDDRAG, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, RB_ENDDRAG, 0, 0L);
}
void DragMove(DWORD dwPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, RB_DRAGMOVE, 0, dwPos);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, RB_DRAGMOVE, 0, dwPos);
}
void DragMove(int xPos, int yPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, RB_DRAGMOVE, 0, MAKELPARAM(xPos, yPos));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, RB_DRAGMOVE, 0, MAKELPARAM(xPos, yPos));
}
-#ifndef _WIN32_WCE
void GetDropTarget(IDropTarget** ppDropTarget) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, RB_GETDROPTARGET, 0, (LPARAM)ppDropTarget);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, RB_GETDROPTARGET, 0, (LPARAM)ppDropTarget);
}
-#endif // !_WIN32_WCE
void MaximizeBand(int nBand, BOOL bIdeal = FALSE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, RB_MAXIMIZEBAND, nBand, bIdeal);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, RB_MAXIMIZEBAND, nBand, bIdeal);
}
void MinimizeBand(int nBand)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, RB_MINIMIZEBAND, nBand, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, RB_MINIMIZEBAND, nBand, 0L);
}
BOOL SizeToRect(LPRECT lpRect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, RB_SIZETORECT, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_SIZETORECT, 0, (LPARAM)lpRect);
}
int IdToIndex(UINT uBandID) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, RB_IDTOINDEX, uBandID, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, RB_IDTOINDEX, uBandID, 0L);
}
int HitTest(LPRBHITTESTINFO lprbht) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, RB_HITTEST, 0, (LPARAM)lprbht);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, RB_HITTEST, 0, (LPARAM)lprbht);
}
BOOL ShowBand(int nBand, BOOL bShow)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, RB_SHOWBAND, nBand, bShow);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_SHOWBAND, nBand, bShow);
}
-#ifndef _WIN32_WCE
BOOL MoveBand(int nBand, int nNewPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT(nNewPos >= 0 && nNewPos <= ((int)GetBandCount() - 1));
- return (BOOL)::SendMessage(m_hWnd, RB_MOVEBAND, nBand, nNewPos);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((nNewPos >= 0) && (nNewPos <= ((int)GetBandCount() - 1)));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_MOVEBAND, nBand, nNewPos);
}
-#endif // !_WIN32_WCE
-#endif // (_WIN32_IE >= 0x0400)
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
void PushChevron(int nBand, LPARAM lAppValue)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, RB_PUSHCHEVRON, nBand, lAppValue);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, RB_PUSHCHEVRON, nBand, lAppValue);
}
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)
// Extra operations
-#if (_WIN32_IE >= 0x0400)
void LockBands(bool bLock)
{
int nBandCount = GetBandCount();
@@ -8637,13 +8438,12 @@ class CReBarCtrlT : public TBase
ATLASSERT(bRet);
}
}
-#endif // (_WIN32_IE >= 0x0400)
#if (_WIN32_WINNT >= 0x0600)
BOOL SetBandWidth(int nBand, int cxWidth)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, RB_SETBANDWIDTH, nBand, cxWidth);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, RB_SETBANDWIDTH, nBand, cxWidth);
}
#endif // (_WIN32_WINNT >= 0x0600)
};
@@ -8654,8 +8454,6 @@ typedef CReBarCtrlT CReBarCtrl;
///////////////////////////////////////////////////////////////////////////////
// CComboBoxEx
-#ifndef _WIN32_WCE
-
template
class CComboBoxExT : public CComboBoxT< TBase >
{
@@ -8666,7 +8464,7 @@ class CComboBoxExT : public CComboBoxT< TBase >
CComboBoxExT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -8685,61 +8483,57 @@ class CComboBoxExT : public CComboBoxT< TBase >
CImageList GetImageList() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, CBEM_GETIMAGELIST, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, CBEM_GETIMAGELIST, 0, 0L));
}
CImageList SetImageList(HIMAGELIST hImageList)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CImageList((HIMAGELIST)::SendMessage(m_hWnd, CBEM_SETIMAGELIST, 0, (LPARAM)hImageList));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, CBEM_SETIMAGELIST, 0, (LPARAM)hImageList));
}
-#if (_WIN32_IE >= 0x0400)
DWORD GetExtendedStyle() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, CBEM_GETEXTENDEDSTYLE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, CBEM_GETEXTENDEDSTYLE, 0, 0L);
}
DWORD SetExtendedStyle(DWORD dwExMask, DWORD dwExStyle)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, CBEM_SETEXTENDEDSTYLE, dwExMask, dwExStyle);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, CBEM_SETEXTENDEDSTYLE, dwExMask, dwExStyle);
}
BOOL GetUnicodeFormat() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, CBEM_GETUNICODEFORMAT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CBEM_GETUNICODEFORMAT, 0, 0L);
}
BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, CBEM_SETUNICODEFORMAT, bUnicode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CBEM_SETUNICODEFORMAT, bUnicode, 0L);
}
-#endif // (_WIN32_IE >= 0x0400)
-#if (_WIN32_WINNT >= 0x0501)
void SetWindowTheme(LPCWSTR lpstrTheme)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, CBEM_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, CBEM_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);
}
-#endif // (_WIN32_WINNT >= 0x0501)
// Operations
int InsertItem(const COMBOBOXEXITEM* lpcCBItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CBEM_INSERTITEM, 0, (LPARAM)lpcCBItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CBEM_INSERTITEM, 0, (LPARAM)lpcCBItem);
}
int InsertItem(UINT nMask, int nIndex, LPCTSTR lpszItem, int nImage, int nSelImage,
int iIndent, int iOverlay, LPARAM lParam)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
COMBOBOXEXITEM cbex = { 0 };
cbex.mask = nMask;
cbex.iItem = nIndex;
@@ -8749,12 +8543,12 @@ class CComboBoxExT : public CComboBoxT< TBase >
cbex.iIndent = iIndent;
cbex.iOverlay = iOverlay;
cbex.lParam = lParam;
- return (int)::SendMessage(m_hWnd, CBEM_INSERTITEM, 0, (LPARAM)&cbex);
+ return (int)::SendMessage(this->m_hWnd, CBEM_INSERTITEM, 0, (LPARAM)&cbex);
}
int InsertItem(int nIndex, LPCTSTR lpszItem, int nImage, int nSelImage, int iIndent, LPARAM lParam = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
COMBOBOXEXITEM cbex = { 0 };
cbex.mask = CBEIF_TEXT | CBEIF_IMAGE | CBEIF_SELECTEDIMAGE | CBEIF_INDENT | CBEIF_LPARAM;
cbex.iItem = nIndex;
@@ -8763,7 +8557,7 @@ class CComboBoxExT : public CComboBoxT< TBase >
cbex.iSelectedImage = nSelImage;
cbex.iIndent = iIndent;
cbex.lParam = lParam;
- return (int)::SendMessage(m_hWnd, CBEM_INSERTITEM, 0, (LPARAM)&cbex);
+ return (int)::SendMessage(this->m_hWnd, CBEM_INSERTITEM, 0, (LPARAM)&cbex);
}
int AddItem(UINT nMask, LPCTSTR lpszItem, int nImage, int nSelImage, int iIndent, int iOverlay, LPARAM lParam)
@@ -8778,26 +8572,26 @@ class CComboBoxExT : public CComboBoxT< TBase >
int DeleteItem(int nIndex)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, CBEM_DELETEITEM, nIndex, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, CBEM_DELETEITEM, nIndex, 0L);
}
BOOL GetItem(PCOMBOBOXEXITEM pCBItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, CBEM_GETITEM, 0, (LPARAM)pCBItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CBEM_GETITEM, 0, (LPARAM)pCBItem);
}
BOOL SetItem(const COMBOBOXEXITEM* lpcCBItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, CBEM_SETITEM, 0, (LPARAM)lpcCBItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CBEM_SETITEM, 0, (LPARAM)lpcCBItem);
}
int SetItem(int nIndex, UINT nMask, LPCTSTR lpszItem, int nImage, int nSelImage,
int iIndent, int iOverlay, LPARAM lParam)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
COMBOBOXEXITEM cbex = { 0 };
cbex.mask = nMask;
cbex.iItem = nIndex;
@@ -8807,12 +8601,12 @@ class CComboBoxExT : public CComboBoxT< TBase >
cbex.iIndent = iIndent;
cbex.iOverlay = iOverlay;
cbex.lParam = lParam;
- return (int)::SendMessage(m_hWnd, CBEM_SETITEM, 0, (LPARAM)&cbex);
+ return (int)::SendMessage(this->m_hWnd, CBEM_SETITEM, 0, (LPARAM)&cbex);
}
BOOL GetItemText(int nIndex, LPTSTR lpszItem, int nLen) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(lpszItem != NULL);
COMBOBOXEXITEM cbex = { 0 };
@@ -8821,14 +8615,13 @@ class CComboBoxExT : public CComboBoxT< TBase >
cbex.pszText = lpszItem;
cbex.cchTextMax = nLen;
- return (BOOL)::SendMessage(m_hWnd, CBEM_GETITEM, 0, (LPARAM)&cbex);
+ return (BOOL)::SendMessage(this->m_hWnd, CBEM_GETITEM, 0, (LPARAM)&cbex);
}
-#ifndef _ATL_NO_COM
BOOL GetItemText(int nIndex, BSTR& bstrText) const
{
USES_CONVERSION;
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(bstrText == NULL);
COMBOBOXEXITEM cbex = { 0 };
@@ -8845,8 +8638,8 @@ class CComboBoxExT : public CComboBoxT< TBase >
lpstrText[0] = NULL;
cbex.pszText = lpstrText;
cbex.cchTextMax = nLen;
- bRet = (BOOL)::SendMessage(m_hWnd, CBEM_GETITEM, 0, (LPARAM)&cbex);
- if(!bRet || (lstrlen(cbex.pszText) < nLen - 1))
+ bRet = (BOOL)::SendMessage(this->m_hWnd, CBEM_GETITEM, 0, (LPARAM)&cbex);
+ if(!bRet || (lstrlen(cbex.pszText) < (nLen - 1)))
break;
delete [] lpstrText;
lpstrText = NULL;
@@ -8861,12 +8654,11 @@ class CComboBoxExT : public CComboBoxT< TBase >
return (bstrText != NULL) ? TRUE : FALSE;
}
-#endif // !_ATL_NO_COM
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
- BOOL GetItemText(int nIndex, _CSTRING_NS::CString& strText) const
+#ifdef __ATLSTR_H__
+ BOOL GetItemText(int nIndex, ATL::CString& strText) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
COMBOBOXEXITEM cbex = { 0 };
cbex.mask = CBEIF_TEXT;
@@ -8883,37 +8675,37 @@ class CComboBoxExT : public CComboBoxT< TBase >
break;
}
cbex.cchTextMax = nLen;
- bRet = (BOOL)::SendMessage(m_hWnd, CBEM_GETITEM, 0, (LPARAM)&cbex);
- if(!bRet || (lstrlen(cbex.pszText) < nLen - 1))
+ bRet = (BOOL)::SendMessage(this->m_hWnd, CBEM_GETITEM, 0, (LPARAM)&cbex);
+ if(!bRet || (lstrlen(cbex.pszText) < (nLen - 1)))
break;
}
strText.ReleaseBuffer();
return bRet;
}
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
+#endif // __ATLSTR_H__
BOOL SetItemText(int nIndex, LPCTSTR lpszItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return SetItem(nIndex, CBEIF_TEXT, lpszItem, 0, 0, 0, 0, 0);
}
CComboBox GetComboCtrl() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CComboBox((HWND)::SendMessage(m_hWnd, CBEM_GETCOMBOCONTROL, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CComboBox((HWND)::SendMessage(this->m_hWnd, CBEM_GETCOMBOCONTROL, 0, 0L));
}
CEdit GetEditCtrl() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CEdit((HWND)::SendMessage(m_hWnd, CBEM_GETEDITCONTROL, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CEdit((HWND)::SendMessage(this->m_hWnd, CBEM_GETEDITCONTROL, 0, 0L));
}
BOOL HasEditChanged() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, CBEM_HASEDITCHANGED, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, CBEM_HASEDITCHANGED, 0, 0L);
}
// Non-functional
@@ -8944,8 +8736,6 @@ class CComboBoxExT : public CComboBoxT< TBase >
typedef CComboBoxExT CComboBoxEx;
-#endif // !_WIN32_WCE
-
///////////////////////////////////////////////////////////////////////////////
// CMonthCalendarCtrl
@@ -8960,7 +8750,7 @@ class CMonthCalendarCtrlT : public TBase
CMonthCalendarCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -8979,32 +8769,32 @@ class CMonthCalendarCtrlT : public TBase
COLORREF GetColor(int nColorType) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, MCM_GETCOLOR, nColorType, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, MCM_GETCOLOR, nColorType, 0L);
}
COLORREF SetColor(int nColorType, COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, MCM_SETCOLOR, nColorType, clr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, MCM_SETCOLOR, nColorType, clr);
}
BOOL GetCurSel(LPSYSTEMTIME lpSysTime) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_GETCURSEL, 0, (LPARAM)lpSysTime);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_GETCURSEL, 0, (LPARAM)lpSysTime);
}
BOOL SetCurSel(LPSYSTEMTIME lpSysTime)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_SETCURSEL, 0, (LPARAM)lpSysTime);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_SETCURSEL, 0, (LPARAM)lpSysTime);
}
int GetFirstDayOfWeek(BOOL* pbLocaleVal = NULL) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, MCM_GETFIRSTDAYOFWEEK, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, MCM_GETFIRSTDAYOFWEEK, 0, 0L);
if(pbLocaleVal != NULL)
*pbLocaleVal = (BOOL)HIWORD(dwRet);
return (int)(short)LOWORD(dwRet);
@@ -9012,8 +8802,8 @@ class CMonthCalendarCtrlT : public TBase
int SetFirstDayOfWeek(int nDay, BOOL* pbLocaleVal = NULL)
{
- ATLASSERT(::IsWindow(m_hWnd));
- DWORD dwRet = (DWORD)::SendMessage(m_hWnd, MCM_SETFIRSTDAYOFWEEK, 0, nDay);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ DWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, MCM_SETFIRSTDAYOFWEEK, 0, nDay);
if(pbLocaleVal != NULL)
*pbLocaleVal = (BOOL)HIWORD(dwRet);
return (int)(short)LOWORD(dwRet);
@@ -9021,164 +8811,162 @@ class CMonthCalendarCtrlT : public TBase
int GetMaxSelCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, MCM_GETMAXSELCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, MCM_GETMAXSELCOUNT, 0, 0L);
}
BOOL SetMaxSelCount(int nMax)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_SETMAXSELCOUNT, nMax, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_SETMAXSELCOUNT, nMax, 0L);
}
int GetMonthDelta() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, MCM_GETMONTHDELTA, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, MCM_GETMONTHDELTA, 0, 0L);
}
int SetMonthDelta(int nDelta)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, MCM_SETMONTHDELTA, nDelta, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, MCM_SETMONTHDELTA, nDelta, 0L);
}
DWORD GetRange(LPSYSTEMTIME lprgSysTimeArray) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, MCM_GETRANGE, 0, (LPARAM)lprgSysTimeArray);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, MCM_GETRANGE, 0, (LPARAM)lprgSysTimeArray);
}
BOOL SetRange(DWORD dwFlags, LPSYSTEMTIME lprgSysTimeArray)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_SETRANGE, dwFlags, (LPARAM)lprgSysTimeArray);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_SETRANGE, dwFlags, (LPARAM)lprgSysTimeArray);
}
BOOL GetSelRange(LPSYSTEMTIME lprgSysTimeArray) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_GETSELRANGE, 0, (LPARAM)lprgSysTimeArray);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_GETSELRANGE, 0, (LPARAM)lprgSysTimeArray);
}
BOOL SetSelRange(LPSYSTEMTIME lprgSysTimeArray)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_SETSELRANGE, 0, (LPARAM)lprgSysTimeArray);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_SETSELRANGE, 0, (LPARAM)lprgSysTimeArray);
}
BOOL GetToday(LPSYSTEMTIME lpSysTime) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_GETTODAY, 0, (LPARAM)lpSysTime);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_GETTODAY, 0, (LPARAM)lpSysTime);
}
void SetToday(LPSYSTEMTIME lpSysTime)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, MCM_SETTODAY, 0, (LPARAM)lpSysTime);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, MCM_SETTODAY, 0, (LPARAM)lpSysTime);
}
BOOL GetMinReqRect(LPRECT lpRectInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_GETMINREQRECT, 0, (LPARAM)lpRectInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_GETMINREQRECT, 0, (LPARAM)lpRectInfo);
}
int GetMaxTodayWidth() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, MCM_GETMAXTODAYWIDTH, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, MCM_GETMAXTODAYWIDTH, 0, 0L);
}
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
BOOL GetUnicodeFormat() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_GETUNICODEFORMAT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_GETUNICODEFORMAT, 0, 0L);
}
BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_SETUNICODEFORMAT, bUnicode, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_SETUNICODEFORMAT, bUnicode, 0L);
}
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)
DWORD GetCurrentView() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, MCM_GETCURRENTVIEW, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, MCM_GETCURRENTVIEW, 0, 0L);
}
BOOL SetCurrentView(DWORD dwView)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_SETCURRENTVIEW, 0, dwView);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_SETCURRENTVIEW, 0, dwView);
}
DWORD GetCalendarCount() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, MCM_GETCALENDARCOUNT, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, MCM_GETCALENDARCOUNT, 0, 0L);
}
BOOL GetCalendarGridInfo(PMCGRIDINFO pGridInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_GETCALENDARGRIDINFO, 0, (LPARAM)pGridInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_GETCALENDARGRIDINFO, 0, (LPARAM)pGridInfo);
}
CALID GetCALID() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (CALID)::SendMessage(m_hWnd, MCM_GETCALID, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (CALID)::SendMessage(this->m_hWnd, MCM_GETCALID, 0, 0L);
}
void SetCALID(CALID calid)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, MCM_SETCALID, (LPARAM)calid, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, MCM_SETCALID, (LPARAM)calid, 0L);
}
int GetCalendarBorder() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, MCM_GETCALENDARBORDER, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, MCM_GETCALENDARBORDER, 0, 0L);
}
void SetCalendarBorder(int cxyBorder, BOOL bSet = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, MCM_SETCALENDARBORDER, (WPARAM)bSet, (LPARAM)cxyBorder);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, MCM_SETCALENDARBORDER, (WPARAM)bSet, (LPARAM)cxyBorder);
}
#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)
// Operations
int GetMonthRange(DWORD dwFlags, LPSYSTEMTIME lprgSysTimeArray) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, MCM_GETMONTHRANGE, dwFlags, (LPARAM)lprgSysTimeArray);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, MCM_GETMONTHRANGE, dwFlags, (LPARAM)lprgSysTimeArray);
}
BOOL SetDayState(int nMonths, LPMONTHDAYSTATE lpDayStateArray)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, MCM_SETDAYSTATE, nMonths, (LPARAM)lpDayStateArray);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, MCM_SETDAYSTATE, nMonths, (LPARAM)lpDayStateArray);
}
DWORD HitTest(PMCHITTESTINFO pMCHitTest) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, MCM_HITTEST, 0, (LPARAM)pMCHitTest);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, MCM_HITTEST, 0, (LPARAM)pMCHitTest);
}
#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)
void SizeRectToMin(LPRECT lpRect)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, MCM_SIZERECTTOMIN, 0, (LPARAM)lpRect);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, MCM_SIZERECTTOMIN, 0, (LPARAM)lpRect);
}
#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)
};
@@ -9199,7 +8987,7 @@ class CDateTimePickerCtrlT : public TBase
CDateTimePickerCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -9218,95 +9006,93 @@ class CDateTimePickerCtrlT : public TBase
BOOL SetFormat(LPCTSTR lpszFormat)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, DTM_SETFORMAT, 0, (LPARAM)lpszFormat);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, DTM_SETFORMAT, 0, (LPARAM)lpszFormat);
}
COLORREF GetMonthCalColor(int nColorType) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, DTM_GETMCCOLOR, nColorType, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, DTM_GETMCCOLOR, nColorType, 0L);
}
COLORREF SetMonthCalColor(int nColorType, COLORREF clr)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, DTM_SETMCCOLOR, nColorType, clr);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, DTM_SETMCCOLOR, nColorType, clr);
}
DWORD GetRange(LPSYSTEMTIME lpSysTimeArray) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, DTM_GETRANGE, 0, (LPARAM)lpSysTimeArray);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, DTM_GETRANGE, 0, (LPARAM)lpSysTimeArray);
}
BOOL SetRange(DWORD dwFlags, LPSYSTEMTIME lpSysTimeArray)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, DTM_SETRANGE, dwFlags, (LPARAM)lpSysTimeArray);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, DTM_SETRANGE, dwFlags, (LPARAM)lpSysTimeArray);
}
DWORD GetSystemTime(LPSYSTEMTIME lpSysTime) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)lpSysTime);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)lpSysTime);
}
BOOL SetSystemTime(DWORD dwFlags, LPSYSTEMTIME lpSysTime)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, DTM_SETSYSTEMTIME, dwFlags, (LPARAM)lpSysTime);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, DTM_SETSYSTEMTIME, dwFlags, (LPARAM)lpSysTime);
}
CMonthCalendarCtrl GetMonthCal() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CMonthCalendarCtrl((HWND)::SendMessage(m_hWnd, DTM_GETMONTHCAL, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CMonthCalendarCtrl((HWND)::SendMessage(this->m_hWnd, DTM_GETMONTHCAL, 0, 0L));
}
-#if (_WIN32_IE >= 0x0400)
CFontHandle GetMonthCalFont() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return CFontHandle((HFONT)::SendMessage(m_hWnd, DTM_GETMCFONT, 0, 0L));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return CFontHandle((HFONT)::SendMessage(this->m_hWnd, DTM_GETMCFONT, 0, 0L));
}
void SetMonthCalFont(HFONT hFont, BOOL bRedraw = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, DTM_SETMCFONT, (WPARAM)hFont, MAKELPARAM(bRedraw, 0));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, DTM_SETMCFONT, (WPARAM)hFont, MAKELPARAM(bRedraw, 0));
}
-#endif // (_WIN32_IE >= 0x0400)
#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)
DWORD GetMonthCalStyle() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, DTM_GETMCSTYLE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, DTM_GETMCSTYLE, 0, 0L);
}
DWORD SetMonthCalStyle(DWORD dwStyle)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (DWORD)::SendMessage(m_hWnd, DTM_SETMCSTYLE, 0, (LPARAM)dwStyle);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (DWORD)::SendMessage(this->m_hWnd, DTM_SETMCSTYLE, 0, (LPARAM)dwStyle);
}
void GetDateTimePickerInfo(LPDATETIMEPICKERINFO lpPickerInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, DTM_GETDATETIMEPICKERINFO, 0, (LPARAM)lpPickerInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, DTM_GETDATETIMEPICKERINFO, 0, (LPARAM)lpPickerInfo);
}
BOOL GetIdealSize(LPSIZE lpSize) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, DTM_GETIDEALSIZE, 0, (LPARAM)lpSize);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, DTM_GETIDEALSIZE, 0, (LPARAM)lpSize);
}
void CloseMonthCal()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, DTM_CLOSEMONTHCAL, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, DTM_CLOSEMONTHCAL, 0, 0L);
}
#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)
};
@@ -9317,8 +9103,6 @@ typedef CDateTimePickerCtrlT CDateTimePickerCtrl;
///////////////////////////////////////////////////////////////////////////////
// CFlatScrollBarImpl - support for flat scroll bars
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
-
template
class CFlatScrollBarImpl
{
@@ -9421,21 +9205,17 @@ class CFlatScrollBarT : public TBase, public CFlatScrollBarImpl& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
};
typedef CFlatScrollBarT CFlatScrollBar;
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
-
///////////////////////////////////////////////////////////////////////////////
// CIPAddressCtrl
-#if (_WIN32_IE >= 0x0400)
-
template
class CIPAddressCtrlT : public TBase
{
@@ -9446,7 +9226,7 @@ class CIPAddressCtrlT : public TBase
CIPAddressCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -9465,57 +9245,53 @@ class CIPAddressCtrlT : public TBase
BOOL IsBlank() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, IPM_ISBLANK, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, IPM_ISBLANK, 0, 0L);
}
int GetAddress(LPDWORD lpdwAddress) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, IPM_GETADDRESS, 0, (LPARAM)lpdwAddress);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, IPM_GETADDRESS, 0, (LPARAM)lpdwAddress);
}
void SetAddress(DWORD dwAddress)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, IPM_SETADDRESS, 0, dwAddress);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, IPM_SETADDRESS, 0, dwAddress);
}
void ClearAddress()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, IPM_CLEARADDRESS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, IPM_CLEARADDRESS, 0, 0L);
}
void SetRange(int nField, WORD wRange)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, IPM_SETRANGE, nField, wRange);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, IPM_SETRANGE, nField, wRange);
}
void SetRange(int nField, BYTE nMin, BYTE nMax)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, IPM_SETRANGE, nField, MAKEIPRANGE(nMin, nMax));
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, IPM_SETRANGE, nField, MAKEIPRANGE(nMin, nMax));
}
void SetFocus(int nField)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, IPM_SETFOCUS, nField, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, IPM_SETFOCUS, nField, 0L);
}
};
typedef CIPAddressCtrlT CIPAddressCtrl;
-#endif // (_WIN32_IE >= 0x0400)
-
///////////////////////////////////////////////////////////////////////////////
// CPagerCtrl
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
-
template
class CPagerCtrlT : public TBase
{
@@ -9526,7 +9302,7 @@ class CPagerCtrlT : public TBase
CPagerCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -9545,96 +9321,92 @@ class CPagerCtrlT : public TBase
int GetButtonSize() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, PGM_GETBUTTONSIZE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, PGM_GETBUTTONSIZE, 0, 0L);
}
int SetButtonSize(int nButtonSize)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, PGM_SETBUTTONSIZE, 0, nButtonSize);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, PGM_SETBUTTONSIZE, 0, nButtonSize);
}
DWORD GetButtonState(int nButton) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT(nButton == PGB_TOPORLEFT || nButton == PGB_BOTTOMORRIGHT);
- return (DWORD)::SendMessage(m_hWnd, PGM_GETBUTTONSTATE, 0, nButton);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((nButton == PGB_TOPORLEFT) || (nButton == PGB_BOTTOMORRIGHT));
+ return (DWORD)::SendMessage(this->m_hWnd, PGM_GETBUTTONSTATE, 0, nButton);
}
COLORREF GetBkColor() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, PGM_GETBKCOLOR, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, PGM_GETBKCOLOR, 0, 0L);
}
COLORREF SetBkColor(COLORREF clrBk)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (COLORREF)::SendMessage(m_hWnd, PGM_SETBKCOLOR, 0, (LPARAM)clrBk);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (COLORREF)::SendMessage(this->m_hWnd, PGM_SETBKCOLOR, 0, (LPARAM)clrBk);
}
int GetBorder() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, PGM_GETBORDER, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, PGM_GETBORDER, 0, 0L);
}
int SetBorder(int nBorderSize)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, PGM_SETBORDER, 0, nBorderSize);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, PGM_SETBORDER, 0, nBorderSize);
}
int GetPos() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, PGM_GETPOS, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, PGM_GETPOS, 0, 0L);
}
int SetPos(int nPos)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, PGM_SETPOS, 0, nPos);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, PGM_SETPOS, 0, nPos);
}
// Operations
void SetChild(HWND hWndChild)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, PGM_SETCHILD, 0, (LPARAM)hWndChild);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, PGM_SETCHILD, 0, (LPARAM)hWndChild);
}
void ForwardMouse(BOOL bForward = TRUE)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, PGM_FORWARDMOUSE, bForward, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, PGM_FORWARDMOUSE, bForward, 0L);
}
void RecalcSize()
{
- ATLASSERT(::IsWindow(m_hWnd));
- ::SendMessage(m_hWnd, PGM_RECALCSIZE, 0, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ::SendMessage(this->m_hWnd, PGM_RECALCSIZE, 0, 0L);
}
void GetDropTarget(IDropTarget** ppDropTarget)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(ppDropTarget != NULL);
- ::SendMessage(m_hWnd, PGM_GETDROPTARGET, 0, (LPARAM)ppDropTarget);
+ ::SendMessage(this->m_hWnd, PGM_GETDROPTARGET, 0, (LPARAM)ppDropTarget);
}
};
typedef CPagerCtrlT CPagerCtrl;
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
-
///////////////////////////////////////////////////////////////////////////////
// CLinkCtrl - Windows SYSLINK control
-#if (_WIN32_WINNT >= 0x0501) && !defined(_WIN32_WCE)
-
template
class CLinkCtrlT : public TBase
{
@@ -9645,7 +9417,7 @@ class CLinkCtrlT : public TBase
CLinkCtrlT< TBase >& operator =(HWND hWnd)
{
- m_hWnd = hWnd;
+ this->m_hWnd = hWnd;
return *this;
}
@@ -9668,44 +9440,39 @@ class CLinkCtrlT : public TBase
int GetIdealHeight(int cxMaxWidth = 0) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LM_GETIDEALHEIGHT, cxMaxWidth, 0L);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LM_GETIDEALHEIGHT, cxMaxWidth, 0L);
}
BOOL GetItem(PLITEM pLItem) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LM_GETITEM, 0, (LPARAM)pLItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LM_GETITEM, 0, (LPARAM)pLItem);
}
BOOL SetItem(PLITEM pLItem)
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LM_SETITEM, 0, (LPARAM)pLItem);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LM_SETITEM, 0, (LPARAM)pLItem);
}
// Vista only
int GetIdealSize(SIZE& size, int cxMaxWidth = 0) const
{
-#ifndef LM_GETIDEALSIZE
- const UINT LM_GETIDEALSIZE = LM_GETIDEALHEIGHT;
-#endif
- ATLASSERT(::IsWindow(m_hWnd));
- return (int)::SendMessage(m_hWnd, LM_GETIDEALSIZE, cxMaxWidth, (LPARAM)&size);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (int)::SendMessage(this->m_hWnd, LM_GETIDEALSIZE, cxMaxWidth, (LPARAM)&size);
}
// Operations
BOOL HitTest(PLHITTESTINFO pLHitTestInfo) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- return (BOOL)::SendMessage(m_hWnd, LM_HITTEST, 0, (LPARAM)pLHitTestInfo);
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ return (BOOL)::SendMessage(this->m_hWnd, LM_HITTEST, 0, (LPARAM)pLHitTestInfo);
}
};
typedef CLinkCtrlT CLinkCtrl;
-#endif // (_WIN32_WINNT >= 0x0501) && !defined(_WIN32_WCE)
-
///////////////////////////////////////////////////////////////////////////////
// CCustomDraw - MI class for custom-draw support
@@ -9714,20 +9481,6 @@ template
class CCustomDraw
{
public:
-#if (_ATL_VER < 0x0700)
- BOOL m_bHandledCD;
-
- BOOL IsMsgHandled() const
- {
- return m_bHandledCD;
- }
-
- void SetMsgHandled(BOOL bHandled)
- {
- m_bHandledCD = bHandled;
- }
-#endif // !(_ATL_VER < 0x0700)
-
// Message map and handlers
BEGIN_MSG_MAP(CCustomDraw< T >)
NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, OnCustomDraw)
@@ -9768,11 +9521,9 @@ class CCustomDraw
case CDDS_ITEMPOSTERASE:
dwRet = pT->OnItemPostErase(idCtrl, lpNMCustomDraw);
break;
-#if (_WIN32_IE >= 0x0400)
case (CDDS_ITEMPREPAINT | CDDS_SUBITEM):
dwRet = pT->OnSubItemPrePaint(idCtrl, lpNMCustomDraw);
break;
-#endif // (_WIN32_IE >= 0x0400)
default:
pT->SetMsgHandled(FALSE);
break;
@@ -9822,212 +9573,12 @@ class CCustomDraw
return CDRF_DODEFAULT;
}
-#if (_WIN32_IE >= 0x0400)
DWORD OnSubItemPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)
{
return CDRF_DODEFAULT;
}
-#endif // (_WIN32_IE >= 0x0400)
-};
-
-
-// --- Windows CE common controls ---
-
-#ifdef _WIN32_WCE
-
-///////////////////////////////////////////////////////////////////////////////
-// CCECommandBarCtrl
-
-template
-class CCECommandBarCtrlT : public TBase
-{
-public:
-// Constructors
- CCECommandBarCtrlT(HWND hWnd = NULL) : TBase(hWnd) { }
-
- CCECommandBarCtrlT< TBase >& operator=(HWND hWnd)
- {
- m_hWnd = hWnd;
- return *this;
- }
-
-// Attributes
- BOOL IsVisible() const
- {
- return IsWindowVisible();
- }
-
- int GetHeight() const
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBar_Height(m_hWnd);
- }
-
- HMENU GetMenu(WORD wButton) const
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBar_GetMenu(m_hWnd, wButton);
- }
-
-// Operations
- HWND Create(HWND hWndParent, int nCmdBarID)
- {
- m_hWnd = ::CommandBar_Create(ModuleHelper::GetModuleInstance(), hWndParent, nCmdBarID);
- ATLASSERT(::IsWindow(m_hWnd));
- return m_hWnd;
- }
-
- void Destroy()
- {
- DestroyWindow();
- }
-
- BOOL Show(BOOL bShow = TRUE)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBar_Show(m_hWnd, bShow);
- }
-
- BOOL DrawMenuBar(WORD wButton)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBar_DrawMenuBar(m_hWnd, wButton);
- }
-
- BOOL AddAdornments(DWORD dwFlags = 0)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBar_AddAdornments(m_hWnd, dwFlags, 0);
- }
-
- int AddBitmap(int nBitmapID, int nNumImages)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBar_AddBitmap(m_hWnd, ModuleHelper::GetResourceInstance(), nBitmapID, nNumImages, 16, 16);
- }
-
- BOOL AddButtons(UINT uNumButtons, LPTBBUTTON lpButtons)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return CommandBar_AddButtons(m_hWnd, uNumButtons, lpButtons);
- }
-
- BOOL AddToolTips(UINT uNumToolTips, LPTSTR lpToolTips)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return CommandBar_AddToolTips(m_hWnd, uNumToolTips, lpToolTips);
- }
-
- BOOL InsertButton(int nButton, LPTBBUTTON lpButton)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return CommandBar_InsertButton(m_hWnd, nButton, lpButton);
- }
-
- HWND InsertComboBox(int nWidth, UINT dwStyle, WORD wComboBoxID, WORD wButton)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBar_InsertComboBox(m_hWnd, ModuleHelper::GetModuleInstance(), nWidth, dwStyle, wComboBoxID, wButton);
- }
-
- BOOL InsertMenubar(WORD wMenuID, WORD wButton)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBar_InsertMenubar(m_hWnd, ModuleHelper::GetResourceInstance(), wMenuID, wButton);
- }
-
- BOOL InsertMenubarEx(ATL::_U_STRINGorID menu, WORD wButton)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBar_InsertMenubarEx(m_hWnd, ModuleHelper::GetResourceInstance(), (LPTSTR)menu.m_lpstr, wButton);
- }
-
- BOOL IsCommandBarMessage(LPMSG lpMsg)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::IsCommandBarMessage(m_hWnd, lpMsg);
- }
};
-#if defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__) // PPC MenuBar
- typedef CCECommandBarCtrlT CMenuBarCtrl;
-#else
- typedef CCECommandBarCtrlT CCECommandBarCtrl;
-#endif // defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__)
-
-///////////////////////////////////////////////////////////////////////////////
-// CCECommandBandsCtrl
-
-template
-class CCECommandBandsCtrlT : public TBase
-{
-public:
-// Constructors
- CCECommandBandsCtrlT(HWND hWnd = NULL) : TBase(hWnd) { }
-
- CCECommandBandsCtrlT< TBase >& operator=(HWND hWnd)
- {
- m_hWnd = hWnd;
- return *this;
- }
-
-// Attributes
- BOOL IsVisible() const
- {
- return IsWindowVisible();
- }
-
-#if (_WIN32_IE >= 0x0400)
- UINT GetHeight() const
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return CommandBands_Height(m_hWnd);
- }
-#endif // (_WIN32_IE >= 0x0400)
-
- HWND GetCommandBar(UINT uBand) const
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBands_GetCommandBar(m_hWnd, uBand);
- }
-
- BOOL GetRestoreInformation(UINT uBand, LPCOMMANDBANDSRESTOREINFO pcbr) const
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBands_GetRestoreInformation(m_hWnd, uBand, pcbr);
- }
-
-// Operations
- HWND Create(HWND hWndParent, UINT wID, DWORD dwStyles, HIMAGELIST hImageList = NULL)
- {
- m_hWnd = ::CommandBands_Create(ModuleHelper::GetModuleInstance(), hWndParent, wID, dwStyles, hImageList);
- ATLASSERT(::IsWindow(m_hWnd));
- return m_hWnd;
- }
-
- BOOL AddAdornments(DWORD dwFlags = 0, LPREBARBANDINFO prbbi = NULL)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBands_AddAdornments(m_hWnd, ModuleHelper::GetModuleInstance(), dwFlags, prbbi);
- }
-
- BOOL AddBands(UINT uBandCount, LPREBARBANDINFO prbbi)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBands_AddBands(m_hWnd, ModuleHelper::GetModuleInstance(), uBandCount, prbbi);
- }
-
- BOOL Show(BOOL bShow = TRUE)
- {
- ATLASSERT(::IsWindow(m_hWnd));
- return ::CommandBands_Show(m_hWnd, bShow);
- }
-};
-
-typedef CCECommandBandsCtrlT CCECommandBandsCtrl;
-
-#endif // _WIN32_WCE
-
}; // namespace WTL
#endif // __ATLCTRLS_H__
diff --git a/thirdparty/wtl/atlctrlw.h b/thirdparty/wtl/atlctrlw.h
index 0add350..b9b282d 100644
--- a/thirdparty/wtl/atlctrlw.h
+++ b/thirdparty/wtl/atlctrlw.h
@@ -1,23 +1,16 @@
-// Windows Template Library - WTL version 8.1
-// Copyright (C) Microsoft Corporation. All rights reserved.
+// Windows Template Library - WTL version 10.0
+// Copyright (C) Microsoft Corporation, WTL Team. 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/cpl1.0.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.
+// Microsoft Public License (http://opensource.org/licenses/MS-PL)
+// which can be found in the file MS-PL.txt at the root folder.
#ifndef __ATLCTRLW_H__
#define __ATLCTRLW_H__
#pragma once
-#ifdef _WIN32_WCE
- #error atlctrlw.h is not supported on Windows CE
-#endif
-
#ifndef __ATLAPP_H__
#error atlctrlw.h requires atlapp.h to be included first
#endif
@@ -26,20 +19,12 @@
#error atlctrlw.h requires atlctrls.h to be included first
#endif
-#if (_WIN32_IE < 0x0400)
- #error atlctrlw.h requires _WIN32_IE >= 0x0400
-#endif
-
// Define _WTL_CMDBAR_VISTA_MENUS as 0 to exclude Vista menus support
-#if !defined(_WTL_CMDBAR_VISTA_MENUS) && (WINVER >= 0x0500) && (_WIN32_WINNT >= 0x0501) && (_WIN32_IE >= 0x0501)
+#ifndef _WTL_CMDBAR_VISTA_MENUS
#define _WTL_CMDBAR_VISTA_MENUS 1
#endif
-#if _WTL_CMDBAR_VISTA_MENUS
- #if !((_WIN32_WINNT >= 0x0501) && (_WIN32_IE >= 0x0501))
- #error _WTL_CMDBAR_VISTA_MENUS requires (_WIN32_WINNT >= 0x0501) && (_WIN32_IE >= 0x0501)
- #endif
-#endif
+// Note: Define _WTL_CMDBAR_VISTA_STD_MENUBAR to use Vista standard menubar look with Vista menus
///////////////////////////////////////////////////////////////////////////////
@@ -100,29 +85,29 @@ class CSimpleStack : public ATL::CSimpleArray< T >
#ifdef _CMDBAR_EXTRA_TRACE
ATLTRACE2(atlTraceUI, 0, _T("CmdBar - STACK-PUSH (%8.8X) size = %i\n"), t, GetSize());
#endif
- return Add(t);
+ return this->Add(t);
}
T Pop()
{
- int nLast = GetSize() - 1;
+ int nLast = this->GetSize() - 1;
if(nLast < 0)
return NULL; // must be able to convert to NULL
- T t = m_aT[nLast];
+ T t = this->m_aT[nLast];
#ifdef _CMDBAR_EXTRA_TRACE
ATLTRACE2(atlTraceUI, 0, _T("CmdBar - STACK-POP (%8.8X) size = %i\n"), t, GetSize());
#endif
- if(!RemoveAt(nLast))
+ if(!this->RemoveAt(nLast))
return NULL;
return t;
}
T GetCurrent()
{
- int nLast = GetSize() - 1;
+ int nLast = this->GetSize() - 1;
if(nLast < 0)
return NULL; // must be able to convert to NULL
- return m_aT[nLast];
+ return this->m_aT[nLast];
}
};
@@ -146,7 +131,6 @@ class CCommandBarCtrlBase : public CToolBarCtrl
static CMsgHookMap* s_pmapMsgHook;
static HHOOK s_hCreateHook;
- static bool s_bW2K; // For animation flag
static CCommandBarCtrlBase* s_pCurrentBar;
static bool s_bStaticInit;
@@ -174,8 +158,6 @@ class CCommandBarCtrlBase : public CToolBarCtrl
{
// Just in case...
AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES);
- // Animation on Win2000 only
- s_bW2K = !AtlIsOldWindows();
// done
s_bStaticInit = true;
}
@@ -190,7 +172,6 @@ class CCommandBarCtrlBase : public CToolBarCtrl
__declspec(selectany) CCommandBarCtrlBase::CMsgHookMap* CCommandBarCtrlBase::s_pmapMsgHook = NULL;
__declspec(selectany) HHOOK CCommandBarCtrlBase::s_hCreateHook = NULL;
__declspec(selectany) CCommandBarCtrlBase* CCommandBarCtrlBase::s_pCurrentBar = NULL;
-__declspec(selectany) bool CCommandBarCtrlBase::s_bW2K = false;
__declspec(selectany) bool CCommandBarCtrlBase::s_bStaticInit = false;
@@ -331,7 +312,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
if(m_wndParent.IsWindow())
/*scary!*/ m_wndParent.UnsubclassWindow();
- if(m_hMenu != NULL && (m_dwExtendedStyle & CBR_EX_SHAREMENU) == 0)
+ if((m_hMenu != NULL) && ((m_dwExtendedStyle & CBR_EX_SHAREMENU) == 0))
::DestroyMenu(m_hMenu);
if(m_hImageList != NULL)
@@ -356,7 +337,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
CMenuHandle GetMenu() const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
return m_hMenu;
}
@@ -409,7 +390,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
}
}
- if(cx == 0 || cy == 0)
+ if((cx == 0) || (cy == 0))
return false;
m_szBitmap.cx = cx;
@@ -457,12 +438,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
{
// These styles are required for command bars
dwStyle |= TBSTYLE_LIST | TBSTYLE_FLAT;
-#if (_MSC_VER >= 1300)
return ATL::CWindowImpl< T, TBase, TWinTraits >::Create(hWndParent, rcPos, szWindowName, dwStyle, dwExStyle, nID, lpCreateParam);
-#else // !(_MSC_VER >= 1300)
- typedef ATL::CWindowImpl< T, TBase, TWinTraits > _baseClass;
- return _baseClass::Create(hWndParent, rcPos, szWindowName, dwStyle, dwExStyle, nID, lpCreateParam);
-#endif // !(_MSC_VER >= 1300)
}
BOOL AttachToWindow(HWND hWnd)
@@ -497,9 +473,9 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
BOOL AttachMenu(HMENU hMenu)
{
- ATLASSERT(::IsWindow(m_hWnd));
- ATLASSERT(hMenu == NULL || ::IsMenu(hMenu));
- if(hMenu != NULL && !::IsMenu(hMenu))
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ ATLASSERT((hMenu == NULL) || ::IsMenu(hMenu));
+ if((hMenu != NULL) && !::IsMenu(hMenu))
return FALSE;
#if _WTL_CMDBAR_VISTA_MENUS
@@ -512,7 +488,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
#endif // _WTL_CMDBAR_VISTA_MENUS
// destroy old menu, if needed, and set new one
- if(m_hMenu != NULL && (m_dwExtendedStyle & CBR_EX_SHAREMENU) == 0)
+ if((m_hMenu != NULL) && ((m_dwExtendedStyle & CBR_EX_SHAREMENU) == 0))
::DestroyMenu(m_hMenu);
m_hMenu = hMenu;
@@ -521,12 +497,12 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
return TRUE;
// Build buttons according to menu
- SetRedraw(FALSE);
+ this->SetRedraw(FALSE);
// Clear all buttons
- int nCount = GetButtonCount();
+ int nCount = this->GetButtonCount();
for(int i = 0; i < nCount; i++)
- ATLVERIFY(DeleteButton(0) != FALSE);
+ ATLVERIFY(this->DeleteButton(0) != FALSE);
// Add buttons for each menu item
if(m_hMenu != NULL)
@@ -560,11 +536,11 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
btn.iBitmap = 0;
btn.idCommand = i;
btn.fsState = (BYTE)(((mii.fState & MFS_DISABLED) == 0) ? TBSTATE_ENABLED : 0);
- btn.fsStyle = TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE | TBSTYLE_DROPDOWN;
+ btn.fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE | BTNS_DROPDOWN;
btn.dwData = 0;
btn.iString = 0;
- bRet = InsertButton(-1, &btn);
+ bRet = this->InsertButton(-1, &btn);
ATLASSERT(bRet);
TBBUTTONINFO bi = { 0 };
@@ -572,14 +548,14 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
bi.dwMask = TBIF_TEXT;
bi.pszText = szString;
- bRet = SetButtonInfo(i, &bi);
+ bRet = this->SetButtonInfo(i, &bi);
ATLASSERT(bRet);
}
}
- SetRedraw(TRUE);
- Invalidate();
- UpdateWindow();
+ this->SetRedraw(TRUE);
+ this->Invalidate();
+ this->UpdateWindow();
return TRUE;
}
@@ -596,7 +572,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
BOOL _LoadImagesHelper(ATL::_U_STRINGorID image, bool bMapped, UINT nFlags = 0, LPCOLORMAP lpColorMap = NULL, int nMapSize = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
HINSTANCE hInstance = ModuleHelper::GetResourceInstance();
HRSRC hRsrc = ::FindResource(hInstance, image.m_lpstr, (LPTSTR)RT_TOOLBAR);
@@ -702,7 +678,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
CBitmapHandle bmp = hBitmap;
SIZE size = { 0, 0 };
bmp.GetSize(size);
- if(size.cx != m_szBitmap.cx || size.cy != m_szBitmap.cy)
+ if((size.cx != m_szBitmap.cx) || (size.cy != m_szBitmap.cy))
{
ATLASSERT(FALSE); // must match size!
return FALSE;
@@ -816,7 +792,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
{
bRet = (::ImageList_ReplaceIcon(m_hImageList, i, hIcon) != -1);
#if _WTL_CMDBAR_VISTA_MENUS
- if(RunTimeHelper::IsVista() && bRet != FALSE)
+ if(RunTimeHelper::IsVista() && (bRet != FALSE))
{
T* pT = static_cast(this);
pT->_ReplaceVistaBitmapFromImageList(i);
@@ -879,7 +855,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
BOOL TrackPopupMenu(HMENU hMenu, UINT uFlags, int x, int y, LPTPMPARAMS lpParams = NULL)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(::IsMenu(hMenu));
if(!::IsMenu(hMenu))
return FALSE;
@@ -909,6 +885,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
MESSAGE_HANDLER(GetGetBarMessage(), OnInternalGetBar)
MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)
MESSAGE_HANDLER(WM_MENUCHAR, OnMenuChar)
+ MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
MESSAGE_HANDLER(WM_KEYUP, OnKeyUp)
@@ -957,9 +934,9 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
LRESULT OnForwardMsg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
{
LPMSG pMsg = (LPMSG)lParam;
- if(pMsg->message >= WM_MOUSEFIRST && pMsg->message <= WM_MOUSELAST)
+ if((pMsg->message >= WM_MOUSEFIRST) && (pMsg->message <= WM_MOUSELAST))
m_bKeyboardInput = false;
- else if(pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST)
+ else if((pMsg->message >= WM_KEYFIRST) && (pMsg->message <= WM_KEYLAST))
m_bKeyboardInput = true;
LRESULT lRet = 0;
ProcessWindowMessage(pMsg->hwnd, pMsg->message, pMsg->wParam, pMsg->lParam, lRet, 3);
@@ -969,17 +946,17 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
// Let the toolbar initialize itself
- LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);
+ LRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);
// get and use system settings
T* pT = static_cast(this);
pT->GetSystemSettings();
// Parent init
- ATL::CWindow wndParent = GetParent();
+ ATL::CWindow wndParent = this->GetParent();
ATL::CWindow wndTopLevelParent = wndParent.GetTopLevelParent();
m_wndParent.SubclassWindow(wndTopLevelParent);
// Toolbar Init
- SetButtonStructSize();
- SetImageList(NULL);
+ this->SetButtonStructSize();
+ this->SetImageList(NULL);
// Create message hook if needed
CWindowCreateCriticalSectionLock lock;
@@ -990,27 +967,27 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
return -1;
}
- if(s_pmapMsgHook == NULL)
+ if(this->s_pmapMsgHook == NULL)
{
- ATLTRY(s_pmapMsgHook = new CMsgHookMap);
- ATLASSERT(s_pmapMsgHook != NULL);
+ ATLTRY(this->s_pmapMsgHook = new CCommandBarCtrlBase::CMsgHookMap);
+ ATLASSERT(this->s_pmapMsgHook != NULL);
}
- if(s_pmapMsgHook != NULL)
+ if(this->s_pmapMsgHook != NULL)
{
DWORD dwThreadID = ::GetCurrentThreadId();
- _MsgHookData* pData = s_pmapMsgHook->Lookup(dwThreadID);
+ CCommandBarCtrlBase::_MsgHookData* pData = this->s_pmapMsgHook->Lookup(dwThreadID);
if(pData == NULL)
{
- ATLTRY(pData = new _MsgHookData);
+ ATLTRY(pData = new CCommandBarCtrlBase::_MsgHookData);
ATLASSERT(pData != NULL);
HHOOK hMsgHook = ::SetWindowsHookEx(WH_GETMESSAGE, MessageHookProc, ModuleHelper::GetModuleInstance(), dwThreadID);
ATLASSERT(hMsgHook != NULL);
- if(pData != NULL && hMsgHook != NULL)
+ if((pData != NULL) && (hMsgHook != NULL))
{
pData->hMsgHook = hMsgHook;
pData->dwUsage = 1;
- BOOL bRet = s_pmapMsgHook->Add(dwThreadID, pData);
+ BOOL bRet = this->s_pmapMsgHook->Add(dwThreadID, pData);
bRet;
ATLASSERT(bRet);
}
@@ -1023,16 +1000,14 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
lock.Unlock();
// Get layout
-#if (WINVER >= 0x0500)
- m_bLayoutRTL = ((GetExStyle() & WS_EX_LAYOUTRTL) != 0);
-#endif // (WINVER >= 0x0500)
+ m_bLayoutRTL = ((this->GetExStyle() & WS_EX_LAYOUTRTL) != 0);
return lRet;
}
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
- LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);
+ LRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);
#if _WTL_CMDBAR_VISTA_MENUS
if(m_bVistaMenus && (m_hMenu != NULL))
@@ -1059,10 +1034,10 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
return lRet;
}
- if(s_pmapMsgHook != NULL)
+ if(this->s_pmapMsgHook != NULL)
{
DWORD dwThreadID = ::GetCurrentThreadId();
- _MsgHookData* pData = s_pmapMsgHook->Lookup(dwThreadID);
+ CCommandBarCtrlBase::_MsgHookData* pData = this->s_pmapMsgHook->Lookup(dwThreadID);
if(pData != NULL)
{
(pData->dwUsage)--;
@@ -1070,16 +1045,16 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
{
BOOL bRet = ::UnhookWindowsHookEx(pData->hMsgHook);
ATLASSERT(bRet);
- bRet = s_pmapMsgHook->Remove(dwThreadID);
+ bRet = this->s_pmapMsgHook->Remove(dwThreadID);
ATLASSERT(bRet);
if(bRet)
delete pData;
}
- if(s_pmapMsgHook->GetSize() == 0)
+ if(this->s_pmapMsgHook->GetSize() == 0)
{
- delete s_pmapMsgHook;
- s_pmapMsgHook = NULL;
+ delete this->s_pmapMsgHook;
+ this->s_pmapMsgHook = NULL;
}
}
}
@@ -1094,6 +1069,12 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
#ifdef _CMDBAR_EXTRA_TRACE
ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnKeyDown\n"));
#endif
+ if(m_bAttachedMenu) // nothing to do in this mode
+ {
+ bHandled = FALSE;
+ return 1;
+ }
+
bHandled = FALSE;
// Simulate Alt+Space for the parent
if(wParam == VK_SPACE)
@@ -1101,25 +1082,23 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
m_wndParent.PostMessage(WM_SYSKEYDOWN, wParam, lParam | (1 << 29));
bHandled = TRUE;
}
-#if (_WIN32_IE >= 0x0500)
- else if(wParam == VK_LEFT || wParam == VK_RIGHT)
+ else if((wParam == VK_LEFT) || (wParam == VK_RIGHT))
{
WPARAM wpNext = m_bLayoutRTL ? VK_LEFT : VK_RIGHT;
if(!m_bMenuActive)
{
T* pT = static_cast(this);
- int nBtn = GetHotItem();
+ int nBtn = this->GetHotItem();
int nNextBtn = (wParam == wpNext) ? pT->GetNextMenuItem(nBtn) : pT->GetPreviousMenuItem(nBtn);
if(nNextBtn == -2)
{
- SetHotItem(-1);
+ this->SetHotItem(-1);
if(pT->DisplayChevronMenu())
bHandled = TRUE;
}
}
}
-#endif // (_WIN32_IE >= 0x0500)
return 0;
}
@@ -1128,8 +1107,15 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
#ifdef _CMDBAR_EXTRA_TRACE
ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnKeyUp\n"));
#endif
+ if(m_bAttachedMenu) // nothing to do in this mode
+ {
+ bHandled = FALSE;
+ return 1;
+ }
+
if(wParam != VK_SPACE)
bHandled = FALSE;
+
return 0;
}
@@ -1138,46 +1124,46 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
#ifdef _CMDBAR_EXTRA_TRACE
ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnChar\n"));
#endif
+ if(m_bAttachedMenu) // nothing to do in this mode
+ {
+ bHandled = FALSE;
+ return 1;
+ }
+
if(wParam != VK_SPACE)
bHandled = FALSE;
else
return 0;
// Security
- if(!m_wndParent.IsWindowEnabled() || ::GetFocus() != m_hWnd)
+ if(!m_wndParent.IsWindowEnabled() || (::GetFocus() != this->m_hWnd))
return 0;
// Handle mnemonic press when we have focus
int nBtn = 0;
- if(wParam != VK_RETURN && !MapAccelerator((TCHAR)LOWORD(wParam), nBtn))
+ if((wParam != VK_RETURN) && !this->MapAccelerator((TCHAR)LOWORD(wParam), nBtn))
{
-#if (_WIN32_IE >= 0x0500)
if((TCHAR)LOWORD(wParam) != _chChevronShortcut)
-#endif // (_WIN32_IE >= 0x0500)
::MessageBeep(0);
}
else
{
-#if (_WIN32_IE >= 0x0500)
RECT rcClient = { 0 };
- GetClientRect(&rcClient);
+ this->GetClientRect(&rcClient);
RECT rcBtn = { 0 };
- GetItemRect(nBtn, &rcBtn);
+ this->GetItemRect(nBtn, &rcBtn);
TBBUTTON tbb = { 0 };
- GetButton(nBtn, &tbb);
- if((tbb.fsState & TBSTATE_ENABLED) != 0 && (tbb.fsState & TBSTATE_HIDDEN) == 0 && rcBtn.right <= rcClient.right)
+ this->GetButton(nBtn, &tbb);
+ if(((tbb.fsState & TBSTATE_ENABLED) != 0) && ((tbb.fsState & TBSTATE_HIDDEN) == 0) && (rcBtn.right <= rcClient.right))
{
-#endif // (_WIN32_IE >= 0x0500)
- PostMessage(WM_KEYDOWN, VK_DOWN, 0L);
+ this->PostMessage(WM_KEYDOWN, VK_DOWN, 0L);
if(wParam != VK_RETURN)
- SetHotItem(nBtn);
-#if (_WIN32_IE >= 0x0500)
+ this->SetHotItem(nBtn);
}
else
{
::MessageBeep(0);
bHandled = TRUE;
}
-#endif // (_WIN32_IE >= 0x0500)
}
return 0;
}
@@ -1219,7 +1205,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
CDCHandle dc = (HDC)wParam;
RECT rect = { 0 };
- GetClientRect(&rect);
+ this->GetClientRect(&rect);
dc.FillRect(&rect, COLOR_MENU);
return 1; // don't do the default erase
@@ -1227,8 +1213,8 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
LRESULT OnInitMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
- int nIndex = GetHotItem();
- SendMessage(WM_MENUSELECT, MAKEWPARAM(nIndex, MF_POPUP|MF_HILITE), (LPARAM)m_hMenu);
+ int nIndex = this->GetHotItem();
+ this->SendMessage(WM_MENUSELECT, MAKEWPARAM(nIndex, MF_POPUP|MF_HILITE), (LPARAM)m_hMenu);
bHandled = FALSE;
return 1;
}
@@ -1253,9 +1239,9 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
// forward to the parent or subclassed window, so it can handle update UI
LRESULT lRet = 0;
if(m_bAttachedMenu)
- lRet = DefWindowProc(uMsg, wParam, (lParam || m_bContextMenu) ? lParam : GetHotItem());
+ lRet = this->DefWindowProc(uMsg, wParam, (lParam || m_bContextMenu) ? lParam : this->GetHotItem());
else
- lRet = m_wndParent.DefWindowProc(uMsg, wParam, (lParam || m_bContextMenu) ? lParam : GetHotItem());
+ lRet = m_wndParent.DefWindowProc(uMsg, wParam, (lParam || m_bContextMenu) ? lParam : this->GetHotItem());
#if _WTL_CMDBAR_VISTA_MENUS
// If Vista menus are active, just set bitmaps and return
@@ -1323,7 +1309,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
ATLTRY(pMI->lpstrText = new TCHAR[cchLen]);
ATLASSERT(pMI->lpstrText != NULL);
if(pMI->lpstrText != NULL)
- SecureHelper::strcpy_x(pMI->lpstrText, cchLen, szString);
+ ATL::Checked::tcscpy_s(pMI->lpstrText, cchLen, szString);
mii.dwItemData = (ULONG_PTR)pMI;
bRet = menuPopup.SetMenuItemInfo(i, TRUE, &mii);
ATLASSERT(bRet);
@@ -1332,7 +1318,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
}
// Add it to the list
- m_stackMenuHandle.Push(menuPopup.m_hMenu);
+ this->m_stackMenuHandle.Push(menuPopup.m_hMenu);
}
return lRet;
@@ -1350,17 +1336,17 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
}
// Check if a menu is closing, do a cleanup
- if(HIWORD(wParam) == 0xFFFF && lParam == NULL) // Menu closing
+ if((HIWORD(wParam) == 0xFFFF) && (lParam == NULL)) // Menu closing
{
#ifdef _CMDBAR_EXTRA_TRACE
ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnMenuSelect - CLOSING!!!!\n"));
#endif
- ATLASSERT(m_stackMenuWnd.GetSize() == 0);
+ ATLASSERT(this->m_stackMenuWnd.GetSize() == 0);
// Restore the menu items to the previous state for all menus that were converted
if(m_bImagesVisible)
{
HMENU hMenu = NULL;
- while((hMenu = m_stackMenuHandle.Pop()) != NULL)
+ while((hMenu = this->m_stackMenuHandle.Pop()) != NULL)
{
CMenuHandle menuPopup = hMenu;
ATLASSERT(menuPopup.m_hMenu != NULL);
@@ -1374,7 +1360,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
ATLASSERT(bRet);
_MenuItemData* pMI = (_MenuItemData*)mii.dwItemData;
- if(pMI != NULL && pMI->IsCmdBarMenuItem())
+ if((pMI != NULL) && pMI->IsCmdBarMenuItem())
{
mii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_STATE;
mii.fType = pMI->fType;
@@ -1411,7 +1397,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
// Let's make sure we're not embedded in another process
if((LPVOID)wParam != NULL)
*((DWORD*)wParam) = GetCurrentProcessId();
- if(IsWindowVisible())
+ if(this->IsWindowVisible())
return (LRESULT)static_cast(this);
else
return NULL;
@@ -1419,14 +1405,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
LRESULT OnSettingChange(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
-#ifndef SPI_GETKEYBOARDCUES
- const UINT SPI_SETKEYBOARDCUES = 0x100B;
-#endif // !SPI_GETKEYBOARDCUES
-#ifndef SPI_GETFLATMENU
- const UINT SPI_SETFLATMENU = 0x1023;
-#endif // !SPI_GETFLATMENU
-
- if(wParam == SPI_SETNONCLIENTMETRICS || wParam == SPI_SETKEYBOARDCUES || wParam == SPI_SETFLATMENU)
+ if((wParam == SPI_SETNONCLIENTMETRICS) || (wParam == SPI_SETKEYBOARDCUES) || (wParam == SPI_SETFLATMENU))
{
T* pT = static_cast(this);
pT->GetSystemSettings();
@@ -1456,12 +1435,12 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
T* pT = static_cast(this);
LRESULT lRet;
- if(m_bMenuActive && LOWORD(wParam) != 0x0D)
+ if(m_bMenuActive && (LOWORD(wParam) != 0x0D))
lRet = 0;
else
lRet = MAKELRESULT(1, 1);
- if(m_bMenuActive && HIWORD(wParam) == MF_POPUP)
+ if(m_bMenuActive && (HIWORD(wParam) == MF_POPUP))
{
// Convert character to lower/uppercase and possibly Unicode, using current keyboard layout
TCHAR ch = (TCHAR)LOWORD(wParam);
@@ -1482,15 +1461,15 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
if(!bRet || (mii.fType & MFT_SEPARATOR))
continue;
_MenuItemData* pmd = (_MenuItemData*)mii.dwItemData;
- if(pmd != NULL && pmd->IsCmdBarMenuItem())
+ if((pmd != NULL) && pmd->IsCmdBarMenuItem())
{
LPTSTR p = pmd->lpstrText;
if(p != NULL)
{
- while(*p && *p != _T('&'))
+ while(*p && (*p != _T('&')))
p = ::CharNext(p);
- if(p != NULL && *p)
+ if((p != NULL) && *p)
{
DWORD dwP = MAKELONG(*(++p), 0);
DWORD dwC = MAKELONG(ch, 0);
@@ -1515,7 +1494,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
{
if(nRetCode == MNC_EXECUTE)
{
- PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);
+ this->PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);
pT->GiveFocusBack();
}
bHandled = TRUE;
@@ -1525,59 +1504,62 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
else if(!m_bMenuActive)
{
int nBtn = 0;
- if(!MapAccelerator((TCHAR)LOWORD(wParam), nBtn))
+ if(!this->MapAccelerator((TCHAR)LOWORD(wParam), nBtn))
{
bHandled = FALSE;
- PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);
+ this->PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);
pT->GiveFocusBack();
-#if (_WIN32_IE >= 0x0500)
// check if we should display chevron menu
if((TCHAR)LOWORD(wParam) == pT->_chChevronShortcut)
{
if(pT->DisplayChevronMenu())
bHandled = TRUE;
}
-#endif // (_WIN32_IE >= 0x0500)
}
else if(m_wndParent.IsWindowEnabled())
{
-#if (_WIN32_IE >= 0x0500)
RECT rcClient = { 0 };
- GetClientRect(&rcClient);
+ this->GetClientRect(&rcClient);
RECT rcBtn = { 0 };
- GetItemRect(nBtn, &rcBtn);
+ this->GetItemRect(nBtn, &rcBtn);
TBBUTTON tbb = { 0 };
- GetButton(nBtn, &tbb);
- if((tbb.fsState & TBSTATE_ENABLED) != 0 && (tbb.fsState & TBSTATE_HIDDEN) == 0 && rcBtn.right <= rcClient.right)
+ this->GetButton(nBtn, &tbb);
+ if(((tbb.fsState & TBSTATE_ENABLED) != 0) && ((tbb.fsState & TBSTATE_HIDDEN) == 0) && (rcBtn.right <= rcClient.right))
{
-#endif // (_WIN32_IE >= 0x0500)
if(m_bUseKeyboardCues && !m_bShowKeyboardCues)
{
m_bAllowKeyboardCues = true;
ShowKeyboardCues(true);
}
pT->TakeFocus();
- PostMessage(WM_KEYDOWN, VK_DOWN, 0L);
- SetHotItem(nBtn);
-#if (_WIN32_IE >= 0x0500)
+ this->PostMessage(WM_KEYDOWN, VK_DOWN, 0L);
+ this->SetHotItem(nBtn);
}
else
{
::MessageBeep(0);
}
-#endif // (_WIN32_IE >= 0x0500)
}
}
return lRet;
}
+ LRESULT OnKillFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
+ {
+ if(m_bUseKeyboardCues && m_bShowKeyboardCues)
+ ShowKeyboardCues(false);
+
+ bHandled = FALSE;
+ return 1;
+ }
+
LRESULT OnDrawItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
{
LPDRAWITEMSTRUCT lpDrawItemStruct = (LPDRAWITEMSTRUCT)lParam;
_MenuItemData* pmd = (_MenuItemData*)lpDrawItemStruct->itemData;
- if(lpDrawItemStruct->CtlType == ODT_MENU && pmd != NULL && pmd->IsCmdBarMenuItem())
+ if((lpDrawItemStruct->CtlType == ODT_MENU) && (pmd != NULL) && pmd->IsCmdBarMenuItem())
{
T* pT = static_cast(this);
pT->DrawItem(lpDrawItemStruct);
@@ -1593,7 +1575,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
{
LPMEASUREITEMSTRUCT lpMeasureItemStruct = (LPMEASUREITEMSTRUCT)lParam;
_MenuItemData* pmd = (_MenuItemData*)lpMeasureItemStruct->itemData;
- if(lpMeasureItemStruct->CtlType == ODT_MENU && pmd != NULL && pmd->IsCmdBarMenuItem())
+ if((lpMeasureItemStruct->CtlType == ODT_MENU) && (pmd != NULL) && pmd->IsCmdBarMenuItem())
{
T* pT = static_cast(this);
pT->MeasureItem(lpMeasureItemStruct);
@@ -1625,7 +1607,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
LRESULT OnAPIGetCmdBar(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
- return (LRESULT)m_hWnd;
+ return (LRESULT)this->m_hWnd;
}
// Parent window message handlers
@@ -1634,7 +1616,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
LPNMTBHOTITEM lpNMHT = (LPNMTBHOTITEM)pnmh;
// Check if this comes from us
- if(pnmh->hwndFrom != m_hWnd)
+ if(pnmh->hwndFrom != this->m_hWnd)
{
bHandled = FALSE;
return 0;
@@ -1649,45 +1631,36 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
}
if((!m_wndParent.IsWindowEnabled() || bBlockTracking) && (lpNMHT->dwFlags & HICF_MOUSE))
- {
return 1;
- }
- else
- {
-#ifndef HICF_LMOUSE
- const DWORD HICF_LMOUSE = 0x00000080; // left mouse button selected
-#endif
- bHandled = FALSE;
- // Send WM_MENUSELECT to the app if it needs to display a status text
- if(!(lpNMHT->dwFlags & HICF_MOUSE)
- && !(lpNMHT->dwFlags & HICF_ACCELERATOR)
- && !(lpNMHT->dwFlags & HICF_LMOUSE))
- {
- if(lpNMHT->dwFlags & HICF_ENTERING)
- m_wndParent.SendMessage(WM_MENUSELECT, 0, (LPARAM)m_hMenu);
- if(lpNMHT->dwFlags & HICF_LEAVING)
- m_wndParent.SendMessage(WM_MENUSELECT, MAKEWPARAM(0, 0xFFFF), NULL);
- }
+ bHandled = FALSE;
- return 0;
+ // Send WM_MENUSELECT to the app if it needs to display a status text
+ if(!(lpNMHT->dwFlags & HICF_MOUSE) && !(lpNMHT->dwFlags & HICF_ACCELERATOR) && !(lpNMHT->dwFlags & HICF_LMOUSE))
+ {
+ if(lpNMHT->dwFlags & HICF_ENTERING)
+ m_wndParent.SendMessage(WM_MENUSELECT, 0, (LPARAM)m_hMenu);
+ if(lpNMHT->dwFlags & HICF_LEAVING)
+ m_wndParent.SendMessage(WM_MENUSELECT, MAKEWPARAM(0, 0xFFFF), NULL);
}
+
+ return 0;
}
LRESULT OnParentDropDown(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)
{
// Check if this comes from us
- if(pnmh->hwndFrom != m_hWnd)
+ if(pnmh->hwndFrom != this->m_hWnd)
{
bHandled = FALSE;
return 1;
}
T* pT = static_cast(this);
- if(::GetFocus() != m_hWnd)
+ if(::GetFocus() != this->m_hWnd)
pT->TakeFocus();
LPNMTOOLBAR pNMToolBar = (LPNMTOOLBAR)pnmh;
- int nIndex = CommandToIndex(pNMToolBar->iItem);
+ int nIndex = this->CommandToIndex(pNMToolBar->iItem);
m_bContextMenu = false;
m_bEscapePressed = false;
pT->DoPopupMenu(nIndex, true);
@@ -1708,18 +1681,18 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
LRESULT OnParentSysCommand(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)
{
bHandled = FALSE;
- if((m_uSysKey == VK_MENU
- || (m_uSysKey == VK_F10 && !(::GetKeyState(VK_SHIFT) & 0x80))
- || m_uSysKey == VK_SPACE)
- && wParam == SC_KEYMENU)
+ if(((m_uSysKey == VK_MENU)
+ || ((m_uSysKey == VK_F10) && !(::GetKeyState(VK_SHIFT) & 0x80))
+ || (m_uSysKey == VK_SPACE))
+ && (wParam == SC_KEYMENU))
{
T* pT = static_cast(this);
- if(::GetFocus() == m_hWnd)
+ if(::GetFocus() == this->m_hWnd)
{
pT->GiveFocusBack(); // exit menu "loop"
- PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);
+ this->PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);
}
- else if(m_uSysKey != VK_SPACE && !m_bSkipMsg)
+ else if((m_uSysKey != VK_SPACE) && !m_bSkipMsg)
{
if(m_bUseKeyboardCues && !m_bShowKeyboardCues && m_bAllowKeyboardCues)
ShowKeyboardCues(true);
@@ -1782,8 +1755,8 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
}
else
{
- Invalidate();
- UpdateWindow();
+ this->Invalidate();
+ this->UpdateWindow();
}
bHandled = FALSE;
return 1;
@@ -1793,7 +1766,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
{
LRESULT lRet = CDRF_DODEFAULT;
bHandled = FALSE;
- if(pnmh->hwndFrom == m_hWnd)
+ if(pnmh->hwndFrom == this->m_hWnd)
{
LPNMTBCUSTOMDRAW lpTBCustomDraw = (LPNMTBCUSTOMDRAW)pnmh;
if(lpTBCustomDraw->nmcd.dwDrawStage == CDDS_PREPAINT)
@@ -1803,54 +1776,86 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
}
else if(lpTBCustomDraw->nmcd.dwDrawStage == CDDS_ITEMPREPAINT)
{
- if(m_bFlatMenus)
+#if _WTL_CMDBAR_VISTA_MENUS && defined(_WTL_CMDBAR_VISTA_STD_MENUBAR)
+ if(m_bVistaMenus)
+ {
+ ::SetRectEmpty(&lpTBCustomDraw->rcText);
+ lRet = CDRF_NOTIFYPOSTPAINT;
+ bHandled = TRUE;
+ }
+ else
+#endif // _WTL_CMDBAR_VISTA_MENUS && defined(_WTL_CMDBAR_VISTA_STD_MENUBAR)
{
-#ifndef COLOR_MENUHILIGHT
- const int COLOR_MENUHILIGHT = 29;
-#endif // !COLOR_MENUHILIGHT
- bool bDisabled = ((lpTBCustomDraw->nmcd.uItemState & CDIS_DISABLED) == CDIS_DISABLED);
- if(!bDisabled && ((lpTBCustomDraw->nmcd.uItemState & CDIS_HOT) == CDIS_HOT ||
- (lpTBCustomDraw->nmcd.uItemState & CDIS_SELECTED) == CDIS_SELECTED))
+ if(m_bFlatMenus)
{
- ::FillRect(lpTBCustomDraw->nmcd.hdc, &lpTBCustomDraw->nmcd.rc, ::GetSysColorBrush(COLOR_MENUHILIGHT));
- ::FrameRect(lpTBCustomDraw->nmcd.hdc, &lpTBCustomDraw->nmcd.rc, ::GetSysColorBrush(COLOR_HIGHLIGHT));
- lpTBCustomDraw->clrText = ::GetSysColor(m_bParentActive ? COLOR_HIGHLIGHTTEXT : COLOR_GRAYTEXT);
+ bool bDisabled = ((lpTBCustomDraw->nmcd.uItemState & CDIS_DISABLED) == CDIS_DISABLED);
+ if(!bDisabled && (((lpTBCustomDraw->nmcd.uItemState & CDIS_HOT) == CDIS_HOT) ||
+ (lpTBCustomDraw->nmcd.uItemState & CDIS_SELECTED) == CDIS_SELECTED))
+ {
+ ::FillRect(lpTBCustomDraw->nmcd.hdc, &lpTBCustomDraw->nmcd.rc, ::GetSysColorBrush(COLOR_MENUHILIGHT));
+ ::FrameRect(lpTBCustomDraw->nmcd.hdc, &lpTBCustomDraw->nmcd.rc, ::GetSysColorBrush(COLOR_HIGHLIGHT));
+ lpTBCustomDraw->clrText = ::GetSysColor(m_bParentActive ? COLOR_HIGHLIGHTTEXT : COLOR_GRAYTEXT);
+ }
+ else if(bDisabled || !m_bParentActive)
+ {
+ lpTBCustomDraw->clrText = ::GetSysColor(COLOR_GRAYTEXT);
+ }
+
+ _ParentCustomDrawHelper(lpTBCustomDraw);
+
+ lRet = CDRF_SKIPDEFAULT;
+ bHandled = TRUE;
}
- else if(bDisabled || !m_bParentActive)
+ else if(!m_bParentActive)
{
lpTBCustomDraw->clrText = ::GetSysColor(COLOR_GRAYTEXT);
+ bHandled = TRUE;
}
- CDCHandle dc = lpTBCustomDraw->nmcd.hdc;
- dc.SetTextColor(lpTBCustomDraw->clrText);
- dc.SetBkMode(lpTBCustomDraw->nStringBkMode);
- HFONT hFont = GetFont();
- HFONT hFontOld = NULL;
- if(hFont != NULL)
- hFontOld = dc.SelectFont(hFont);
- const int cchText = 200;
- TCHAR szText[cchText] = { 0 };
- TBBUTTONINFO tbbi = { 0 };
- tbbi.cbSize = sizeof(TBBUTTONINFO);
- tbbi.dwMask = TBIF_TEXT;
- tbbi.pszText = szText;
- tbbi.cchText = cchText;
- GetButtonInfo((int)lpTBCustomDraw->nmcd.dwItemSpec, &tbbi);
- dc.DrawText(szText, -1, &lpTBCustomDraw->nmcd.rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER | (m_bShowKeyboardCues ? 0 : DT_HIDEPREFIX));
- if(hFont != NULL)
- dc.SelectFont(hFontOld);
- lRet = CDRF_SKIPDEFAULT;
- bHandled = TRUE;
}
- else if(!m_bParentActive)
- {
+ }
+#if _WTL_CMDBAR_VISTA_MENUS && defined(_WTL_CMDBAR_VISTA_STD_MENUBAR)
+ else if (lpTBCustomDraw->nmcd.dwDrawStage == CDDS_ITEMPOSTPAINT)
+ {
+ bool bDisabled = ((lpTBCustomDraw->nmcd.uItemState & CDIS_DISABLED) == CDIS_DISABLED);
+ if(bDisabled || !m_bParentActive)
lpTBCustomDraw->clrText = ::GetSysColor(COLOR_GRAYTEXT);
- bHandled = TRUE;
- }
+
+ _ParentCustomDrawHelper(lpTBCustomDraw);
+
+ lRet = CDRF_SKIPDEFAULT;
+ bHandled = TRUE;
}
+#endif // _WTL_CMDBAR_VISTA_MENUS && defined(_WTL_CMDBAR_VISTA_STD_MENUBAR)
}
return lRet;
}
+ void _ParentCustomDrawHelper(LPNMTBCUSTOMDRAW lpTBCustomDraw)
+ {
+ CDCHandle dc = lpTBCustomDraw->nmcd.hdc;
+ dc.SetTextColor(lpTBCustomDraw->clrText);
+ dc.SetBkMode(lpTBCustomDraw->nStringBkMode);
+
+ HFONT hFont = this->GetFont();
+ HFONT hFontOld = NULL;
+ if(hFont != NULL)
+ hFontOld = dc.SelectFont(hFont);
+
+ const int cchText = 200;
+ TCHAR szText[cchText] = { 0 };
+ TBBUTTONINFO tbbi = { 0 };
+ tbbi.cbSize = sizeof(TBBUTTONINFO);
+ tbbi.dwMask = TBIF_TEXT;
+ tbbi.pszText = szText;
+ tbbi.cchText = cchText;
+ this->GetButtonInfo((int)lpTBCustomDraw->nmcd.dwItemSpec, &tbbi);
+
+ dc.DrawText(szText, -1, &lpTBCustomDraw->nmcd.rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER | (m_bShowKeyboardCues ? 0 : DT_HIDEPREFIX));
+
+ if(hFont != NULL)
+ dc.SelectFont(hFontOld);
+ }
+
// Message hook handlers
LRESULT OnHookMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
@@ -1861,19 +1866,19 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
bHandled = FALSE;
if(m_bMenuActive)
{
- if(::WindowFromPoint(point) == m_hWnd)
+ if(::WindowFromPoint(point) == this->m_hWnd)
{
- ScreenToClient(&point);
- int nHit = HitTest(&point);
+ this->ScreenToClient(&point);
+ int nHit = this->HitTest(&point);
- if((point.x != s_point.x || point.y != s_point.y) && nHit >= 0 && nHit < ::GetMenuItemCount(m_hMenu) && nHit != m_nPopBtn && m_nPopBtn != -1)
+ if(((point.x != s_point.x) || (point.y != s_point.y)) && (nHit >= 0) && (nHit < ::GetMenuItemCount(m_hMenu)) && (nHit != m_nPopBtn) && (m_nPopBtn != -1))
{
TBBUTTON tbb = { 0 };
- GetButton(nHit, &tbb);
+ this->GetButton(nHit, &tbb);
if((tbb.fsState & TBSTATE_ENABLED) != 0)
{
m_nNextPopBtn = nHit | 0xFFFF0000;
- HWND hWndMenu = m_stackMenuWnd.GetCurrent();
+ HWND hWndMenu = this->m_stackMenuWnd.GetCurrent();
ATLASSERT(hWndMenu != NULL);
// this one is needed to close a menu if mouse button was down
@@ -1888,7 +1893,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
}
else
{
- ScreenToClient(&point);
+ this->ScreenToClient(&point);
}
s_point = point;
@@ -1902,20 +1907,20 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
ATLTRACE2(atlTraceUI, 0, _T("CmdBar - Hook WM_SYSKEYDOWN (0x%2.2X)\n"), wParam);
#endif
- if(wParam == VK_MENU && m_bParentActive && m_bUseKeyboardCues && !m_bShowKeyboardCues && m_bAllowKeyboardCues)
+ if((wParam == VK_MENU) && m_bParentActive && m_bUseKeyboardCues && !m_bShowKeyboardCues && m_bAllowKeyboardCues)
ShowKeyboardCues(true);
- if(wParam != VK_SPACE && !m_bMenuActive && ::GetFocus() == m_hWnd)
+ if((wParam != VK_SPACE) && !m_bMenuActive && (::GetFocus() == this->m_hWnd))
{
m_bAllowKeyboardCues = false;
- PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);
+ this->PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);
T* pT = static_cast(this);
pT->GiveFocusBack();
m_bSkipMsg = true;
}
else
{
- if(wParam == VK_SPACE && m_bUseKeyboardCues && m_bShowKeyboardCues)
+ if((wParam == VK_SPACE) && m_bUseKeyboardCues && m_bShowKeyboardCues)
{
m_bAllowKeyboardCues = true;
ShowKeyboardCues(false);
@@ -1944,7 +1949,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
ATLTRACE2(atlTraceUI, 0, _T("CmdBar - Hook WM_SYSCHAR (0x%2.2X)\n"), wParam);
#endif
- if(!m_bMenuActive && m_hWndHook != m_hWnd && wParam != VK_SPACE)
+ if(!m_bMenuActive && (this->m_hWndHook != this->m_hWnd) && (wParam != VK_SPACE))
bHandled = TRUE;
return 0;
}
@@ -1957,51 +1962,40 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
bHandled = FALSE;
T* pT = static_cast(this);
- if(wParam == VK_ESCAPE && m_stackMenuWnd.GetSize() <= 1)
+ if((wParam == VK_ESCAPE) && (this->m_stackMenuWnd.GetSize() <= 1))
{
if(m_bMenuActive && !m_bContextMenu)
{
- int nHot = GetHotItem();
+ int nHot = this->GetHotItem();
if(nHot == -1)
nHot = m_nPopBtn;
if(nHot == -1)
nHot = 0;
- SetHotItem(nHot);
+ this->SetHotItem(nHot);
bHandled = TRUE;
pT->TakeFocus();
m_bEscapePressed = true; // To keep focus
m_bSkipPostDown = false;
}
- else if(::GetFocus() == m_hWnd && m_wndParent.IsWindow())
+ else if((::GetFocus() == this->m_hWnd) && m_wndParent.IsWindow())
{
- SetHotItem(-1);
+ this->SetHotItem(-1);
pT->GiveFocusBack();
bHandled = TRUE;
}
}
- else if(wParam == VK_RETURN || wParam == VK_UP || wParam == VK_DOWN)
+ else if((wParam == VK_RETURN) || (wParam == VK_UP) || (wParam == VK_DOWN))
{
- if(!m_bMenuActive && ::GetFocus() == m_hWnd && m_wndParent.IsWindow())
+ if(!m_bMenuActive && (::GetFocus() == this->m_hWnd) && m_wndParent.IsWindow())
{
- int nHot = GetHotItem();
+ int nHot = this->GetHotItem();
if(nHot != -1)
{
if(wParam != VK_RETURN)
{
if(!m_bSkipPostDown)
{
-// IE4 only: WM_KEYDOWN doesn't generate TBN_DROPDOWN, we need to simulate a mouse click
-#if (_WIN32_IE < 0x0500)
- DWORD dwMajor = 0, dwMinor = 0;
- ATL::AtlGetCommCtrlVersion(&dwMajor, &dwMinor);
- if(dwMajor <= 4 || (dwMajor == 5 && dwMinor < 80))
- {
- RECT rect;
- GetItemRect(nHot, &rect);
- PostMessage(WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(rect.left, rect.top));
- }
-#endif // (_WIN32_IE < 0x0500)
- PostMessage(WM_KEYDOWN, VK_DOWN, 0L);
+ this->PostMessage(WM_KEYDOWN, VK_DOWN, 0L);
m_bSkipPostDown = true;
}
else
@@ -2016,22 +2010,22 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
ATLTRACE2(atlTraceUI, 0, _T("CmdBar - Can't find hot button\n"));
}
}
- if(wParam == VK_RETURN && m_bMenuActive)
+ if((wParam == VK_RETURN) && m_bMenuActive)
{
- PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);
+ this->PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);
m_nNextPopBtn = -1;
pT->GiveFocusBack();
}
}
- else if(wParam == VK_LEFT || wParam == VK_RIGHT)
+ else if((wParam == VK_LEFT) || (wParam == VK_RIGHT))
{
WPARAM wpNext = m_bLayoutRTL ? VK_LEFT : VK_RIGHT;
WPARAM wpPrev = m_bLayoutRTL ? VK_RIGHT : VK_LEFT;
- if(m_bMenuActive && !m_bContextMenu && !(wParam == wpNext && m_bPopupItem))
+ if(m_bMenuActive && !m_bContextMenu && !((wParam == wpNext) && m_bPopupItem))
{
bool bAction = false;
- if(wParam == wpPrev && s_pCurrentBar->m_stackMenuWnd.GetSize() == 1)
+ if((wParam == wpPrev) && (this->s_pCurrentBar->m_stackMenuWnd.GetSize() == 1))
{
m_nNextPopBtn = pT->GetPreviousMenuItem(m_nPopBtn);
if(m_nNextPopBtn != -1)
@@ -2043,7 +2037,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
if(m_nNextPopBtn != -1)
bAction = true;
}
- HWND hWndMenu = m_stackMenuWnd.GetCurrent();
+ HWND hWndMenu = this->m_stackMenuWnd.GetCurrent();
ATLASSERT(hWndMenu != NULL);
// Close the popup menu
@@ -2052,22 +2046,20 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
::PostMessage(hWndMenu, WM_KEYDOWN, VK_ESCAPE, 0L);
if(wParam == wpNext)
{
- int cItem = m_stackMenuWnd.GetSize() - 1;
+ int cItem = this->m_stackMenuWnd.GetSize() - 1;
while(cItem >= 0)
{
- hWndMenu = m_stackMenuWnd[cItem];
+ hWndMenu = this->m_stackMenuWnd[cItem];
if(hWndMenu != NULL)
::PostMessage(hWndMenu, WM_KEYDOWN, VK_ESCAPE, 0L);
cItem--;
}
}
-#if (_WIN32_IE >= 0x0500)
if(m_nNextPopBtn == -2)
{
m_nNextPopBtn = -1;
pT->DisplayChevronMenu();
}
-#endif // (_WIN32_IE >= 0x0500)
bHandled = TRUE;
}
}
@@ -2184,7 +2176,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
CMenuItemInfo info;
info.fMask = MIIM_CHECKMARKS | MIIM_TYPE;
::GetMenuItemInfo((HMENU)lpDrawItemStruct->hwndItem, lpDrawItemStruct->itemID, MF_BYCOMMAND, &info);
- if(bChecked || info.hbmpUnchecked != NULL)
+ if(bChecked || (info.hbmpUnchecked != NULL))
{
BOOL bRadio = ((info.fType & MFT_RADIOCHECK) != 0);
bHasImage = pT->DrawCheckmark(dc, rcButn, bSelected, bDisabled, bRadio, bChecked ? info.hbmpChecked : info.hbmpUnchecked);
@@ -2194,7 +2186,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
// draw item text
int cxButn = m_szButton.cx;
COLORREF colorBG = ::GetSysColor(bSelected ? COLOR_HIGHLIGHT : COLOR_MENU);
- if(bSelected || lpDrawItemStruct->itemAction == ODA_SELECT)
+ if(bSelected || (lpDrawItemStruct->itemAction == ODA_SELECT))
{
RECT rcBG = rcItem;
if(bHasImage)
@@ -2210,7 +2202,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
COLORREF colorText = ::GetSysColor(bDisabled ? (bSelected ? COLOR_GRAYTEXT : COLOR_3DSHADOW) : (bSelected ? COLOR_HIGHLIGHTTEXT : COLOR_MENUTEXT));
// font already selected by Windows
- if(bDisabled && (!bSelected || colorText == colorBG))
+ if(bDisabled && (!bSelected || (colorText == colorBG)))
{
// disabled - draw shadow text shifted down and right 1 pixel (unles selected)
RECT rcDisabled = rcText;
@@ -2228,16 +2220,12 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
const RECT& rcItem = lpDrawItemStruct->rcItem;
T* pT = static_cast(this);
-#ifndef COLOR_MENUHILIGHT
- const int COLOR_MENUHILIGHT = 29;
-#endif // !COLOR_MENUHILIGHT
-
BOOL bDisabled = lpDrawItemStruct->itemState & ODS_GRAYED;
BOOL bSelected = lpDrawItemStruct->itemState & ODS_SELECTED;
BOOL bChecked = lpDrawItemStruct->itemState & ODS_CHECKED;
// paint background
- if(bSelected || lpDrawItemStruct->itemAction == ODA_SELECT)
+ if(bSelected || (lpDrawItemStruct->itemAction == ODA_SELECT))
{
if(bSelected)
{
@@ -2301,7 +2289,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
CMenuItemInfo info;
info.fMask = MIIM_CHECKMARKS | MIIM_TYPE;
::GetMenuItemInfo((HMENU)lpDrawItemStruct->hwndItem, lpDrawItemStruct->itemID, MF_BYCOMMAND, &info);
- if(bChecked || info.hbmpUnchecked != NULL)
+ if(bChecked || (info.hbmpUnchecked != NULL))
{
BOOL bRadio = ((info.fType & MFT_RADIOCHECK) != 0);
pT->DrawCheckmark(dc, rcButn, bSelected, bDisabled, bRadio, bChecked ? info.hbmpChecked : info.hbmpUnchecked);
@@ -2324,7 +2312,8 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
void DrawMenuText(CDCHandle& dc, RECT& rc, LPCTSTR lpstrText, COLORREF color)
{
int nTab = -1;
- for(int i = 0; i < lstrlen(lpstrText); i++)
+ const int nLen = lstrlen(lpstrText);
+ for(int i = 0; i < nLen; i++)
{
if(lpstrText[i] == _T('\t'))
{
@@ -2343,7 +2332,6 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
HBRUSH hBrush3DEffect = ::GetSysColorBrush(COLOR_3DHILIGHT),
HBRUSH hBrushDisabledImage = ::GetSysColorBrush(COLOR_3DSHADOW))
{
-#if (_WIN32_WINNT >= 0x0501) && (_WIN32_IE >= 0x0501)
if(m_bAlphaImages)
{
IMAGELISTDRAWPARAMS ildp = { 0 };
@@ -2363,7 +2351,6 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
::ImageList_DrawIndirect(&ildp);
}
else
-#endif // (_WIN32_WINNT >= 0x0501) && (_WIN32_IE >= 0x0501)
{
// create memory DC
CDC dcMem;
@@ -2476,7 +2463,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
const DWORD ROP_DSna = 0x00220326L;
// draw mask
- RECT rcSource = { 0, 0, min(size.cx, rc.right - rc.left), min(size.cy, rc.bottom - rc.top) };
+ RECT rcSource = { 0, 0, __min(size.cx, rc.right - rc.left), __min(size.cy, rc.bottom - rc.top) };
dcMask.DrawFrameControl(&rcSource, DFC_MENU, bRadio ? DFCS_MENUBULLET : DFCS_MENUCHECK);
// draw shadow if disabled
@@ -2578,7 +2565,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
hOldFont = dc.SelectFont(m_fontMenu);
}
- RECT rcText = { 0, 0, 0, 0 };
+ RECT rcText = { 0 };
dc.DrawText(pmd->lpstrText, -1, &rcText, DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_CALCRECT);
int cx = rcText.right - rcText.left;
dc.SelectFont(hOldFont);
@@ -2592,7 +2579,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
cy += cyMargin;
// height of item is the bigger of these two
- lpMeasureItemStruct->itemHeight = max(cy, (int)m_szButton.cy);
+ lpMeasureItemStruct->itemHeight = __max(cy, (int)m_szButton.cy);
// width is width of text plus a bunch of stuff
cx += 2 * s_kcxTextMargin; // L/R margin for readability
@@ -2621,7 +2608,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
::GetClassName(hWndMenu, szClassName, cchClassName);
if(!lstrcmp(_T("#32768"), szClassName))
- s_pCurrentBar->m_stackMenuWnd.Push(hWndMenu);
+ CCommandBarCtrlBase::s_pCurrentBar->m_stackMenuWnd.Push(hWndMenu);
}
else if(nCode == HCBT_DESTROYWND)
{
@@ -2633,30 +2620,30 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
::GetClassName(hWndMenu, szClassName, cchClassName);
if(!lstrcmp(_T("#32768"), szClassName))
{
- ATLASSERT(hWndMenu == s_pCurrentBar->m_stackMenuWnd.GetCurrent());
- s_pCurrentBar->m_stackMenuWnd.Pop();
+ ATLASSERT(hWndMenu == CCommandBarCtrlBase::s_pCurrentBar->m_stackMenuWnd.GetCurrent());
+ CCommandBarCtrlBase::s_pCurrentBar->m_stackMenuWnd.Pop();
}
}
- return ::CallNextHookEx(s_hCreateHook, nCode, wParam, lParam);
+ return ::CallNextHookEx(CCommandBarCtrlBase::s_hCreateHook, nCode, wParam, lParam);
}
static LRESULT CALLBACK MessageHookProc(int nCode, WPARAM wParam, LPARAM lParam)
{
LPMSG pMsg = (LPMSG)lParam;
- if(nCode == HC_ACTION && wParam == PM_REMOVE && pMsg->message != GetGetBarMessage() && pMsg->message != WM_FORWARDMSG)
+ if((nCode == HC_ACTION) && (wParam == PM_REMOVE) && (pMsg->message != GetGetBarMessage()) && (pMsg->message != WM_FORWARDMSG))
{
CCommandBarCtrlBase* pCmdBar = NULL;
HWND hWnd = pMsg->hwnd;
DWORD dwPID = 0;
- while(pCmdBar == NULL && hWnd != NULL)
+ while((pCmdBar == NULL) && (hWnd != NULL))
{
pCmdBar = (CCommandBarCtrlBase*)::SendMessage(hWnd, GetGetBarMessage(), (WPARAM)&dwPID, 0L);
hWnd = ::GetParent(hWnd);
}
- if(pCmdBar != NULL && dwPID == GetCurrentProcessId())
+ if((pCmdBar != NULL) && (dwPID == GetCurrentProcessId()))
{
pCmdBar->m_hWndHook = pMsg->hwnd;
ATLASSERT(pCmdBar->IsCommandBarBase());
@@ -2669,11 +2656,11 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
}
LRESULT lRet = 0;
- ATLASSERT(s_pmapMsgHook != NULL);
- if(s_pmapMsgHook != NULL)
+ ATLASSERT(CCommandBarCtrlBase::s_pmapMsgHook != NULL);
+ if(CCommandBarCtrlBase::s_pmapMsgHook != NULL)
{
DWORD dwThreadID = ::GetCurrentThreadId();
- _MsgHookData* pData = s_pmapMsgHook->Lookup(dwThreadID);
+ CCommandBarCtrlBase::_MsgHookData* pData = CCommandBarCtrlBase::s_pmapMsgHook->Lookup(dwThreadID);
if(pData != NULL)
{
lRet = ::CallNextHookEx(pData->hMsgHook, nCode, wParam, lParam);
@@ -2688,22 +2675,14 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
#ifdef _CMDBAR_EXTRA_TRACE
ATLTRACE2(atlTraceUI, 0, _T("CmdBar - DoPopupMenu, bAnimate = %s\n"), bAnimate ? "true" : "false");
#endif
-
- // Menu animation flags
-#ifndef TPM_VERPOSANIMATION
- const UINT TPM_VERPOSANIMATION = 0x1000L;
-#endif
-#ifndef TPM_NOANIMATION
- const UINT TPM_NOANIMATION = 0x4000L;
-#endif
T* pT = static_cast(this);
// get popup menu and it's position
RECT rect = { 0 };
- GetItemRect(nIndex, &rect);
+ this->GetItemRect(nIndex, &rect);
POINT pt = { rect.left, rect.bottom };
- MapWindowPoints(NULL, &pt, 1);
- MapWindowPoints(NULL, &rect);
+ this->MapWindowPoints(NULL, &pt, 1);
+ this->MapWindowPoints(NULL, &rect);
TPMPARAMS TPMParams = { 0 };
TPMParams.cbSize = sizeof(TPMPARAMS);
TPMParams.rcExclude = rect;
@@ -2712,33 +2691,33 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
// get button ID
TBBUTTON tbb = { 0 };
- GetButton(nIndex, &tbb);
+ this->GetButton(nIndex, &tbb);
int nCmdID = tbb.idCommand;
m_nPopBtn = nIndex; // remember current button's index
// press button and display popup menu
- PressButton(nCmdID, TRUE);
- SetHotItem(nCmdID);
+ this->PressButton(nCmdID, TRUE);
+ this->SetHotItem(nCmdID);
pT->DoTrackPopupMenu(hMenuPopup, TPM_LEFTBUTTON | TPM_VERTICAL | TPM_LEFTALIGN | TPM_TOPALIGN |
- (s_bW2K ? (bAnimate ? TPM_VERPOSANIMATION : TPM_NOANIMATION) : 0), pt.x, pt.y, &TPMParams);
- PressButton(nCmdID, FALSE);
- if(::GetFocus() != m_hWnd)
- SetHotItem(-1);
+ (bAnimate ? TPM_VERPOSANIMATION : TPM_NOANIMATION), pt.x, pt.y, &TPMParams);
+ this->PressButton(nCmdID, FALSE);
+ if(::GetFocus() != this->m_hWnd)
+ this->SetHotItem(-1);
m_nPopBtn = -1; // restore
// eat next message if click is on the same button
MSG msg = { 0 };
- if(::PeekMessage(&msg, m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_NOREMOVE) && ::PtInRect(&rect, msg.pt))
- ::PeekMessage(&msg, m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE);
+ if(::PeekMessage(&msg, this->m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_NOREMOVE) && ::PtInRect(&rect, msg.pt))
+ ::PeekMessage(&msg, this->m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE);
// check if another popup menu should be displayed
if(m_nNextPopBtn != -1)
{
- PostMessage(GetAutoPopupMessage(), m_nNextPopBtn & 0xFFFF);
+ this->PostMessage(GetAutoPopupMessage(), m_nNextPopBtn & 0xFFFF);
if(!(m_nNextPopBtn & 0xFFFF0000) && !m_bPopupItem)
- PostMessage(WM_KEYDOWN, VK_DOWN, 0);
+ this->PostMessage(WM_KEYDOWN, VK_DOWN, 0);
m_nNextPopBtn = -1;
}
else
@@ -2753,8 +2732,8 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
}
else
{
- SetHotItem(nCmdID);
- SetAnchorHighlight(TRUE);
+ this->SetHotItem(nCmdID);
+ this->SetAnchorHighlight(TRUE);
}
}
}
@@ -2771,23 +2750,23 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
return FALSE;
}
- ATLASSERT(s_hCreateHook == NULL);
+ ATLASSERT(this->s_hCreateHook == NULL);
- s_pCurrentBar = static_cast(this);
+ this->s_pCurrentBar = static_cast(this);
- s_hCreateHook = ::SetWindowsHookEx(WH_CBT, CreateHookProc, ModuleHelper::GetModuleInstance(), GetCurrentThreadId());
- ATLASSERT(s_hCreateHook != NULL);
+ this->s_hCreateHook = ::SetWindowsHookEx(WH_CBT, CreateHookProc, ModuleHelper::GetModuleInstance(), GetCurrentThreadId());
+ ATLASSERT(this->s_hCreateHook != NULL);
m_bPopupItem = false;
m_bMenuActive = true;
- BOOL bTrackRet = menuPopup.TrackPopupMenuEx(uFlags, x, y, m_hWnd, lpParams);
+ BOOL bTrackRet = menuPopup.TrackPopupMenuEx(uFlags, x, y, this->m_hWnd, lpParams);
m_bMenuActive = false;
- ::UnhookWindowsHookEx(s_hCreateHook);
+ ::UnhookWindowsHookEx(this->s_hCreateHook);
- s_hCreateHook = NULL;
- s_pCurrentBar = NULL;
+ this->s_hCreateHook = NULL;
+ this->s_pCurrentBar = NULL;
lock.Unlock();
@@ -2796,17 +2775,17 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
ATLTRACE2(atlTraceUI, 0, _T("CmdBar - TrackPopupMenu - cleanup\n"));
#endif
- ATLASSERT(m_stackMenuWnd.GetSize() == 0);
+ ATLASSERT(this->m_stackMenuWnd.GetSize() == 0);
- UpdateWindow();
- ATL::CWindow wndTL = GetTopLevelParent();
+ this->UpdateWindow();
+ ATL::CWindow wndTL = this->GetTopLevelParent();
wndTL.UpdateWindow();
// restore the menu items to the previous state for all menus that were converted
if(m_bImagesVisible)
{
HMENU hMenuSav = NULL;
- while((hMenuSav = m_stackMenuHandle.Pop()) != NULL)
+ while((hMenuSav = this->m_stackMenuHandle.Pop()) != NULL)
{
menuPopup = hMenuSav;
BOOL bRet = FALSE;
@@ -2819,7 +2798,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
ATLASSERT(bRet);
_MenuItemData* pMI = (_MenuItemData*)mii.dwItemData;
- if(pMI != NULL && pMI->IsCmdBarMenuItem())
+ if((pMI != NULL) && pMI->IsCmdBarMenuItem())
{
mii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_STATE;
mii.fType = pMI->fType;
@@ -2846,27 +2825,23 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
{
if(nBtn == -1)
return -1;
-#if (_WIN32_IE >= 0x0500)
- RECT rcClient;
- GetClientRect(&rcClient);
-#endif // (_WIN32_IE >= 0x0500)
+ RECT rcClient = { 0 };
+ this->GetClientRect(&rcClient);
int nNextBtn;
for(nNextBtn = nBtn - 1; nNextBtn != nBtn; nNextBtn--)
{
if(nNextBtn < 0)
nNextBtn = ::GetMenuItemCount(m_hMenu) - 1;
TBBUTTON tbb = { 0 };
- GetButton(nNextBtn, &tbb);
-#if (_WIN32_IE >= 0x0500)
- RECT rcBtn;
- GetItemRect(nNextBtn, &rcBtn);
+ this->GetButton(nNextBtn, &tbb);
+ RECT rcBtn = { 0 };
+ this->GetItemRect(nNextBtn, &rcBtn);
if(rcBtn.right > rcClient.right)
{
nNextBtn = -2; // chevron
break;
}
-#endif // (_WIN32_IE >= 0x0500)
- if((tbb.fsState & TBSTATE_ENABLED) != 0 && (tbb.fsState & TBSTATE_HIDDEN) == 0)
+ if(((tbb.fsState & TBSTATE_ENABLED) != 0) && ((tbb.fsState & TBSTATE_HIDDEN) == 0))
break;
}
return (nNextBtn != nBtn) ? nNextBtn : -1;
@@ -2876,10 +2851,8 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
{
if(nBtn == -1)
return -1;
-#if (_WIN32_IE >= 0x0500)
RECT rcClient = { 0 };
- GetClientRect(&rcClient);
-#endif // (_WIN32_IE >= 0x0500)
+ this->GetClientRect(&rcClient);
int nNextBtn = 0;
int nCount = ::GetMenuItemCount(m_hMenu);
for(nNextBtn = nBtn + 1; nNextBtn != nBtn; nNextBtn++)
@@ -2887,39 +2860,36 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
if(nNextBtn >= nCount)
nNextBtn = 0;
TBBUTTON tbb = { 0 };
- GetButton(nNextBtn, &tbb);
-#if (_WIN32_IE >= 0x0500)
+ this->GetButton(nNextBtn, &tbb);
RECT rcBtn = { 0 };
- GetItemRect(nNextBtn, &rcBtn);
+ this->GetItemRect(nNextBtn, &rcBtn);
if(rcBtn.right > rcClient.right)
{
nNextBtn = -2; // chevron
break;
}
-#endif // (_WIN32_IE >= 0x0500)
- if((tbb.fsState & TBSTATE_ENABLED) != 0 && (tbb.fsState & TBSTATE_HIDDEN) == 0)
+ if(((tbb.fsState & TBSTATE_ENABLED) != 0) && ((tbb.fsState & TBSTATE_HIDDEN) == 0))
break;
}
return (nNextBtn != nBtn) ? nNextBtn : -1;
}
-#if (_WIN32_IE >= 0x0500)
bool DisplayChevronMenu()
{
// assume we are in a rebar
- HWND hWndReBar = GetParent();
+ HWND hWndReBar = this->GetParent();
int nCount = (int)::SendMessage(hWndReBar, RB_GETBANDCOUNT, 0, 0L);
bool bRet = false;
for(int i = 0; i < nCount; i++)
{
REBARBANDINFO rbbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_STYLE };
BOOL bRetBandInfo = (BOOL)::SendMessage(hWndReBar, RB_GETBANDINFO, i, (LPARAM)&rbbi);
- if(bRetBandInfo && rbbi.hwndChild == m_hWnd)
+ if(bRetBandInfo && (rbbi.hwndChild == this->m_hWnd))
{
if((rbbi.fStyle & RBBS_USECHEVRON) != 0)
{
::PostMessage(hWndReBar, RB_PUSHCHEVRON, i, 0L);
- PostMessage(WM_KEYDOWN, VK_DOWN, 0L);
+ this->PostMessage(WM_KEYDOWN, VK_DOWN, 0L);
bRet = true;
}
break;
@@ -2927,7 +2897,6 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
}
return bRet;
}
-#endif // (_WIN32_IE >= 0x0500)
void GetSystemSettings()
{
@@ -2940,20 +2909,20 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
LOGFONT logfont = { 0 };
if(m_fontMenu.m_hFont != NULL)
m_fontMenu.GetLogFont(logfont);
- if(logfont.lfHeight != info.lfMenuFont.lfHeight ||
- logfont.lfWidth != info.lfMenuFont.lfWidth ||
- logfont.lfEscapement != info.lfMenuFont.lfEscapement ||
- logfont.lfOrientation != info.lfMenuFont.lfOrientation ||
- logfont.lfWeight != info.lfMenuFont.lfWeight ||
- logfont.lfItalic != info.lfMenuFont.lfItalic ||
- logfont.lfUnderline != info.lfMenuFont.lfUnderline ||
- logfont.lfStrikeOut != info.lfMenuFont.lfStrikeOut ||
- logfont.lfCharSet != info.lfMenuFont.lfCharSet ||
- logfont.lfOutPrecision != info.lfMenuFont.lfOutPrecision ||
- logfont.lfClipPrecision != info.lfMenuFont.lfClipPrecision ||
- logfont.lfQuality != info.lfMenuFont.lfQuality ||
- logfont.lfPitchAndFamily != info.lfMenuFont.lfPitchAndFamily ||
- lstrcmp(logfont.lfFaceName, info.lfMenuFont.lfFaceName) != 0)
+ if((logfont.lfHeight != info.lfMenuFont.lfHeight) ||
+ (logfont.lfWidth != info.lfMenuFont.lfWidth) ||
+ (logfont.lfEscapement != info.lfMenuFont.lfEscapement) ||
+ (logfont.lfOrientation != info.lfMenuFont.lfOrientation) ||
+ (logfont.lfWeight != info.lfMenuFont.lfWeight) ||
+ (logfont.lfItalic != info.lfMenuFont.lfItalic) ||
+ (logfont.lfUnderline != info.lfMenuFont.lfUnderline) ||
+ (logfont.lfStrikeOut != info.lfMenuFont.lfStrikeOut) ||
+ (logfont.lfCharSet != info.lfMenuFont.lfCharSet) ||
+ (logfont.lfOutPrecision != info.lfMenuFont.lfOutPrecision) ||
+ (logfont.lfClipPrecision != info.lfMenuFont.lfClipPrecision) ||
+ (logfont.lfQuality != info.lfMenuFont.lfQuality) ||
+ (logfont.lfPitchAndFamily != info.lfMenuFont.lfPitchAndFamily) ||
+ (lstrcmp(logfont.lfFaceName, info.lfMenuFont.lfFaceName) != 0))
{
HFONT hFontMenu = ::CreateFontIndirect(&info.lfMenuFont);
ATLASSERT(hFontMenu != NULL);
@@ -2962,17 +2931,17 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
if(m_fontMenu.m_hFont != NULL)
m_fontMenu.DeleteObject();
m_fontMenu.Attach(hFontMenu);
- SetFont(m_fontMenu);
- AddStrings(_T("NS\0")); // for proper item height
- AutoSize();
+ this->SetFont(m_fontMenu);
+ this->AddStrings(_T("NS\0")); // for proper item height
+ this->AutoSize();
}
}
}
// check if we need extra spacing for menu item text
- CWindowDC dc(m_hWnd);
+ CWindowDC dc(this->m_hWnd);
HFONT hFontOld = dc.SelectFont(m_fontMenu);
- RECT rcText = { 0, 0, 0, 0 };
+ RECT rcText = { 0 };
dc.DrawText(_T("\t"), -1, &rcText, DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_CALCRECT);
if((rcText.right - rcText.left) < 4)
{
@@ -2987,15 +2956,18 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
dc.SelectFont(hFontOld);
// get Windows version
+#ifndef _versionhelpers_H_INCLUDED_
OSVERSIONINFO ovi = { sizeof(OSVERSIONINFO) };
::GetVersionEx(&ovi);
+#endif // !_versionhelpers_H_INCLUDED_
// query keyboard cues mode (Windows 2000 or later)
- if(ovi.dwMajorVersion >= 5)
+#ifdef _versionhelpers_H_INCLUDED_
+ if(::IsWindowsVersionOrGreater(5, 0, 0))
+#else // !_versionhelpers_H_INCLUDED_
+ if (ovi.dwMajorVersion >= 5)
+#endif // _versionhelpers_H_INCLUDED_
{
-#ifndef SPI_GETKEYBOARDCUES
- const UINT SPI_GETKEYBOARDCUES = 0x100A;
-#endif // !SPI_GETKEYBOARDCUES
BOOL bRetVal = TRUE;
bRet = ::SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &bRetVal, 0);
m_bUseKeyboardCues = (bRet && !bRetVal);
@@ -3004,11 +2976,12 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
}
// query flat menu mode (Windows XP or later)
- if((ovi.dwMajorVersion == 5 && ovi.dwMinorVersion >= 1) || (ovi.dwMajorVersion > 5))
+#ifdef _versionhelpers_H_INCLUDED_
+ if(::IsWindowsXPOrGreater())
+#else // !_versionhelpers_H_INCLUDED_
+ if (((ovi.dwMajorVersion == 5) && (ovi.dwMinorVersion >= 1)) || (ovi.dwMajorVersion > 5))
+#endif // _versionhelpers_H_INCLUDED_
{
-#ifndef SPI_GETFLATMENU
- const UINT SPI_GETFLATMENU = 0x1022;
-#endif // !SPI_GETFLATMENU
BOOL bRetVal = FALSE;
bRet = ::SystemParametersInfo(SPI_GETFLATMENU, 0, &bRetVal, 0);
m_bFlatMenus = (bRet && bRetVal);
@@ -3016,27 +2989,7 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
#if _WTL_CMDBAR_VISTA_MENUS
// check if we should use Vista menus
- bool bVistaMenus = (RunTimeHelper::IsVista() && RunTimeHelper::IsCommCtrl6() && ((m_dwExtendedStyle & CBR_EX_NOVISTAMENUS) == 0));
-
- if(bVistaMenus)
- {
- HMODULE hThemeDLL = ::LoadLibrary(_T("uxtheme.dll"));
- if(hThemeDLL != NULL)
- {
- typedef BOOL (STDAPICALLTYPE *PFN_IsThemeActive)();
- PFN_IsThemeActive pfnIsThemeActive = (PFN_IsThemeActive)::GetProcAddress(hThemeDLL, "IsThemeActive");
- ATLASSERT(pfnIsThemeActive != NULL);
- bVistaMenus = bVistaMenus && (pfnIsThemeActive != NULL) && (pfnIsThemeActive() != FALSE);
-
- typedef BOOL (STDAPICALLTYPE *PFN_IsAppThemed)();
- PFN_IsAppThemed pfnIsAppThemed = (PFN_IsAppThemed)::GetProcAddress(hThemeDLL, "IsAppThemed");
- ATLASSERT(pfnIsAppThemed != NULL);
- bVistaMenus = bVistaMenus && (pfnIsAppThemed != NULL) && (pfnIsAppThemed() != FALSE);
-
- ::FreeLibrary(hThemeDLL);
- }
- }
-
+ bool bVistaMenus = (((m_dwExtendedStyle & CBR_EX_NOVISTAMENUS) == 0) && RunTimeHelper::IsVista() && RunTimeHelper::IsThemeAvailable());
if(!bVistaMenus && m_bVistaMenus && (m_hMenu != NULL) && (m_arrCommand.GetSize() > 0))
{
T* pT = static_cast(this);
@@ -3055,9 +3008,9 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
// Implementation - alternate focus mode support
void TakeFocus()
{
- if((m_dwExtendedStyle & CBR_EX_ALTFOCUSMODE) && m_hWndFocus == NULL)
+ if((m_dwExtendedStyle & CBR_EX_ALTFOCUSMODE) && (m_hWndFocus == NULL))
m_hWndFocus = ::GetFocus();
- SetFocus();
+ this->SetFocus();
}
void GiveFocusBack()
@@ -3070,18 +3023,18 @@ class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWi
m_wndParent.SetFocus();
}
m_hWndFocus = NULL;
- SetAnchorHighlight(FALSE);
+ this->SetAnchorHighlight(FALSE);
if(m_bUseKeyboardCues && m_bShowKeyboardCues)
- ShowKeyboardCues(false);
+ this->ShowKeyboardCues(false);
m_bSkipPostDown = false;
}
void ShowKeyboardCues(bool bShow)
{
m_bShowKeyboardCues = bShow;
- SetDrawTextFlags(DT_HIDEPREFIX, m_bShowKeyboardCues ? 0 : DT_HIDEPREFIX);
- Invalidate();
- UpdateWindow();
+ this->SetDrawTextFlags(DT_HIDEPREFIX, m_bShowKeyboardCues ? 0 : DT_HIDEPREFIX);
+ this->Invalidate();
+ this->UpdateWindow();
}
// Implementation - internal message helpers
@@ -3284,34 +3237,18 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
int m_cxLeft; // left nonclient area width
int m_cxRight; // right nonclient area width
-// Theme declarations and data members
-#ifndef _WTL_NO_AUTO_THEME
-#ifndef _UXTHEME_H_
- typedef HANDLE HTHEME;
-#endif // !_UXTHEME_H_
- typedef HTHEME (STDAPICALLTYPE *PFN_OpenThemeData)(HWND hwnd, LPCWSTR pszClassList);
- typedef HRESULT (STDAPICALLTYPE *PFN_CloseThemeData)(HTHEME hTheme);
- typedef HRESULT (STDAPICALLTYPE *PFN_DrawThemeBackground)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect);
- typedef HRESULT (STDAPICALLTYPE *PFN_DrawThemeParentBackground)(HWND hwnd, HDC hdc, OPTIONAL RECT* prc);
-
- HMODULE m_hThemeDLL;
HTHEME m_hTheme;
- PFN_DrawThemeBackground m_pfnDrawThemeBackground;
- PFN_DrawThemeParentBackground m_pfnDrawThemeParentBackground;
-#endif // !_WTL_NO_AUTO_THEME
// Constructor/destructor
CMDICommandBarCtrlImpl() :
m_wndMDIClient(this, 2), m_bChildMaximized(false),
m_hWndChildMaximized(NULL), m_hIconChildMaximized(NULL),
m_nBtnPressed(-1), m_nBtnWasPressed(-1),
-#ifndef _WTL_NO_AUTO_THEME
- m_hThemeDLL(NULL), m_hTheme(NULL), m_pfnDrawThemeBackground(NULL), m_pfnDrawThemeParentBackground(NULL),
-#endif // !_WTL_NO_AUTO_THEME
m_cxyOffset(2),
m_cxIconWidth(16), m_cyIconHeight(16),
m_cxBtnWidth(16), m_cyBtnHeight(14),
- m_cxLeft(20), m_cxRight(55)
+ m_cxLeft(20), m_cxRight(55),
+ m_hTheme(NULL)
{ }
~CMDICommandBarCtrlImpl()
@@ -3350,9 +3287,7 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
BEGIN_MSG_MAP(CMDICommandBarCtrlImpl)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
-#ifndef _WTL_NO_AUTO_THEME
MESSAGE_HANDLER(_GetThemeChangedMsg(), OnThemeChanged)
-#endif // !_WTL_NO_AUTO_THEME
MESSAGE_HANDLER(WM_SIZE, OnSize)
MESSAGE_HANDLER(WM_NCCALCSIZE, OnNcCalcSize)
MESSAGE_HANDLER(WM_NCPAINT, OnNcPaint)
@@ -3381,27 +3316,8 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
if(lRet == (LRESULT)-1)
return lRet;
-#ifndef _WTL_NO_AUTO_THEME
- // this will fail if theming is not supported
- m_hThemeDLL = ::LoadLibrary(_T("uxtheme.dll"));
- if(m_hThemeDLL != NULL)
- {
- m_pfnDrawThemeBackground = (PFN_DrawThemeBackground)::GetProcAddress(m_hThemeDLL, "DrawThemeBackground");
- ATLASSERT(m_pfnDrawThemeBackground != NULL);
- if(m_pfnDrawThemeBackground != NULL)
- {
- T* pT = static_cast(this);
- pT->_OpenThemeData();
- }
- else
- {
- ::FreeLibrary(m_hThemeDLL);
- m_hThemeDLL = NULL;
- }
- m_pfnDrawThemeParentBackground = (PFN_DrawThemeParentBackground)::GetProcAddress(m_hThemeDLL, "DrawThemeParentBackground");
- ATLASSERT(m_pfnDrawThemeParentBackground != NULL);
- }
-#endif // !_WTL_NO_AUTO_THEME
+ T* pT = static_cast(this);
+ pT->_OpenThemeData();
return lRet;
}
@@ -3410,35 +3326,24 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
{
LRESULT lRet = _baseClass::OnDestroy(uMsg, wParam, lParam, bHandled);
-#ifndef _WTL_NO_AUTO_THEME
- if(m_hThemeDLL != NULL)
- {
- T* pT = static_cast(this);
- pT->_CloseThemeData();
- ::FreeLibrary(m_hThemeDLL);
- m_hThemeDLL = NULL;
- }
-#endif // !_WTL_NO_AUTO_THEME
+ T* pT = static_cast(this);
+ pT->_CloseThemeData();
return lRet;
}
-#ifndef _WTL_NO_AUTO_THEME
LRESULT OnThemeChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
- if(m_hThemeDLL != NULL)
- {
- T* pT = static_cast(this);
- pT->_CloseThemeData();
- pT->_OpenThemeData();
- }
+ T* pT = static_cast(this);
+ pT->_CloseThemeData();
+ pT->_OpenThemeData();
+
return 0;
}
-#endif // !_WTL_NO_AUTO_THEME
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
- LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);
+ LRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);
T* pT = static_cast(this);
pT->_AdjustBtnSize(GET_Y_LPARAM(lParam));
return lRet;
@@ -3446,12 +3351,12 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
- LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);
+ LRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);
if(m_bChildMaximized && (BOOL)wParam)
{
LPNCCALCSIZE_PARAMS lpParams = (LPNCCALCSIZE_PARAMS)lParam;
- if(m_bLayoutRTL)
+ if(this->m_bLayoutRTL)
{
lpParams->rgrc[0].left += m_cxRight;
lpParams->rgrc[0].right -= m_cxLeft;
@@ -3468,34 +3373,29 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
- LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);
+ LRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);
if(!m_bChildMaximized)
return lRet;
- ATLASSERT(m_hWndChildMaximized != NULL && m_hIconChildMaximized != NULL);
+ ATLASSERT((m_hWndChildMaximized != NULL) && (m_hIconChildMaximized != NULL));
// get DC and window rectangle
- CWindowDC dc(m_hWnd);
- RECT rect;
- GetWindowRect(&rect);
+ CWindowDC dc(this->m_hWnd);
+ RECT rect = { 0 };
+ this->GetWindowRect(&rect);
int cxWidth = rect.right - rect.left;
int cyHeight = rect.bottom - rect.top;
// paint left side nonclient background and draw icon
::SetRect(&rect, 0, 0, m_cxLeft, cyHeight);
-#ifndef _WTL_NO_AUTO_THEME
if(m_hTheme != NULL)
{
- if(m_pfnDrawThemeParentBackground != NULL)
- m_pfnDrawThemeParentBackground(m_hWnd, dc, &rect);
- else
- dc.FillRect(&rect, COLOR_WINDOW);
+ ::DrawThemeParentBackground(this->m_hWnd, dc, &rect);
}
else
-#endif // !_WTL_NO_AUTO_THEME
{
- if((m_dwExtendedStyle & CBR_EX_TRANSPARENT) != 0)
+ if((this->m_dwExtendedStyle & CBR_EX_TRANSPARENT) != 0)
dc.FillRect(&rect, COLOR_3DFACE);
else
dc.FillRect(&rect, COLOR_MENU);
@@ -3508,32 +3408,23 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
// paint right side nonclient background
::SetRect(&rect, cxWidth - m_cxRight, 0, cxWidth, cyHeight);
-#ifndef _WTL_NO_AUTO_THEME
if(m_hTheme != NULL)
{
- if(m_pfnDrawThemeParentBackground != NULL)
- {
- // this is to account for the left non-client area
- POINT ptOrg = { 0, 0 };
- dc.GetViewportOrg(&ptOrg);
- dc.SetViewportOrg(ptOrg.x + m_cxLeft, ptOrg.y);
- ::OffsetRect(&rect, -m_cxLeft, 0);
+ // this is to account for the left non-client area
+ POINT ptOrg = { 0, 0 };
+ dc.GetViewportOrg(&ptOrg);
+ dc.SetViewportOrg(ptOrg.x + m_cxLeft, ptOrg.y);
+ ::OffsetRect(&rect, -m_cxLeft, 0);
- m_pfnDrawThemeParentBackground(m_hWnd, dc, &rect);
+ ::DrawThemeParentBackground(this->m_hWnd, dc, &rect);
- // restore
- dc.SetViewportOrg(ptOrg);
- ::OffsetRect(&rect, m_cxLeft, 0);
- }
- else
- {
- dc.FillRect(&rect, COLOR_3DFACE);
- }
+ // restore
+ dc.SetViewportOrg(ptOrg);
+ ::OffsetRect(&rect, m_cxLeft, 0);
}
else
-#endif // !_WTL_NO_AUTO_THEME
{
- if((m_dwExtendedStyle & CBR_EX_TRANSPARENT) != 0)
+ if((this->m_dwExtendedStyle & CBR_EX_TRANSPARENT) != 0)
dc.FillRect(&rect, COLOR_3DFACE);
else
dc.FillRect(&rect, COLOR_MENU);
@@ -3549,13 +3440,13 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
- LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);
+ LRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);
if(m_bChildMaximized)
{
RECT rect = { 0 };
- GetWindowRect(&rect);
+ this->GetWindowRect(&rect);
POINT pt = { GET_X_LPARAM(lParam) - rect.left, GET_Y_LPARAM(lParam) - rect.top };
- if(m_bLayoutRTL)
+ if(this->m_bLayoutRTL)
{
if((pt.x < m_cxRight) || (pt.x > ((rect.right - rect.left) - m_cxLeft)))
lRet = HTBORDER;
@@ -3581,33 +3472,30 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
RECT rect = { 0 };
- GetWindowRect(&rect);
+ this->GetWindowRect(&rect);
pt.x -= rect.left;
pt.y -= rect.top;
RECT rcIcon = { 0 };
T* pT = static_cast(this);
- pT->_CalcIconRect(rect.right - rect.left, rect.bottom - rect.top, rcIcon, m_bLayoutRTL);
+ pT->_CalcIconRect(rect.right - rect.left, rect.bottom - rect.top, rcIcon, this->m_bLayoutRTL);
RECT arrRect[3] = { 0 };
- pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, m_bLayoutRTL);
+ pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, this->m_bLayoutRTL);
if(::PtInRect(&rcIcon, pt))
{
#ifdef _CMDBAR_EXTRA_TRACE
ATLTRACE2(atlTraceUI, 0, _T("MDI CmdBar - LButtonDown: icon\n"));
-#endif
-#ifndef TPM_VERPOSANIMATION
- const UINT TPM_VERPOSANIMATION = 0x1000L; // Menu animation flag
#endif
CMenuHandle menu = ::GetSystemMenu(m_hWndChildMaximized, FALSE);
UINT uRet = (UINT)menu.TrackPopupMenu(TPM_LEFTBUTTON | TPM_VERTICAL | TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD |
- (s_bW2K ? TPM_VERPOSANIMATION : 0), m_bLayoutRTL ? rect.right : rect.left, rect.bottom, m_hWndChildMaximized);
+ TPM_VERPOSANIMATION, this->m_bLayoutRTL ? rect.right : rect.left, rect.bottom, m_hWndChildMaximized);
// eat next message if click is on the same button
::OffsetRect(&rcIcon, rect.left, rect.top);
MSG msg = { 0 };
- if(::PeekMessage(&msg, m_hWnd, WM_NCLBUTTONDOWN, WM_NCLBUTTONDOWN, PM_NOREMOVE) && ::PtInRect(&rcIcon, msg.pt))
- ::PeekMessage(&msg, m_hWnd, WM_NCLBUTTONDOWN, WM_NCLBUTTONDOWN, PM_REMOVE);
+ if(::PeekMessage(&msg, this->m_hWnd, WM_NCLBUTTONDOWN, WM_NCLBUTTONDOWN, PM_NOREMOVE) && ::PtInRect(&rcIcon, msg.pt))
+ ::PeekMessage(&msg, this->m_hWnd, WM_NCLBUTTONDOWN, WM_NCLBUTTONDOWN, PM_REMOVE);
if(uRet != 0)
::SendMessage(m_hWndChildMaximized, WM_SYSCOMMAND, uRet, 0L);
@@ -3641,8 +3529,8 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
// draw the button state if it was pressed
if(m_nBtnPressed != -1)
{
- SetCapture();
- CWindowDC dc(m_hWnd);
+ this->SetCapture();
+ CWindowDC dc(this->m_hWnd);
pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect);
pT->_DrawMDIButton(dc, arrRect, m_nBtnPressed);
}
@@ -3652,26 +3540,26 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
{
- if(!m_bChildMaximized || ::GetCapture() != m_hWnd || m_nBtnWasPressed == -1)
+ if(!m_bChildMaximized || (::GetCapture() != this->m_hWnd) || (m_nBtnWasPressed == -1))
{
bHandled = FALSE;
return 1;
}
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
- ClientToScreen(&pt);
+ this->ClientToScreen(&pt);
RECT rect = { 0 };
- GetWindowRect(&rect);
+ this->GetWindowRect(&rect);
pt.x -= rect.left;
pt.y -= rect.top;
RECT arrRect[3] = { 0 };
T* pT = static_cast(this);
- pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, m_bLayoutRTL);
+ pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, this->m_bLayoutRTL);
int nOldBtnPressed = m_nBtnPressed;
m_nBtnPressed = ::PtInRect(&arrRect[m_nBtnWasPressed], pt) ? m_nBtnWasPressed : -1;
if(nOldBtnPressed != m_nBtnPressed)
{
- CWindowDC dc(m_hWnd);
+ CWindowDC dc(this->m_hWnd);
pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect);
pT->_DrawMDIButton(dc, arrRect, (m_nBtnPressed != -1) ? m_nBtnPressed : nOldBtnPressed);
}
@@ -3681,7 +3569,7 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
LRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
{
- if(!m_bChildMaximized || ::GetCapture() != m_hWnd || m_nBtnWasPressed == -1)
+ if(!m_bChildMaximized || (::GetCapture() != this->m_hWnd) || (m_nBtnWasPressed == -1))
{
bHandled = FALSE;
return 1;
@@ -3690,9 +3578,9 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
ATLASSERT(_DebugCheckChild());
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
- ClientToScreen(&pt);
+ this->ClientToScreen(&pt);
RECT rect = { 0 };
- GetWindowRect(&rect);
+ this->GetWindowRect(&rect);
pt.x -= rect.left;
pt.y -= rect.top;
@@ -3701,7 +3589,7 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
RECT arrRect[3] = { 0 };
T* pT = static_cast(this);
- pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, m_bLayoutRTL);
+ pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, this->m_bLayoutRTL);
if(::PtInRect(&arrRect[nBtn], pt))
{
switch(nBtn)
@@ -3734,7 +3622,7 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
LRESULT OnNcLButtonDblClk(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
{
- if(!m_bChildMaximized || m_nBtnWasPressed != -1)
+ if(!m_bChildMaximized || (m_nBtnWasPressed != -1))
{
bHandled = FALSE;
return 1;
@@ -3744,15 +3632,15 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
RECT rect = { 0 };
- GetWindowRect(&rect);
+ this->GetWindowRect(&rect);
pt.x -= rect.left;
pt.y -= rect.top;
RECT rcIcon = { 0 };
T* pT = static_cast(this);
- pT->_CalcIconRect(rect.right - rect.left, rect.bottom - rect.top, rcIcon, m_bLayoutRTL);
+ pT->_CalcIconRect(rect.right - rect.left, rect.bottom - rect.top, rcIcon, this->m_bLayoutRTL);
RECT arrRect[3] = { 0 };
- pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, m_bLayoutRTL);
+ pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, this->m_bLayoutRTL);
if(::PtInRect(&rcIcon, pt))
{
@@ -3775,11 +3663,11 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
ATLASSERT(m_nBtnPressed == m_nBtnWasPressed); // must be
m_nBtnPressed = -1;
RECT rect = { 0 };
- GetWindowRect(&rect);
+ this->GetWindowRect(&rect);
RECT arrRect[3] = { 0 };
T* pT = static_cast(this);
pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect);
- CWindowDC dc(m_hWnd);
+ CWindowDC dc(this->m_hWnd);
pT->_DrawMDIButton(dc, arrRect, m_nBtnWasPressed);
}
m_nBtnWasPressed = -1;
@@ -3794,8 +3682,8 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
// Parent window message handlers
LRESULT OnParentActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)
{
- m_bParentActive = (LOWORD(wParam) != WA_INACTIVE);
- RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW);
+ this->m_bParentActive = (LOWORD(wParam) != WA_INACTIVE);
+ this->RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW);
bHandled = FALSE;
return 1;
}
@@ -3804,15 +3692,13 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
LRESULT OnMDISetMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
m_wndMDIClient.DefWindowProc(uMsg, NULL, lParam);
- HMENU hOldMenu = GetMenu();
- BOOL bRet = AttachMenu((HMENU)wParam);
+ HMENU hOldMenu = this->GetMenu();
+ BOOL bRet = this->AttachMenu((HMENU)wParam);
bRet; // avoid level 4 warning
ATLASSERT(bRet);
-#if (_WIN32_IE >= 0x0400)
T* pT = static_cast(this);
pT->UpdateRebarBandIdealSize();
-#endif // (_WIN32_IE >= 0x0400)
return (LRESULT)hOldMenu;
}
@@ -3833,23 +3719,23 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
{
// assuming we are in a rebar, change ideal size to our size
// we hope that if we are not in a rebar, nCount will be 0
- int nCount = (int)::SendMessage(GetParent(), RB_GETBANDCOUNT, 0, 0L);
+ int nCount = (int)this->GetParent().SendMessage(RB_GETBANDCOUNT, 0, 0L);
for(int i = 0; i < nCount; i++)
{
REBARBANDINFO rbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE };
- ::SendMessage(GetParent(), RB_GETBANDINFO, i, (LPARAM)&rbi);
- if(rbi.hwndChild == m_hWnd)
+ this->GetParent().SendMessage(RB_GETBANDINFO, i, (LPARAM)&rbi);
+ if(rbi.hwndChild == this->m_hWnd)
{
rbi.fMask = RBBIM_IDEALSIZE;
rbi.cxIdeal = m_bChildMaximized ? m_cxLeft + m_cxRight : 0;
- int nBtnCount = GetButtonCount();
+ int nBtnCount = this->GetButtonCount();
if(nBtnCount > 0)
{
RECT rect = { 0 };
- GetItemRect(nBtnCount - 1, &rect);
+ this->GetItemRect(nBtnCount - 1, &rect);
rbi.cxIdeal += rect.right;
}
- ::SendMessage(GetParent(), RB_SETBANDINFO, i, (LPARAM)&rbi);
+ this->GetParent().SendMessage(RB_SETBANDINFO, i, (LPARAM)&rbi);
break;
}
}
@@ -3858,13 +3744,13 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
// all hook messages - check for the maximized MDI child window change
void _ProcessAllHookMessages(UINT uMsg, WPARAM /*wParam*/, LPARAM /*lParam*/)
{
- if(uMsg == WM_MDIGETACTIVE || uMsg == WM_MDISETMENU)
+ if((uMsg == WM_MDIGETACTIVE) || (uMsg == WM_MDISETMENU))
return;
BOOL bMaximized = FALSE;
HWND hWndChild = (HWND)::SendMessage(m_wndMDIClient, WM_MDIGETACTIVE, 0, (LPARAM)&bMaximized);
bool bMaxOld = m_bChildMaximized;
- m_bChildMaximized = (hWndChild != NULL && bMaximized);
+ m_bChildMaximized = ((hWndChild != NULL) && bMaximized);
HICON hIconOld = m_hIconChildMaximized;
if(m_bChildMaximized)
@@ -3876,16 +3762,8 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
if(m_hIconChildMaximized == NULL)
{
m_hIconChildMaximized = wnd.GetIcon(TRUE);
- if(m_hIconChildMaximized == NULL)
- {
- // no icon set with WM_SETICON, get the class one
-// need conditional code because types don't match in winuser.h
-#ifdef _WIN64
+ if(m_hIconChildMaximized == NULL) // no icon set with WM_SETICON, get the class one
m_hIconChildMaximized = (HICON)::GetClassLongPtr(wnd, GCLP_HICONSM);
-#else
- m_hIconChildMaximized = (HICON)LongToHandle(::GetClassLongPtr(wnd, GCLP_HICONSM));
-#endif
- }
}
}
}
@@ -3902,60 +3780,37 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
#endif
// assuming we are in a rebar, change our size to accomodate new state
// we hope that if we are not in a rebar, nCount will be 0
- int nCount = (int)::SendMessage(GetParent(), RB_GETBANDCOUNT, 0, 0L);
+ int nCount = (int)this->GetParent().SendMessage(RB_GETBANDCOUNT, 0, 0L);
int cxDiff = (m_bChildMaximized ? 1 : -1) * (m_cxLeft + m_cxRight);
for(int i = 0; i < nCount; i++)
{
-#if (_WIN32_IE >= 0x0500)
REBARBANDINFO rbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE | RBBIM_STYLE };
- ::SendMessage(GetParent(), RB_GETBANDINFO, i, (LPARAM)&rbi);
- if(rbi.hwndChild == m_hWnd)
+ this->GetParent().SendMessage(RB_GETBANDINFO, i, (LPARAM)&rbi);
+ if(rbi.hwndChild == this->m_hWnd)
{
if((rbi.fStyle & RBBS_USECHEVRON) != 0)
{
rbi.fMask = RBBIM_CHILDSIZE | RBBIM_IDEALSIZE;
rbi.cxMinChild += cxDiff;
rbi.cxIdeal += cxDiff;
- ::SendMessage(GetParent(), RB_SETBANDINFO, i, (LPARAM)&rbi);
+ this->GetParent().SendMessage(RB_SETBANDINFO, i, (LPARAM)&rbi);
}
break;
}
-#elif (_WIN32_IE >= 0x0400)
- REBARBANDINFO rbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE };
- ::SendMessage(GetParent(), RB_GETBANDINFO, i, (LPARAM)&rbi);
- if(rbi.hwndChild == m_hWnd)
- {
- rbi.fMask = RBBIM_CHILDSIZE | RBBIM_IDEALSIZE;
- rbi.cxMinChild += cxDiff;
- rbi.cxIdeal += cxDiff;
- ::SendMessage(GetParent(), RB_SETBANDINFO, i, (LPARAM)&rbi);
- break;
- }
-#else // (_WIN32_IE < 0x0400)
- REBARBANDINFO rbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_CHILDSIZE };
- ::SendMessage(GetParent(), RB_GETBANDINFO, i, (LPARAM)&rbi);
- if(rbi.hwndChild == m_hWnd)
- {
- rbi.fMask = RBBIM_CHILDSIZE;
- rbi.cxMinChild += cxDiff;
- ::SendMessage(GetParent(), RB_SETBANDINFO, i, (LPARAM)&rbi);
- break;
- }
-#endif // (_WIN32_IE < 0x0400)
}
}
- if(bMaxOld != m_bChildMaximized || hIconOld != m_hIconChildMaximized)
+ if((bMaxOld != m_bChildMaximized) || (hIconOld != m_hIconChildMaximized))
{
// force size change and redraw everything
RECT rect = { 0 };
- GetWindowRect(&rect);
- ::MapWindowPoints(NULL, GetParent(), (LPPOINT)&rect, 2);
- SetRedraw(FALSE);
- SetWindowPos(NULL, 0, 0, 1, 1, SWP_NOZORDER | SWP_NOMOVE);
- SetWindowPos(NULL, &rect, SWP_NOZORDER | SWP_NOMOVE);
- SetRedraw(TRUE);
- RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
+ this->GetWindowRect(&rect);
+ ::MapWindowPoints(NULL, this->GetParent(), (LPPOINT)&rect, 2);
+ this->SetRedraw(FALSE);
+ this->SetWindowPos(NULL, 0, 0, 1, 1, SWP_NOZORDER | SWP_NOMOVE);
+ this->SetWindowPos(NULL, &rect, SWP_NOZORDER | SWP_NOMOVE);
+ this->SetRedraw(TRUE);
+ this->RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
}
}
@@ -3976,7 +3831,6 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
m_cyIconHeight = ::GetSystemMetrics(SM_CYSMICON);
m_cxLeft = m_cxIconWidth;
-#ifndef _WTL_NO_AUTO_THEME
if(m_hTheme != NULL)
{
m_cxBtnWidth = info.iCaptionWidth - 2 * m_cxyOffset;
@@ -3984,7 +3838,6 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
m_cxRight = 3 * m_cxBtnWidth;
}
else
-#endif // !_WTL_NO_AUTO_THEME
{
m_cxBtnWidth = info.iCaptionWidth - m_cxyOffset;
m_cyBtnHeight = info.iCaptionHeight - 2 * m_cxyOffset;
@@ -3993,16 +3846,15 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
}
RECT rect = { 0 };
- GetClientRect(&rect);
+ this->GetClientRect(&rect);
T* pT = static_cast(this);
pT->_AdjustBtnSize(rect.bottom);
}
void _AdjustBtnSize(int cyHeight)
{
- if(cyHeight > 1 && m_cyBtnHeight > cyHeight)
+ if((cyHeight > 1) && (m_cyBtnHeight > cyHeight))
{
-#ifndef _WTL_NO_AUTO_THEME
if(m_hTheme != NULL)
{
m_cyBtnHeight = cyHeight;
@@ -4010,7 +3862,6 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
m_cxRight = 3 * m_cxBtnWidth;
}
else
-#endif // !_WTL_NO_AUTO_THEME
{
m_cyBtnHeight = cyHeight;
m_cxBtnWidth = cyHeight + m_cxyOffset;
@@ -4049,11 +3900,9 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
}
arrRect[0] = rcBtn;
-#ifndef _WTL_NO_AUTO_THEME
if(m_hTheme != NULL)
::OffsetRect(&rcBtn, nDirection * m_cxBtnWidth, 0);
else
-#endif // !_WTL_NO_AUTO_THEME
::OffsetRect(&rcBtn, nDirection * (m_cxBtnWidth + m_cxyOffset), 0);
arrRect[1] = rcBtn;
::OffsetRect(&rcBtn, nDirection * m_cxBtnWidth, 0);
@@ -4062,10 +3911,9 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
void _DrawMDIButton(CWindowDC& dc, LPRECT pRects, int nBtn)
{
-#ifndef _WTL_NO_AUTO_THEME
if(m_hTheme != NULL)
{
-#ifndef TMSCHEMA_H
+#ifndef __VSSYM32_H__
const int WP_MDICLOSEBUTTON = 20;
const int CBS_NORMAL = 1;
const int CBS_PUSHED = 3;
@@ -4078,27 +3926,25 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
const int MINBS_NORMAL = 1;
const int MINBS_PUSHED = 3;
const int MINBS_DISABLED = 4;
-#endif // TMSCHEMA_H
- if(nBtn == -1 || nBtn == 0)
- m_pfnDrawThemeBackground(m_hTheme, dc, WP_MDICLOSEBUTTON, m_bParentActive ? ((m_nBtnPressed == 0) ? CBS_PUSHED : CBS_NORMAL) : CBS_DISABLED, &pRects[0], NULL);
- if(nBtn == -1 || nBtn == 1)
- m_pfnDrawThemeBackground(m_hTheme, dc, WP_MDIRESTOREBUTTON, m_bParentActive ? ((m_nBtnPressed == 1) ? RBS_PUSHED : RBS_NORMAL) : RBS_DISABLED, &pRects[1], NULL);
- if(nBtn == -1 || nBtn == 2)
- m_pfnDrawThemeBackground(m_hTheme, dc, WP_MDIMINBUTTON, m_bParentActive ? ((m_nBtnPressed == 2) ? MINBS_PUSHED : MINBS_NORMAL) : MINBS_DISABLED, &pRects[2], NULL);
+#endif // __VSSYM32_H__
+ if((nBtn == -1) || (nBtn == 0))
+ ::DrawThemeBackground(m_hTheme, dc, WP_MDICLOSEBUTTON, this->m_bParentActive ? ((m_nBtnPressed == 0) ? CBS_PUSHED : CBS_NORMAL) : CBS_DISABLED, &pRects[0], NULL);
+ if((nBtn == -1) || (nBtn == 1))
+ ::DrawThemeBackground(m_hTheme, dc, WP_MDIRESTOREBUTTON, this->m_bParentActive ? ((m_nBtnPressed == 1) ? RBS_PUSHED : RBS_NORMAL) : RBS_DISABLED, &pRects[1], NULL);
+ if((nBtn == -1) || (nBtn == 2))
+ ::DrawThemeBackground(m_hTheme, dc, WP_MDIMINBUTTON, this->m_bParentActive ? ((m_nBtnPressed == 2) ? MINBS_PUSHED : MINBS_NORMAL) : MINBS_DISABLED, &pRects[2], NULL);
}
else
-#endif // !_WTL_NO_AUTO_THEME
{
- if(nBtn == -1 || nBtn == 0)
+ if((nBtn == -1) || (nBtn == 0))
dc.DrawFrameControl(&pRects[0], DFC_CAPTION, DFCS_CAPTIONCLOSE | ((m_nBtnPressed == 0) ? DFCS_PUSHED : 0));
- if(nBtn == -1 || nBtn == 1)
+ if((nBtn == -1) || (nBtn == 1))
dc.DrawFrameControl(&pRects[1], DFC_CAPTION, DFCS_CAPTIONRESTORE | ((m_nBtnPressed == 1) ? DFCS_PUSHED : 0));
- if(nBtn == -1 || nBtn == 2)
+ if((nBtn == -1) || (nBtn == 2))
dc.DrawFrameControl(&pRects[2], DFC_CAPTION, DFCS_CAPTIONMIN | ((m_nBtnPressed == 2) ? DFCS_PUSHED : 0));
}
}
-#ifndef _WTL_NO_AUTO_THEME
static UINT _GetThemeChangedMsg()
{
#ifndef WM_THEMECHANGED
@@ -4109,37 +3955,25 @@ class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBas
void _OpenThemeData()
{
- ATLASSERT(m_hThemeDLL != NULL);
-
- PFN_OpenThemeData pfnOpenThemeData = (PFN_OpenThemeData)::GetProcAddress(m_hThemeDLL, "OpenThemeData");
- ATLASSERT(pfnOpenThemeData != NULL);
- if(pfnOpenThemeData != NULL)
- m_hTheme = pfnOpenThemeData(m_hWnd, L"Window");
+ if(RunTimeHelper::IsThemeAvailable())
+ m_hTheme = ::OpenThemeData(this->m_hWnd, L"Window");
}
void _CloseThemeData()
{
- ATLASSERT(m_hThemeDLL != NULL);
-
- if(m_hTheme == NULL)
- return; // nothing to do
-
- PFN_CloseThemeData pfnCloseThemeData = (PFN_CloseThemeData)::GetProcAddress(m_hThemeDLL, "CloseThemeData");
- ATLASSERT(pfnCloseThemeData != NULL);
- if(pfnCloseThemeData != NULL)
+ if(m_hTheme != NULL)
{
- pfnCloseThemeData(m_hTheme);
+ ::CloseThemeData(m_hTheme);
m_hTheme = NULL;
}
}
-#endif // !_WTL_NO_AUTO_THEME
bool _DebugCheckChild()
{
#ifdef _DEBUG
BOOL bMaximized = FALSE;
HWND hWndChild = (HWND)::SendMessage(m_wndMDIClient, WM_MDIGETACTIVE, 0, (LPARAM)&bMaximized);
- return (bMaximized && hWndChild == m_hWndChildMaximized);
+ return (bMaximized && (hWndChild == m_hWndChildMaximized));
#else // !_DEBUG
return true;
#endif // !_DEBUG
diff --git a/thirdparty/wtl/atlctrlx.h b/thirdparty/wtl/atlctrlx.h
index dde1215..6aa9db5 100644
--- a/thirdparty/wtl/atlctrlx.h
+++ b/thirdparty/wtl/atlctrlx.h
@@ -1,13 +1,10 @@
-// Windows Template Library - WTL version 8.1
-// Copyright (C) Microsoft Corporation. All rights reserved.
+// Windows Template Library - WTL version 10.0
+// Copyright (C) Microsoft Corporation, WTL Team. 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/cpl1.0.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.
+// Microsoft Public License (http://opensource.org/licenses/MS-PL)
+// which can be found in the file MS-PL.txt at the root folder.
#ifndef __ATLCTRLX_H__
#define __ATLCTRLX_H__
@@ -22,10 +19,6 @@
#error atlctrlx.h requires atlctrls.h to be included first
#endif
-#ifndef WM_UPDATEUISTATE
- #define WM_UPDATEUISTATE 0x0128
-#endif // !WM_UPDATEUISTATE
-
///////////////////////////////////////////////////////////////////////////////
// Classes in this file:
@@ -54,18 +47,21 @@ namespace WTL
///////////////////////////////////////////////////////////////////////////////
// CBitmapButton - bitmap button implementation
-#ifndef _WIN32_WCE
-
// bitmap button extended styles
-#define BMPBTN_HOVER 0x00000001
-#define BMPBTN_AUTO3D_SINGLE 0x00000002
-#define BMPBTN_AUTO3D_DOUBLE 0x00000004
-#define BMPBTN_AUTOSIZE 0x00000008
-#define BMPBTN_SHAREIMAGELISTS 0x00000010
-#define BMPBTN_AUTOFIRE 0x00000020
+#define BMPBTN_HOVER 0x00000001
+#define BMPBTN_AUTO3D_SINGLE 0x00000002
+#define BMPBTN_AUTO3D_DOUBLE 0x00000004
+#define BMPBTN_AUTOSIZE 0x00000008
+#define BMPBTN_SHAREIMAGELISTS 0x00000010
+#define BMPBTN_AUTOFIRE 0x00000020
+#define BMPBTN_CHECK 0x00000040
+#define BMPBTN_AUTOCHECK 0x00000080
+
+// Note: BMPBTN_CHECK/BMPBTN_AUTOCHECK disables BN_DOUBLECLICKED,
+// BMPBTN_AUTOFIRE doesn't work with BMPBTN_CHECK/BMPBTN_AUTOCHECK
template
-class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinTraits>
+class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >
{
public:
DECLARE_WND_SUPERCLASS(NULL, TBase::GetWndClassName())
@@ -99,18 +95,24 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
unsigned m_fMouseOver:1;
unsigned m_fFocus:1;
unsigned m_fPressed:1;
+ unsigned m_fChecked:1;
// Constructor/Destructor
CBitmapButtonImpl(DWORD dwExtendedStyle = BMPBTN_AUTOSIZE, HIMAGELIST hImageList = NULL) :
- m_ImageList(hImageList), m_dwExtendedStyle(dwExtendedStyle),
- m_lpstrToolTipText(NULL),
- m_fMouseOver(0), m_fFocus(0), m_fPressed(0)
+ m_dwExtendedStyle(dwExtendedStyle), m_ImageList(hImageList),
+ m_lpstrToolTipText(NULL),
+ m_fMouseOver(0), m_fFocus(0), m_fPressed(0), m_fChecked(0)
{
m_nImage[_nImageNormal] = -1;
m_nImage[_nImagePushed] = -1;
m_nImage[_nImageFocusOrHover] = -1;
m_nImage[_nImageDisabled] = -1;
+
+#ifdef _DEBUG
+ if(((m_dwExtendedStyle & BMPBTN_AUTOFIRE) != 0) && IsCheckMode())
+ ATLTRACE2(atlTraceUI, 0, _T("CBitmapButtonImpl - Check mode and BMPBTN_AUTOFIRE cannot be used together, BMPBTN_AUTOFIRE will be ignored.\n"));
+#endif // _DEBUG
}
~CBitmapButtonImpl()
@@ -123,14 +125,13 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
// overridden to provide proper initialization
BOOL SubclassWindow(HWND hWnd)
{
-#if (_MSC_VER >= 1300)
- BOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits>::SubclassWindow(hWnd);
-#else // !(_MSC_VER >= 1300)
- typedef ATL::CWindowImpl< T, TBase, TWinTraits> _baseClass;
- BOOL bRet = _baseClass::SubclassWindow(hWnd);
-#endif // !(_MSC_VER >= 1300)
- if(bRet)
- Init();
+ BOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd);
+ if(bRet != FALSE)
+ {
+ T* pT = static_cast(this);
+ pT->Init();
+ }
+
return bRet;
}
@@ -147,6 +148,12 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
m_dwExtendedStyle = dwExtendedStyle;
else
m_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);
+
+#ifdef _DEBUG
+ if(((m_dwExtendedStyle & BMPBTN_AUTOFIRE) != 0) && IsCheckMode())
+ ATLTRACE2(atlTraceUI, 0, _T("CBitmapButtonImpl - Check mode and BMPBTN_AUTOFIRE cannot be used together, BMPBTN_AUTOFIRE will be ignored.\n"));
+#endif // _DEBUG
+
return dwPrevStyle;
}
@@ -159,8 +166,9 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
{
HIMAGELIST hImageListPrev = m_ImageList;
m_ImageList = hImageList;
- if((m_dwExtendedStyle & BMPBTN_AUTOSIZE) != 0 && ::IsWindow(m_hWnd))
+ if(((m_dwExtendedStyle & BMPBTN_AUTOSIZE) != 0) && ::IsWindow(this->m_hWnd))
SizeToImage();
+
return hImageListPrev;
}
@@ -175,9 +183,9 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
if(m_lpstrToolTipText == NULL)
return false;
- errno_t nRet = SecureHelper::strncpy_x(lpstrText, nLength, m_lpstrToolTipText, _TRUNCATE);
+ errno_t nRet = ATL::Checked::tcsncpy_s(lpstrText, nLength, m_lpstrToolTipText, _TRUNCATE);
- return (nRet == 0 || nRet == STRUNCATE);
+ return ((nRet == 0) || (nRet == STRUNCATE));
}
bool SetToolTipText(LPCTSTR lpstrText)
@@ -200,16 +208,32 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
if(m_lpstrToolTipText == NULL)
return false;
- SecureHelper::strcpy_x(m_lpstrToolTipText, cchLen, lpstrText);
+ ATL::Checked::tcscpy_s(m_lpstrToolTipText, cchLen, lpstrText);
if(m_tip.IsWindow())
{
m_tip.Activate(TRUE);
- m_tip.AddTool(m_hWnd, m_lpstrToolTipText);
+ m_tip.AddTool(this->m_hWnd, m_lpstrToolTipText);
}
return true;
}
+ bool GetCheck() const
+ {
+ return (m_fChecked == 1);
+ }
+
+ void SetCheck(bool bCheck, bool bUpdate = true)
+ {
+ m_fChecked = bCheck ? 1 : 0;
+
+ if(bUpdate)
+ {
+ this->Invalidate();
+ this->UpdateWindow();
+ }
+ }
+
// Operations
void SetImages(int nNormal, int nPushed = -1, int nFocusOrHover = -1, int nDisabled = -1)
{
@@ -225,12 +249,12 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
BOOL SizeToImage()
{
- ATLASSERT(::IsWindow(m_hWnd) && m_ImageList.m_hImageList != NULL);
+ ATLASSERT(::IsWindow(this->m_hWnd) && (m_ImageList.m_hImageList != NULL));
int cx = 0;
int cy = 0;
if(!m_ImageList.GetIconSize(cx, cy))
return FALSE;
- return ResizeClient(cx, cy);
+ return this->ResizeClient(cx, cy);
}
// Overrideables
@@ -240,35 +264,37 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
ATLASSERT(m_nImage[0] != -1); // main bitmap must be set
// set bitmap according to the current button state
- int nImage = -1;
bool bHover = IsHoverMode();
- if(!IsWindowEnabled())
+ bool bPressed = (m_fPressed == 1) || (IsCheckMode() && (m_fChecked == 1));
+ int nImage = -1;
+ if(!this->IsWindowEnabled())
nImage = m_nImage[_nImageDisabled];
- else if(m_fPressed == 1)
+ else if(bPressed)
nImage = m_nImage[_nImagePushed];
- else if((!bHover && m_fFocus == 1) || (bHover && m_fMouseOver == 1))
+ else if((!bHover && (m_fFocus == 1)) || (bHover && (m_fMouseOver == 1)))
nImage = m_nImage[_nImageFocusOrHover];
- if(nImage == -1) // not there, use default one
+
+ // if none is set, use default one
+ if(nImage == -1)
nImage = m_nImage[_nImageNormal];
// draw the button image
- int xyPos = 0;
- if((m_fPressed == 1) && ((m_dwExtendedStyle & (BMPBTN_AUTO3D_SINGLE | BMPBTN_AUTO3D_DOUBLE)) != 0) && (m_nImage[_nImagePushed] == -1))
- xyPos = 1;
+ bool bAuto3D = (m_dwExtendedStyle & (BMPBTN_AUTO3D_SINGLE | BMPBTN_AUTO3D_DOUBLE)) != 0;
+ int xyPos = (bPressed && bAuto3D && (m_nImage[_nImagePushed] == -1)) ? 1 : 0;
m_ImageList.Draw(dc, nImage, xyPos, xyPos, ILD_NORMAL);
// draw 3D border if required
- if((m_dwExtendedStyle & (BMPBTN_AUTO3D_SINGLE | BMPBTN_AUTO3D_DOUBLE)) != 0)
+ if(bAuto3D)
{
- RECT rect;
- GetClientRect(&rect);
+ RECT rect = { 0 };
+ this->GetClientRect(&rect);
- if(m_fPressed == 1)
+ if(bPressed)
dc.DrawEdge(&rect, ((m_dwExtendedStyle & BMPBTN_AUTO3D_SINGLE) != 0) ? BDR_SUNKENOUTER : EDGE_SUNKEN, BF_RECT);
- else if(!bHover || m_fMouseOver == 1)
+ else if(!bHover || (m_fMouseOver == 1))
dc.DrawEdge(&rect, ((m_dwExtendedStyle & BMPBTN_AUTO3D_SINGLE) != 0) ? BDR_RAISEDINNER : EDGE_RAISED, BF_RECT);
- if(!bHover && m_fFocus == 1)
+ if(!bHover && (m_fFocus == 1))
{
::InflateRect(&rect, -2 * ::GetSystemMetrics(SM_CXEDGE), -2 * ::GetSystemMetrics(SM_CYEDGE));
dc.DrawFocusRect(&rect);
@@ -301,7 +327,9 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
- Init();
+ T* pT = static_cast(this);
+ pT->Init();
+
bHandled = FALSE;
return 1;
}
@@ -319,7 +347,7 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
LRESULT OnMouseMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
- MSG msg = { m_hWnd, uMsg, wParam, lParam };
+ MSG msg = { this->m_hWnd, uMsg, wParam, lParam };
if(m_tip.IsWindow())
m_tip.RelayEvent(&msg);
bHandled = FALSE;
@@ -340,7 +368,7 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
}
else
{
- CPaintDC dc(m_hWnd);
+ CPaintDC dc(this->m_hWnd);
pT->DoPaint(dc.m_hDC);
}
return 0;
@@ -349,8 +377,8 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
LRESULT OnFocus(UINT uMsg, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
m_fFocus = (uMsg == WM_SETFOCUS) ? 1 : 0;
- Invalidate();
- UpdateWindow();
+ this->Invalidate();
+ this->UpdateWindow();
bHandled = FALSE;
return 1;
}
@@ -359,22 +387,22 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
{
LRESULT lRet = 0;
if(IsHoverMode())
- SetCapture();
+ this->SetCapture();
else
- lRet = DefWindowProc(uMsg, wParam, lParam);
- if(::GetCapture() == m_hWnd)
+ lRet = this->DefWindowProc(uMsg, wParam, lParam);
+ if(::GetCapture() == this->m_hWnd)
{
m_fPressed = 1;
- Invalidate();
- UpdateWindow();
+ this->Invalidate();
+ this->UpdateWindow();
}
- if((m_dwExtendedStyle & BMPBTN_AUTOFIRE) != 0)
+ if(((m_dwExtendedStyle & BMPBTN_AUTOFIRE) != 0) && !IsCheckMode())
{
int nElapse = 250;
int nDelay = 0;
if(::SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, &nDelay, 0))
nElapse += nDelay * 250; // all milli-seconds
- SetTimer(ID_TIMER_FIRST, nElapse);
+ this->SetTimer(ID_TIMER_FIRST, nElapse);
}
return lRet;
}
@@ -382,29 +410,31 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
LRESULT OnLButtonDblClk(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
LRESULT lRet = 0;
- if(!IsHoverMode())
- lRet = DefWindowProc(uMsg, wParam, lParam);
- if(::GetCapture() != m_hWnd)
- SetCapture();
+ if(!IsHoverMode() && !IsCheckMode())
+ lRet = this->DefWindowProc(uMsg, wParam, lParam);
+ if(::GetCapture() != this->m_hWnd)
+ this->SetCapture();
if(m_fPressed == 0)
{
m_fPressed = 1;
- Invalidate();
- UpdateWindow();
+ this->Invalidate();
+ this->UpdateWindow();
}
return lRet;
}
LRESULT OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
+ if(((m_dwExtendedStyle & BMPBTN_AUTOCHECK) != 0) && (m_fPressed == 1))
+ SetCheck(!GetCheck(), false);
+
LRESULT lRet = 0;
- bool bHover = IsHoverMode();
- if(!bHover)
- lRet = DefWindowProc(uMsg, wParam, lParam);
- if(::GetCapture() == m_hWnd)
+ if(!IsHoverMode() && !IsCheckMode())
+ lRet = this->DefWindowProc(uMsg, wParam, lParam);
+ if(::GetCapture() == this->m_hWnd)
{
- if(bHover && m_fPressed == 1)
- ::SendMessage(GetParent(), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), BN_CLICKED), (LPARAM)m_hWnd);
+ if((IsHoverMode() || IsCheckMode()) && (m_fPressed == 1))
+ this->GetParent().SendMessage(WM_COMMAND, MAKEWPARAM(this->GetDlgCtrlID(), BN_CLICKED), (LPARAM)this->m_hWnd);
::ReleaseCapture();
}
return lRet;
@@ -415,8 +445,8 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
if(m_fPressed == 1)
{
m_fPressed = 0;
- Invalidate();
- UpdateWindow();
+ this->Invalidate();
+ this->UpdateWindow();
}
bHandled = FALSE;
return 1;
@@ -424,33 +454,33 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
LRESULT OnEnable(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
- Invalidate();
- UpdateWindow();
+ this->Invalidate();
+ this->UpdateWindow();
bHandled = FALSE;
return 1;
}
LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
{
- if(::GetCapture() == m_hWnd)
+ if(::GetCapture() == this->m_hWnd)
{
POINT ptCursor = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
- ClientToScreen(&ptCursor);
+ this->ClientToScreen(&ptCursor);
RECT rect = { 0 };
- GetWindowRect(&rect);
+ this->GetWindowRect(&rect);
unsigned int uPressed = ::PtInRect(&rect, ptCursor) ? 1 : 0;
if(m_fPressed != uPressed)
{
m_fPressed = uPressed;
- Invalidate();
- UpdateWindow();
+ this->Invalidate();
+ this->UpdateWindow();
}
}
else if(IsHoverMode() && m_fMouseOver == 0)
{
m_fMouseOver = 1;
- Invalidate();
- UpdateWindow();
+ this->Invalidate();
+ this->UpdateWindow();
StartTrackMouseLeave();
}
bHandled = FALSE;
@@ -462,21 +492,21 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
if(m_fMouseOver == 1)
{
m_fMouseOver = 0;
- Invalidate();
- UpdateWindow();
+ this->Invalidate();
+ this->UpdateWindow();
}
return 0;
}
LRESULT OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)
{
- if(wParam == VK_SPACE && IsHoverMode())
+ if((wParam == VK_SPACE) && IsHoverMode())
return 0; // ignore if in hover mode
- if(wParam == VK_SPACE && m_fPressed == 0)
+ if((wParam == VK_SPACE) && (m_fPressed == 0))
{
m_fPressed = 1;
- Invalidate();
- UpdateWindow();
+ this->Invalidate();
+ this->UpdateWindow();
}
bHandled = FALSE;
return 1;
@@ -484,13 +514,15 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
LRESULT OnKeyUp(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)
{
- if(wParam == VK_SPACE && IsHoverMode())
+ if((wParam == VK_SPACE) && IsHoverMode())
return 0; // ignore if in hover mode
- if(wParam == VK_SPACE && m_fPressed == 1)
+ if((wParam == VK_SPACE) && (m_fPressed == 1))
{
m_fPressed = 0;
- Invalidate();
- UpdateWindow();
+ if((m_dwExtendedStyle & BMPBTN_AUTOCHECK) != 0)
+ SetCheck(!GetCheck(), false);
+ this->Invalidate();
+ this->UpdateWindow();
}
bHandled = FALSE;
return 1;
@@ -502,22 +534,22 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
switch(wParam) // timer ID
{
case ID_TIMER_FIRST:
- KillTimer(ID_TIMER_FIRST);
+ this->KillTimer(ID_TIMER_FIRST);
if(m_fPressed == 1)
{
- ::SendMessage(GetParent(), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), BN_CLICKED), (LPARAM)m_hWnd);
+ this->GetParent().SendMessage(WM_COMMAND, MAKEWPARAM(this->GetDlgCtrlID(), BN_CLICKED), (LPARAM)this->m_hWnd);
int nElapse = 250;
int nRepeat = 40;
if(::SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &nRepeat, 0))
nElapse = 10000 / (10 * nRepeat + 25); // milli-seconds, approximated
- SetTimer(ID_TIMER_REPEAT, nElapse);
+ this->SetTimer(ID_TIMER_REPEAT, nElapse);
}
break;
case ID_TIMER_REPEAT:
if(m_fPressed == 1)
- ::SendMessage(GetParent(), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), BN_CLICKED), (LPARAM)m_hWnd);
- else if(::GetCapture() != m_hWnd)
- KillTimer(ID_TIMER_REPEAT);
+ this->GetParent().SendMessage(WM_COMMAND, MAKEWPARAM(this->GetDlgCtrlID(), BN_CLICKED), (LPARAM)this->m_hWnd);
+ else if(::GetCapture() != this->m_hWnd)
+ this->KillTimer(ID_TIMER_REPEAT);
break;
default: // not our timer
break;
@@ -536,18 +568,18 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
void Init()
{
// We need this style to prevent Windows from painting the button
- ModifyStyle(0, BS_OWNERDRAW);
+ this->ModifyStyle(0, BS_OWNERDRAW);
// create a tool tip
- m_tip.Create(m_hWnd);
+ m_tip.Create(this->m_hWnd);
ATLASSERT(m_tip.IsWindow());
- if(m_tip.IsWindow() && m_lpstrToolTipText != NULL)
+ if(m_tip.IsWindow() && (m_lpstrToolTipText != NULL))
{
m_tip.Activate(TRUE);
- m_tip.AddTool(m_hWnd, m_lpstrToolTipText);
+ m_tip.AddTool(this->m_hWnd, m_lpstrToolTipText);
}
- if(m_ImageList.m_hImageList != NULL && (m_dwExtendedStyle & BMPBTN_AUTOSIZE) != 0)
+ if((m_ImageList.m_hImageList != NULL) && ((m_dwExtendedStyle & BMPBTN_AUTOSIZE) != 0))
SizeToImage();
}
@@ -556,14 +588,19 @@ class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinT
TRACKMOUSEEVENT tme = { 0 };
tme.cbSize = sizeof(tme);
tme.dwFlags = TME_LEAVE;
- tme.hwndTrack = m_hWnd;
- return _TrackMouseEvent(&tme);
+ tme.hwndTrack = this->m_hWnd;
+ return ::TrackMouseEvent(&tme);
}
bool IsHoverMode() const
{
return ((m_dwExtendedStyle & BMPBTN_HOVER) != 0);
}
+
+ bool IsCheckMode() const
+ {
+ return ((m_dwExtendedStyle & (BMPBTN_CHECK | BMPBTN_AUTOCHECK)) != 0);
+ }
};
class CBitmapButton : public CBitmapButtonImpl
@@ -576,8 +613,6 @@ class CBitmapButton : public CBitmapButtonImpl
{ }
};
-#endif // !_WIN32_WCE
-
///////////////////////////////////////////////////////////////////////////////
// CCheckListCtrlView - list view control with check boxes
@@ -605,7 +640,7 @@ class CCheckListViewCtrlImplTraits
typedef CCheckListViewCtrlImplTraits CCheckListViewCtrlTraits;
template
-class ATL_NO_VTABLE CCheckListViewCtrlImpl : public ATL::CWindowImpl
+class ATL_NO_VTABLE CCheckListViewCtrlImpl : public ATL::CWindowImpl
{
public:
DECLARE_WND_SUPERCLASS(NULL, TBase::GetWndClassName())
@@ -619,19 +654,13 @@ class ATL_NO_VTABLE CCheckListViewCtrlImpl : public ATL::CWindowImpl= 1300)
- BOOL bRet = ATL::CWindowImplBaseT< TBase, TWinTraits>::SubclassWindow(hWnd);
-#else // !(_MSC_VER >= 1300)
- typedef ATL::CWindowImplBaseT< TBase, TWinTraits> _baseClass;
- BOOL bRet = _baseClass::SubclassWindow(hWnd);
-#endif // !(_MSC_VER >= 1300)
- if(bRet)
+ BOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd);
+ if(bRet != FALSE)
{
T* pT = static_cast(this);
- pT;
- ATLASSERT((pT->GetExtendedLVStyle() & LVS_EX_CHECKBOXES) != 0);
- SetExtendedListViewStyle(pT->GetExtendedLVStyle());
+ pT->Init();
}
+
return bRet;
}
@@ -643,23 +672,32 @@ class ATL_NO_VTABLE CCheckListViewCtrlImpl : public ATL::CWindowImplGetItem(&lvi);
// if item is not selected, don't do anything
if(!(lvi.state & LVIS_SELECTED))
return;
// new check state will be reverse of the current state,
- BOOL bCheck = !GetCheckState(nCurrItem);
+ BOOL bCheck = !this->GetCheckState(nCurrItem);
int nItem = -1;
int nOldItem = -1;
- while((nItem = GetNextItem(nOldItem, LVNI_SELECTED)) != -1)
+ while((nItem = this->GetNextItem(nOldItem, LVNI_SELECTED)) != -1)
{
if(nItem != nCurrItem)
- SetCheckState(nItem, bCheck);
+ this->SetCheckState(nItem, bCheck);
nOldItem = nItem;
}
}
// Implementation
+ void Init()
+ {
+ T* pT = static_cast(this);
+ pT; // avoid level 4 warning
+ ATLASSERT((pT->GetExtendedLVStyle() & LVS_EX_CHECKBOXES) != 0);
+ this->SetExtendedListViewStyle(pT->GetExtendedLVStyle());
+ }
+
+// Message map and handlers
BEGIN_MSG_MAP(CCheckListViewCtrlImpl)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
@@ -670,11 +708,13 @@ class ATL_NO_VTABLE CCheckListViewCtrlImpl : public ATL::CWindowImpl(this);
- pT;
- ATLASSERT((pT->GetExtendedLVStyle() & LVS_EX_CHECKBOXES) != 0);
- SetExtendedListViewStyle(pT->GetExtendedLVStyle());
+ LRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);
+ if(lRet == 0)
+ {
+ T* pT = static_cast(this);
+ pT->Init();
+ }
+
return lRet;
}
@@ -683,7 +723,7 @@ class ATL_NO_VTABLE CCheckListViewCtrlImpl : public ATL::CWindowImpl= 0)
+ if((this->HitTest(&lvh) != -1) && (lvh.flags == LVHT_ONITEMSTATEICON) && (::GetKeyState(VK_CONTROL) >= 0))
{
T* pT = static_cast(this);
pT->CheckSelectedItems(lvh.iItem);
@@ -696,8 +736,8 @@ class ATL_NO_VTABLE CCheckListViewCtrlImpl : public ATL::CWindowImpl= 0)
+ int nCurrItem = this->GetNextItem(-1, LVNI_FOCUSED);
+ if((nCurrItem != -1) && (::GetKeyState(VK_CONTROL) >= 0))
{
T* pT = static_cast(this);
pT->CheckSelectedItems(nCurrItem);
@@ -718,40 +758,6 @@ class CCheckListViewCtrl : public CCheckListViewCtrlImpl
///////////////////////////////////////////////////////////////////////////////
// CHyperLink - hyper link control implementation
-#if (WINVER < 0x0500) && !defined(_WIN32_WCE)
-__declspec(selectany) struct
-{
- enum { cxWidth = 32, cyHeight = 32 };
- int xHotSpot;
- int yHotSpot;
- unsigned char arrANDPlane[cxWidth * cyHeight / 8];
- unsigned char arrXORPlane[cxWidth * cyHeight / 8];
-} _AtlHyperLink_CursorData =
-{
- 5, 0,
- {
- 0xF9, 0xFF, 0xFF, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF,
- 0xF0, 0xFF, 0xFF, 0xFF, 0xF0, 0x3F, 0xFF, 0xFF, 0xF0, 0x07, 0xFF, 0xFF, 0xF0, 0x01, 0xFF, 0xFF,
- 0xF0, 0x00, 0xFF, 0xFF, 0x10, 0x00, 0x7F, 0xFF, 0x00, 0x00, 0x7F, 0xFF, 0x00, 0x00, 0x7F, 0xFF,
- 0x80, 0x00, 0x7F, 0xFF, 0xC0, 0x00, 0x7F, 0xFF, 0xC0, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x7F, 0xFF,
- 0xE0, 0x00, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xF8, 0x01, 0xFF, 0xFF,
- 0xF8, 0x01, 0xFF, 0xFF, 0xF8, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
- },
- {
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0xC0, 0x00, 0x00, 0x06, 0xD8, 0x00, 0x00,
- 0x06, 0xDA, 0x00, 0x00, 0x06, 0xDB, 0x00, 0x00, 0x67, 0xFB, 0x00, 0x00, 0x77, 0xFF, 0x00, 0x00,
- 0x37, 0xFF, 0x00, 0x00, 0x17, 0xFF, 0x00, 0x00, 0x1F, 0xFF, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
- 0x0F, 0xFE, 0x00, 0x00, 0x07, 0xFE, 0x00, 0x00, 0x07, 0xFE, 0x00, 0x00, 0x03, 0xFC, 0x00, 0x00,
- 0x03, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- }
-};
-#endif // (WINVER < 0x0500) && !defined(_WIN32_WCE)
-
#define HLINK_UNDERLINED 0x00000000
#define HLINK_NOTUNDERLINED 0x00000001
#define HLINK_UNDERLINEHOVER 0x00000002
@@ -779,9 +785,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
HFONT m_hFontNormal;
RECT m_rcLink;
-#ifndef _WIN32_WCE
CToolTipCtrl m_tip;
-#endif // !_WIN32_WCE
COLORREF m_clrLink;
COLORREF m_clrVisited;
@@ -811,11 +815,6 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
{
delete [] m_lpstrLabel;
delete [] m_lpstrHyperLink;
-#if (WINVER < 0x0500) && !defined(_WIN32_WCE)
- // It was created, not loaded, so we have to destroy it
- if(m_hCursor != NULL)
- ::DestroyCursor(m_hCursor);
-#endif // (WINVER < 0x0500) && !defined(_WIN32_WCE)
}
// Attributes
@@ -842,7 +841,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
if(nLength <= lstrlen(m_lpstrLabel))
return false;
- SecureHelper::strcpy_x(lpstrBuffer, nLength, m_lpstrLabel);
+ ATL::Checked::tcscpy_s(lpstrBuffer, nLength, m_lpstrLabel);
return true;
}
@@ -856,12 +855,12 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
if(m_lpstrLabel == NULL)
return false;
- SecureHelper::strcpy_x(m_lpstrLabel, cchLen, lpstrLabel);
+ ATL::Checked::tcscpy_s(m_lpstrLabel, cchLen, lpstrLabel);
T* pT = static_cast(this);
pT->CalcLabelRect();
- if(m_hWnd != NULL)
- SetWindowText(lpstrLabel); // Set this for accessibility
+ if(this->m_hWnd != NULL)
+ this->SetWindowText(lpstrLabel); // Set this for accessibility
return true;
}
@@ -874,7 +873,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
if(nLength <= lstrlen(m_lpstrHyperLink))
return false;
- SecureHelper::strcpy_x(lpstrBuffer, nLength, m_lpstrHyperLink);
+ ATL::Checked::tcscpy_s(lpstrBuffer, nLength, m_lpstrHyperLink);
return true;
}
@@ -888,19 +887,19 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
if(m_lpstrHyperLink == NULL)
return false;
- SecureHelper::strcpy_x(m_lpstrHyperLink, cchLen, lpstrLink);
+ ATL::Checked::tcscpy_s(m_lpstrHyperLink, cchLen, lpstrLink);
if(m_lpstrLabel == NULL)
{
T* pT = static_cast(this);
pT->CalcLabelRect();
}
-#ifndef _WIN32_WCE
+
if(m_tip.IsWindow())
{
m_tip.Activate(TRUE);
- m_tip.AddTool(m_hWnd, m_lpstrHyperLink, &m_rcLink, 1);
+ m_tip.AddTool(this->m_hWnd, m_lpstrHyperLink, &m_rcLink, 1);
}
-#endif // !_WIN32_WCE
+
return true;
}
@@ -925,15 +924,15 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
int GetIdealHeight() const
{
- ATLASSERT(::IsWindow(m_hWnd));
- if(m_lpstrLabel == NULL && m_lpstrHyperLink == NULL)
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ if((m_lpstrLabel == NULL) && (m_lpstrHyperLink == NULL))
return -1;
if(!m_bPaintLabel)
return -1;
UINT uFormat = IsSingleLine() ? DT_SINGLELINE : DT_WORDBREAK;
- CClientDC dc(m_hWnd);
+ CClientDC dc(this->m_hWnd);
RECT rect = { 0 };
GetClientRect(&rect);
HFONT hFontOld = dc.SelectFont(m_hFontNormal);
@@ -943,7 +942,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
RECT rcLink = rect;
dc.DrawText(_T("NS"), -1, &rcLink, DT_LEFT | uFormat | DT_CALCRECT);
dc.SelectFont(hFontOld);
- return max(rcText.bottom - rcText.top, rcLink.bottom - rcLink.top);
+ return __max(rcText.bottom - rcText.top, rcLink.bottom - rcLink.top);
}
bool GetIdealSize(SIZE& size) const
@@ -960,13 +959,13 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
bool GetIdealSize(int& cx, int& cy) const
{
- ATLASSERT(::IsWindow(m_hWnd));
- if(m_lpstrLabel == NULL && m_lpstrHyperLink == NULL)
+ ATLASSERT(::IsWindow(this->m_hWnd));
+ if((m_lpstrLabel == NULL) && (m_lpstrHyperLink == NULL))
return false;
if(!m_bPaintLabel)
return false;
- CClientDC dc(m_hWnd);
+ CClientDC dc(this->m_hWnd);
RECT rcClient = { 0 };
GetClientRect(&rcClient);
RECT rcAll = rcClient;
@@ -1001,7 +1000,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
dc.SelectFont(hFontOld);
- int cyMax = max(rcLeft.bottom, max(rcLink.bottom, rcRight.bottom));
+ int cyMax = __max(rcLeft.bottom, __max(rcLink.bottom, rcRight.bottom));
::SetRect(&rcAll, rcLeft.left, rcLeft.top, rcRight.right, cyMax);
}
else
@@ -1054,54 +1053,44 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
// Operations
BOOL SubclassWindow(HWND hWnd)
{
- ATLASSERT(m_hWnd == NULL);
+ ATLASSERT(this->m_hWnd == NULL);
ATLASSERT(::IsWindow(hWnd));
if(m_hFontNormal == NULL)
m_hFontNormal = (HFONT)::SendMessage(hWnd, WM_GETFONT, 0, 0L);
-#if (_MSC_VER >= 1300)
- BOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits>::SubclassWindow(hWnd);
-#else // !(_MSC_VER >= 1300)
- typedef ATL::CWindowImpl< T, TBase, TWinTraits> _baseClass;
- BOOL bRet = _baseClass::SubclassWindow(hWnd);
-#endif // !(_MSC_VER >= 1300)
- if(bRet)
+
+ BOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd);
+ if(bRet != FALSE)
{
T* pT = static_cast(this);
pT->Init();
}
+
return bRet;
}
bool Navigate()
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
bool bRet = true;
if(IsNotifyButton())
{
- NMHDR nmhdr = { m_hWnd, GetDlgCtrlID(), NM_CLICK };
- ::SendMessage(GetParent(), WM_NOTIFY, GetDlgCtrlID(), (LPARAM)&nmhdr);
+ NMHDR nmhdr = { this->m_hWnd, (UINT_PTR)this->GetDlgCtrlID(), NM_CLICK };
+ this->GetParent().SendMessage(WM_NOTIFY, this->GetDlgCtrlID(), (LPARAM)&nmhdr);
}
else if(IsCommandButton())
{
- ::SendMessage(GetParent(), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), BN_CLICKED), (LPARAM)m_hWnd);
+ this->GetParent().SendMessage(WM_COMMAND, MAKEWPARAM(this->GetDlgCtrlID(), BN_CLICKED), (LPARAM)this->m_hWnd);
}
else
{
ATLASSERT(m_lpstrHyperLink != NULL);
-#ifndef _WIN32_WCE
DWORD_PTR dwRet = (DWORD_PTR)::ShellExecute(0, _T("open"), m_lpstrHyperLink, 0, 0, SW_SHOWNORMAL);
bRet = (dwRet > 32);
-#else // CE specific
- SHELLEXECUTEINFO shExeInfo = { sizeof(SHELLEXECUTEINFO), 0, 0, L"open", m_lpstrHyperLink, 0, 0, SW_SHOWNORMAL, 0, 0, 0, 0, 0, 0, 0 };
- ::ShellExecuteEx(&shExeInfo);
- DWORD_PTR dwRet = (DWORD_PTR)shExeInfo.hInstApp;
- bRet = (dwRet == 0) || (dwRet > 32);
-#endif // _WIN32_WCE
ATLASSERT(bRet);
if(bRet)
{
m_bVisited = true;
- Invalidate();
+ this->Invalidate();
}
}
return bRet;
@@ -1132,21 +1121,15 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
// Message map and handlers
BEGIN_MSG_MAP(CHyperLinkImpl)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
-#ifndef _WIN32_WCE
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
MESSAGE_RANGE_HANDLER(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseMessage)
-#endif // !_WIN32_WCE
MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)
MESSAGE_HANDLER(WM_PAINT, OnPaint)
-#ifndef _WIN32_WCE
MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)
-#endif // !_WIN32_WCE
MESSAGE_HANDLER(WM_SETFOCUS, OnFocus)
MESSAGE_HANDLER(WM_KILLFOCUS, OnFocus)
MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
-#ifndef _WIN32_WCE
MESSAGE_HANDLER(WM_MOUSELEAVE, OnMouseLeave)
-#endif // !_WIN32_WCE
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)
MESSAGE_HANDLER(WM_CHAR, OnChar)
@@ -1166,7 +1149,6 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
return 0;
}
-#ifndef _WIN32_WCE
LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
if(m_tip.IsWindow())
@@ -1195,13 +1177,12 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
LRESULT OnMouseMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
- MSG msg = { m_hWnd, uMsg, wParam, lParam };
+ MSG msg = { this->m_hWnd, uMsg, wParam, lParam };
if(m_tip.IsWindow() && IsUsingToolTip())
m_tip.RelayEvent(&msg);
bHandled = FALSE;
return 1;
}
-#endif // !_WIN32_WCE
LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
@@ -1224,7 +1205,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
}
else
{
- CPaintDC dc(m_hWnd);
+ CPaintDC dc(this->m_hWnd);
pT->DoEraseBackground(dc.m_hDC);
pT->DoPaint(dc.m_hDC);
}
@@ -1235,7 +1216,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
LRESULT OnFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
if(m_bPaintLabel)
- Invalidate();
+ this->Invalidate();
else
bHandled = FALSE;
return 0;
@@ -1244,7 +1225,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
{
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
- if((m_lpstrHyperLink != NULL || IsCommandButton()) && ::PtInRect(&m_rcLink, pt))
+ if(((m_lpstrHyperLink != NULL) || IsCommandButton()) && ::PtInRect(&m_rcLink, pt))
{
::SetCursor(m_hCursor);
if(IsUnderlineHover())
@@ -1252,11 +1233,9 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
if(!m_bHover)
{
m_bHover = true;
- InvalidateRect(&m_rcLink);
- UpdateWindow();
-#ifndef _WIN32_WCE
+ this->InvalidateRect(&m_rcLink);
+ this->UpdateWindow();
StartTrackMouseLeave();
-#endif // !_WIN32_WCE
}
}
}
@@ -1267,8 +1246,8 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
if(m_bHover)
{
m_bHover = false;
- InvalidateRect(&m_rcLink);
- UpdateWindow();
+ this->InvalidateRect(&m_rcLink);
+ this->UpdateWindow();
}
}
bHandled = FALSE;
@@ -1276,33 +1255,31 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
return 0;
}
-#ifndef _WIN32_WCE
LRESULT OnMouseLeave(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
if(IsUnderlineHover() && m_bHover)
{
m_bHover = false;
- InvalidateRect(&m_rcLink);
- UpdateWindow();
+ this->InvalidateRect(&m_rcLink);
+ this->UpdateWindow();
}
return 0;
}
-#endif // !_WIN32_WCE
LRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
{
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
if(::PtInRect(&m_rcLink, pt))
{
- SetFocus();
- SetCapture();
+ this->SetFocus();
+ this->SetCapture();
}
return 0;
}
LRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
{
- if(GetCapture() == m_hWnd)
+ if(GetCapture() == this->m_hWnd)
{
ReleaseCapture();
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
@@ -1317,7 +1294,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
LRESULT OnChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
- if(wParam == VK_RETURN || wParam == VK_SPACE)
+ if((wParam == VK_RETURN) || (wParam == VK_SPACE))
{
T* pT = static_cast(this);
pT->Navigate();
@@ -1334,8 +1311,8 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
{
POINT pt = { 0, 0 };
GetCursorPos(&pt);
- ScreenToClient(&pt);
- if((m_lpstrHyperLink != NULL || IsCommandButton()) && ::PtInRect(&m_rcLink, pt))
+ this->ScreenToClient(&pt);
+ if(((m_lpstrHyperLink != NULL) || IsCommandButton()) && ::PtInRect(&m_rcLink, pt))
{
return TRUE;
}
@@ -1345,8 +1322,8 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
LRESULT OnEnable(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
- Invalidate();
- UpdateWindow();
+ this->Invalidate();
+ this->UpdateWindow();
return 0;
}
@@ -1375,8 +1352,8 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
if((BOOL)lParam)
{
- Invalidate();
- UpdateWindow();
+ this->Invalidate();
+ this->UpdateWindow();
}
return 0;
@@ -1400,35 +1377,27 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
// Implementation
void Init()
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
// Check if we should paint a label
const int cchBuff = 8;
TCHAR szBuffer[cchBuff] = { 0 };
- if(::GetClassName(m_hWnd, szBuffer, cchBuff))
+ if(::GetClassName(this->m_hWnd, szBuffer, cchBuff))
{
if(lstrcmpi(szBuffer, _T("static")) == 0)
{
- ModifyStyle(0, SS_NOTIFY); // we need this
- DWORD dwStyle = GetStyle() & 0x000000FF;
-#ifndef _WIN32_WCE
- if(dwStyle == SS_ICON || dwStyle == SS_BLACKRECT || dwStyle == SS_GRAYRECT ||
- dwStyle == SS_WHITERECT || dwStyle == SS_BLACKFRAME || dwStyle == SS_GRAYFRAME ||
- dwStyle == SS_WHITEFRAME || dwStyle == SS_OWNERDRAW ||
- dwStyle == SS_BITMAP || dwStyle == SS_ENHMETAFILE)
-#else // CE specific
- if(dwStyle == SS_ICON || dwStyle == SS_BITMAP)
-#endif // _WIN32_WCE
+ this->ModifyStyle(0, SS_NOTIFY); // we need this
+ DWORD dwStyle = this->GetStyle() & 0x000000FF;
+ if((dwStyle == SS_ICON) || (dwStyle == SS_BLACKRECT) || (dwStyle == SS_GRAYRECT) ||
+ (dwStyle == SS_WHITERECT) || (dwStyle == SS_BLACKFRAME) || (dwStyle == SS_GRAYFRAME) ||
+ (dwStyle == SS_WHITEFRAME) || (dwStyle == SS_OWNERDRAW) ||
+ (dwStyle == SS_BITMAP) || (dwStyle == SS_ENHMETAFILE))
m_bPaintLabel = false;
}
}
// create or load a cursor
-#if (WINVER >= 0x0500) || defined(_WIN32_WCE)
m_hCursor = ::LoadCursor(NULL, IDC_HAND);
-#else
- m_hCursor = ::CreateCursor(ModuleHelper::GetModuleInstance(), _AtlHyperLink_CursorData.xHotSpot, _AtlHyperLink_CursorData.yHotSpot, _AtlHyperLink_CursorData.cxWidth, _AtlHyperLink_CursorData.cyHeight, _AtlHyperLink_CursorData.arrANDPlane, _AtlHyperLink_CursorData.arrXORPlane);
-#endif
ATLASSERT(m_hCursor != NULL);
// set fonts
@@ -1444,21 +1413,19 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
CreateLinkFontFromNormal();
}
-#ifndef _WIN32_WCE
// create a tool tip
- m_tip.Create(m_hWnd);
+ m_tip.Create(this->m_hWnd);
ATLASSERT(m_tip.IsWindow());
-#endif // !_WIN32_WCE
// set label (defaults to window text)
if(m_lpstrLabel == NULL)
{
- int nLen = GetWindowTextLength();
+ int nLen = this->GetWindowTextLength();
if(nLen > 0)
{
ATLTRY(m_lpstrLabel = new TCHAR[nLen + 1]);
if(m_lpstrLabel != NULL)
- ATLVERIFY(GetWindowText(m_lpstrLabel, nLen + 1) > 0);
+ ATLVERIFY(this->GetWindowText(m_lpstrLabel, nLen + 1) > 0);
}
}
@@ -1466,23 +1433,21 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
pT->CalcLabelRect();
// set hyperlink (defaults to label), or just activate tool tip if already set
- if(m_lpstrHyperLink == NULL && !IsCommandButton())
+ if((m_lpstrHyperLink == NULL) && !IsCommandButton())
{
if(m_lpstrLabel != NULL)
SetHyperLink(m_lpstrLabel);
}
-#ifndef _WIN32_WCE
else
{
m_tip.Activate(TRUE);
- m_tip.AddTool(m_hWnd, m_lpstrHyperLink, &m_rcLink, 1);
+ m_tip.AddTool(this->m_hWnd, m_lpstrHyperLink, &m_rcLink, 1);
}
-#endif // !_WIN32_WCE
// set link colors
if(m_bPaintLabel)
{
- CRegKeyEx rk;
+ ATL::CRegKey rk;
LONG lRet = rk.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Internet Explorer\\Settings"));
if(lRet == ERROR_SUCCESS)
{
@@ -1522,7 +1487,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
if(*p == _T(','))
{
*p = _T('\0');
- c[i] = MinCrtHelper::_atoi(lpstr);
+ c[i] = _ttoi(lpstr);
lpstr = &p[1];
break;
}
@@ -1532,21 +1497,21 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
}
if(*lpstr == _T('\0'))
return CLR_INVALID;
- c[2] = MinCrtHelper::_atoi(lpstr);
+ c[2] = _ttoi(lpstr);
return RGB(c[0], c[1], c[2]);
}
bool CalcLabelRect()
{
- if(!::IsWindow(m_hWnd))
+ if(!::IsWindow(this->m_hWnd))
return false;
- if(m_lpstrLabel == NULL && m_lpstrHyperLink == NULL)
+ if((m_lpstrLabel == NULL) && (m_lpstrHyperLink == NULL))
return false;
- CClientDC dc(m_hWnd);
+ CClientDC dc(this->m_hWnd);
RECT rcClient = { 0 };
- GetClientRect(&rcClient);
+ this->GetClientRect(&rcClient);
m_rcLink = rcClient;
if(!m_bPaintLabel)
return true;
@@ -1591,7 +1556,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
if(m_hFontLink != NULL)
hOldFont = dc.SelectFont(m_hFontLink);
LPTSTR lpstrText = (m_lpstrLabel != NULL) ? m_lpstrLabel : m_lpstrHyperLink;
- DWORD dwStyle = GetStyle();
+ DWORD dwStyle = this->GetStyle();
UINT uFormat = DT_LEFT;
if (dwStyle & SS_CENTER)
uFormat = DT_CENTER;
@@ -1665,11 +1630,11 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
void DoEraseBackground(CDCHandle dc)
{
- HBRUSH hBrush = (HBRUSH)::SendMessage(GetParent(), WM_CTLCOLORSTATIC, (WPARAM)dc.m_hDC, (LPARAM)m_hWnd);
+ HBRUSH hBrush = (HBRUSH)this->GetParent().SendMessage(WM_CTLCOLORSTATIC, (WPARAM)dc.m_hDC, (LPARAM)this->m_hWnd);
if(hBrush != NULL)
{
RECT rect = { 0 };
- GetClientRect(&rect);
+ this->GetClientRect(&rect);
dc.FillRect(&rect, hBrush);
}
}
@@ -1691,7 +1656,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
// get label part rects
RECT rcClient = { 0 };
- GetClientRect(&rcClient);
+ this->GetClientRect(&rcClient);
dc.SetBkMode(TRANSPARENT);
HFONT hFontOld = dc.SelectFont(m_hFontNormal);
@@ -1701,8 +1666,8 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
if(lpstrLeft != NULL)
dc.DrawText(lpstrLeft, cchLeft, &rcClient, DT_LEFT | uFormat);
- COLORREF clrOld = dc.SetTextColor(IsWindowEnabled() ? (m_bVisited ? m_clrVisited : m_clrLink) : (::GetSysColor(COLOR_GRAYTEXT)));
- if(m_hFontLink != NULL && (!IsUnderlineHover() || (IsUnderlineHover() && m_bHover)))
+ COLORREF clrOld = dc.SetTextColor(this->IsWindowEnabled() ? (m_bVisited ? m_clrVisited : m_clrLink) : (::GetSysColor(COLOR_GRAYTEXT)));
+ if((m_hFontLink != NULL) && (!IsUnderlineHover() || (IsUnderlineHover() && m_bHover)))
dc.SelectFont(m_hFontLink);
else
dc.SelectFont(m_hFontNormal);
@@ -1717,7 +1682,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
dc.DrawText(lpstrRight, cchRight, &rcRight, DT_LEFT | uFormat);
}
- if(GetFocus() == m_hWnd)
+ if(GetFocus() == this->m_hWnd)
dc.DrawFocusRect(&m_rcLink);
dc.SelectFont(hFontOld);
@@ -1725,17 +1690,17 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
else
{
dc.SetBkMode(TRANSPARENT);
- COLORREF clrOld = dc.SetTextColor(IsWindowEnabled() ? (m_bVisited ? m_clrVisited : m_clrLink) : (::GetSysColor(COLOR_GRAYTEXT)));
+ COLORREF clrOld = dc.SetTextColor(this->IsWindowEnabled() ? (m_bVisited ? m_clrVisited : m_clrLink) : (::GetSysColor(COLOR_GRAYTEXT)));
HFONT hFontOld = NULL;
- if(m_hFontLink != NULL && (!IsUnderlineHover() || (IsUnderlineHover() && m_bHover)))
+ if((m_hFontLink != NULL) && (!IsUnderlineHover() || (IsUnderlineHover() && m_bHover)))
hFontOld = dc.SelectFont(m_hFontLink);
else
hFontOld = dc.SelectFont(m_hFontNormal);
LPTSTR lpstrText = (m_lpstrLabel != NULL) ? m_lpstrLabel : m_lpstrHyperLink;
- DWORD dwStyle = GetStyle();
+ DWORD dwStyle = this->GetStyle();
UINT uFormat = DT_LEFT;
if (dwStyle & SS_CENTER)
uFormat = DT_CENTER;
@@ -1745,7 +1710,7 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
dc.DrawText(lpstrText, -1, &m_rcLink, uFormat);
- if(GetFocus() == m_hWnd)
+ if(GetFocus() == this->m_hWnd)
dc.DrawFocusRect(&m_rcLink);
dc.SetTextColor(clrOld);
@@ -1753,16 +1718,14 @@ class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTrai
}
}
-#ifndef _WIN32_WCE
BOOL StartTrackMouseLeave()
{
TRACKMOUSEEVENT tme = { 0 };
tme.cbSize = sizeof(tme);
tme.dwFlags = TME_LEAVE;
- tme.hwndTrack = m_hWnd;
- return _TrackMouseEvent(&tme);
+ tme.hwndTrack = this->m_hWnd;
+ return ::TrackMouseEvent(&tme);
}
-#endif // !_WIN32_WCE
// Implementation helpers
bool IsUnderlined() const
@@ -1892,9 +1855,7 @@ class CCustomWaitCursor : public CWaitCursor
~CCustomWaitCursor()
{
Restore();
-#if !defined(_WIN32_WCE) || ((_WIN32_WCE >= 0x400) && !(defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)))
::DestroyCursor(m_hWaitCursor);
-#endif // !defined(_WIN32_WCE) || ((_WIN32_WCE >= 0x400) && !(defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)))
}
};
@@ -1926,12 +1887,7 @@ class ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TB
// Methods
HWND Create(HWND hWndParent, LPCTSTR lpstrText, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP, UINT nID = ATL_IDW_STATUS_BAR)
{
-#if (_MSC_VER >= 1300)
return ATL::CWindowImpl< T, TBase >::Create(hWndParent, rcDefault, lpstrText, dwStyle, 0, nID);
-#else // !(_MSC_VER >= 1300)
- typedef ATL::CWindowImpl< T, TBase > _baseClass;
- return _baseClass::Create(hWndParent, rcDefault, lpstrText, dwStyle, 0, nID);
-#endif // !(_MSC_VER >= 1300)
}
HWND Create(HWND hWndParent, UINT nTextID = ATL_IDS_IDLEMESSAGE, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP, UINT nID = ATL_IDW_STATUS_BAR)
@@ -1944,7 +1900,7 @@ class ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TB
BOOL SetPanes(int* pPanes, int nPanes, bool bSetText = true)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(nPanes > 0);
m_nPanes = nPanes;
@@ -1956,21 +1912,21 @@ class ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TB
if(m_pPane == NULL)
return FALSE;
- CTempBuffer buff;
+ ATL::CTempBuffer buff;
int* pPanesPos = buff.Allocate(nPanes);
ATLASSERT(pPanesPos != NULL);
if(pPanesPos == NULL)
return FALSE;
- SecureHelper::memcpy_x(m_pPane, nPanes * sizeof(int), pPanes, nPanes * sizeof(int));
+ ATL::Checked::memcpy_s(m_pPane, nPanes * sizeof(int), pPanes, nPanes * sizeof(int));
// get status bar DC and set font
- CClientDC dc(m_hWnd);
+ CClientDC dc(this->m_hWnd);
HFONT hOldFont = dc.SelectFont(GetFont());
// get status bar borders
int arrBorders[3] = { 0 };
- GetBorders(arrBorders);
+ this->GetBorders(arrBorders);
const int cchBuff = 128;
TCHAR szBuff[cchBuff] = { 0 };
@@ -1996,7 +1952,7 @@ class ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TB
cxLeft = pPanesPos[i];
}
- BOOL bRet = SetParts(nPanes, pPanesPos);
+ BOOL bRet = this->SetParts(nPanes, pPanesPos);
if(bRet && bSetText)
{
@@ -2016,12 +1972,12 @@ class ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TB
bool GetPaneTextLength(int nPaneID, int* pcchLength = NULL, int* pnType = NULL) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
int nIndex = GetPaneIndexFromID(nPaneID);
if(nIndex == -1)
return false;
- int nLength = GetTextLength(nIndex, pnType);
+ int nLength = this->GetTextLength(nIndex, pnType);
if(pcchLength != NULL)
*pcchLength = nLength;
@@ -2030,12 +1986,12 @@ class ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TB
BOOL GetPaneText(int nPaneID, LPTSTR lpstrText, int* pcchLength = NULL, int* pnType = NULL) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
int nIndex = GetPaneIndexFromID(nPaneID);
if(nIndex == -1)
return FALSE;
- int nLength = GetText(nIndex, lpstrText, pnType);
+ int nLength = this->GetText(nIndex, lpstrText, pnType);
if(pcchLength != NULL)
*pcchLength = nLength;
@@ -2044,38 +2000,38 @@ class ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TB
BOOL SetPaneText(int nPaneID, LPCTSTR lpstrText, int nType = 0)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
int nIndex = GetPaneIndexFromID(nPaneID);
if(nIndex == -1)
return FALSE;
- return SetText(nIndex, lpstrText, nType);
+ return this->SetText(nIndex, lpstrText, nType);
}
BOOL GetPaneRect(int nPaneID, LPRECT lpRect) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
int nIndex = GetPaneIndexFromID(nPaneID);
if(nIndex == -1)
return FALSE;
- return GetRect(nIndex, lpRect);
+ return this->GetRect(nIndex, lpRect);
}
BOOL SetPaneWidth(int nPaneID, int cxWidth)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
ATLASSERT(nPaneID != ID_DEFAULT_PANE); // Can't resize this one
int nIndex = GetPaneIndexFromID(nPaneID);
if(nIndex == -1)
return FALSE;
// get pane positions
- CTempBuffer buff;
+ ATL::CTempBuffer buff;
int* pPanesPos = buff.Allocate(m_nPanes);
if(pPanesPos == NULL)
return FALSE;
- GetParts(m_nPanes, pPanesPos);
+ this->GetParts(m_nPanes, pPanesPos);
// calculate offset
int cxPaneWidth = pPanesPos[nIndex] - ((nIndex == 0) ? 0 : pPanesPos[nIndex - 1]);
int cxOff = cxWidth - cxPaneWidth;
@@ -2102,55 +2058,51 @@ class ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TB
pPanesPos[i] -= cxOff;
}
// set pane postions
- return SetParts(m_nPanes, pPanesPos);
+ return this->SetParts(m_nPanes, pPanesPos);
}
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
BOOL GetPaneTipText(int nPaneID, LPTSTR lpstrText, int nSize) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
int nIndex = GetPaneIndexFromID(nPaneID);
if(nIndex == -1)
return FALSE;
- GetTipText(nIndex, lpstrText, nSize);
+ this->GetTipText(nIndex, lpstrText, nSize);
return TRUE;
}
BOOL SetPaneTipText(int nPaneID, LPCTSTR lpstrText)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
int nIndex = GetPaneIndexFromID(nPaneID);
if(nIndex == -1)
return FALSE;
- SetTipText(nIndex, lpstrText);
+ this->SetTipText(nIndex, lpstrText);
return TRUE;
}
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
-#if ((_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 0x0500))
BOOL GetPaneIcon(int nPaneID, HICON& hIcon) const
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
int nIndex = GetPaneIndexFromID(nPaneID);
if(nIndex == -1)
return FALSE;
- hIcon = GetIcon(nIndex);
+ hIcon = this->GetIcon(nIndex);
return TRUE;
}
BOOL SetPaneIcon(int nPaneID, HICON hIcon)
{
- ATLASSERT(::IsWindow(m_hWnd));
+ ATLASSERT(::IsWindow(this->m_hWnd));
int nIndex = GetPaneIndexFromID(nPaneID);
if(nIndex == -1)
return FALSE;
- return SetIcon(nIndex, hIcon);
+ return this->SetIcon(nIndex, hIcon);
}
-#endif // ((_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 0x0500))
// Message map and handlers
BEGIN_MSG_MAP(CMultiPaneStatusBarCtrlImpl< T >)
@@ -2159,8 +2111,8 @@ class ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TB
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
- LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);
- if(wParam != SIZE_MINIMIZED && m_nPanes > 0)
+ LRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);
+ if((wParam != SIZE_MINIMIZED) && (m_nPanes > 0))
{
T* pT = static_cast(this);
pT->UpdatePanesLayout();
@@ -2172,24 +2124,22 @@ class ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TB
BOOL UpdatePanesLayout()
{
// get pane positions
- CTempBuffer buff;
+ ATL::CTempBuffer buff;
int* pPanesPos = buff.Allocate(m_nPanes);
ATLASSERT(pPanesPos != NULL);
if(pPanesPos == NULL)
return FALSE;
- int nRet = GetParts(m_nPanes, pPanesPos);
+ int nRet = this->GetParts(m_nPanes, pPanesPos);
ATLASSERT(nRet == m_nPanes);
if(nRet != m_nPanes)
return FALSE;
// calculate offset
RECT rcClient = { 0 };
- GetClientRect(&rcClient);
+ this->GetClientRect(&rcClient);
int cxOff = rcClient.right - pPanesPos[m_nPanes - 1];
-#ifndef _WIN32_WCE
// Move panes left if size grip box is present
- if((GetStyle() & SBARS_SIZEGRIP) != 0)
+ if((this->GetStyle() & SBARS_SIZEGRIP) != 0)
cxOff -= ::GetSystemMetrics(SM_CXVSCROLL) + ::GetSystemMetrics(SM_CXEDGE);
-#endif // !_WIN32_WCE
// find variable width pane
int i;
for(i = 0; i < m_nPanes; i++)
@@ -2204,7 +2154,7 @@ class ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TB
pPanesPos[i] += cxOff;
}
// set pane postions
- return SetParts(m_nPanes, pPanesPos);
+ return this->SetParts(m_nPanes, pPanesPos);
}
int GetPaneIndexFromID(int nPaneID) const
@@ -2230,10 +2180,14 @@ class CMultiPaneStatusBarCtrl : public CMultiPaneStatusBarCtrlImpl
class ATL_NO_VTABLE CPaneContainerImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >, public CCustomDraw< T >
@@ -2293,7 +2247,7 @@ class ATL_NO_VTABLE CPaneContainerImpl : public ATL::CWindowImpl< T, TBase, TWin
m_dwExtendedStyle = dwExtendedStyle;
else
m_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);
- if(m_hWnd != NULL)
+ if(this->m_hWnd != NULL)
{
T* pT = static_cast(this);
bool bUpdate = false;
@@ -2321,6 +2275,12 @@ class ATL_NO_VTABLE CPaneContainerImpl : public ATL::CWindowImpl< T, TBase, TWin
bUpdate = true;
}
+#ifndef _ATL_NO_MSIMG
+ if((dwPrevStyle & PANECNT_GRADIENT) != (m_dwExtendedStyle & PANECNT_GRADIENT)) // change background
+ {
+ bUpdate = true;
+ }
+#endif
if(bUpdate)
pT->UpdateLayout();
}
@@ -2336,7 +2296,7 @@ class ATL_NO_VTABLE CPaneContainerImpl : public ATL::CWindowImpl< T, TBase, TWin
{
HWND hWndOldClient = m_wndClient;
m_wndClient = hWndClient;
- if(m_hWnd != NULL)
+ if(this->m_hWnd != NULL)
{
T* pT = static_cast