Changes in WTL 9.0-atlapp.h

Source: Internet
Author: User

Suddenly found that WTL updated to 9.0.4140, then contrasted the 8.1.12085.

Let's see what the big changes are in Atlapp.h.

Line 61st:

#if defined (_sysinfoapi_h_) && defined (not_build_windows_deprecate) && (_win32_winnt >= 0x0501)  #include <VersionHelpers.h> #endif

XP and the system above can be used in VersionHelpers.h some of the more convenient tool functions to determine the Windows version, such as: Iswindowsxporgreater (), Iswindowsxpsp3orgreater (), Iswindows8orgreater (), while the VC2013 compile also warns that APIs such as GetVersionEx are obsolete, WTL 9 introduces these new APIs and overwrites the previous WTL version, such as:

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//_versionhe Lpers_h_included_}

  

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.DWMINORV Ersion >= 1)); #endif//_versionhelpers_h_included_}

  

Line 1165th:

Genericwndclass-generic window class usable for subclassing//with 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 =::D efwindowproc;wc.hinstance = Modulehelpe R::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 ()   //needed for DLLs or tmp Use{return:: Unregisterclass (GetName (), Modulehelper::getmodu Leinstance ());}; Namespace Genericwndclass

This is three new functions, see note know, is used for subclass and so on, have not seen how to use the specific. Comments in WTL author actually wrote a typo, hey.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.