--- mstools/mfc/include/afxnt.h 2018/08/09 18:21:00 1.1 +++ mstools/mfc/include/afxnt.h 2018/08/09 18:25:02 1.1.1.3 @@ -1,69 +1,52 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + #ifndef WINVER #error Please do not include this file independently, #include #endif - -/* WM_CTLCOLOR for 16 bit API compatability */ +// WM_CTLCOLOR for 16 bit API compatability. #define WM_CTLCOLOR 0x0019 -#define CTLCOLOR_MSGBOX 0 -#define CTLCOLOR_EDIT 1 -#define CTLCOLOR_LISTBOX 2 -#define CTLCOLOR_BTN 3 -#define CTLCOLOR_DLG 4 -#define CTLCOLOR_SCROLLBAR 5 -#define CTLCOLOR_STATIC 6 +// We emulate HTASK for compatibility, even though Win32 has no notion of it. +DECLARE_HANDLE(HTASK); -////////////////////////////////////////////////////////////////////////////// -// NOTE: -// The remaining declarations and definitions will not be present in -// the final product. These are a required because of textual inconsistencies -// in the Windows NT interface files. Please ignore these. +// Windows NT uses macros to stub these out, which breaks C++ code. +#undef GetSysModalWindow +inline HWND GetSysModalWindow(void) + { return NULL;} -extern "C" -{ -BOOL WINAPI SubtractRect(RECT FAR*, const RECT FAR*, const RECT FAR*); -BOOL WINAPI QueryAbort(HDC, int); -} -DECLARE_HANDLE(HTASK); -#define HMODULE HINSTANCE /* HMODULE can be used in place of HINSTANCE */ +#undef SetSysModalWindow +inline HWND SetSysModalWindow(HWND) + { return NULL; } -/* EnableScrollBar() flags */ -#ifndef ESB_ENABLE_BOTH -#define ESB_ENABLE_BOTH 0x0000 -#define ESB_DISABLE_BOTH 0x0003 -#define ESB_DISABLE_LEFT 0x0001 -#define ESB_DISABLE_RIGHT 0x0002 -#define ESB_DISABLE_UP 0x0001 -#define ESB_DISABLE_DOWN 0x0002 -#define ESB_DISABLE_LTUP ESB_DISABLE_LEFT -#define ESB_DISABLE_RTDN ESB_DISABLE_RIGHT -#endif +// Windows NT uses macros with parameters for these, which breaks C++ code. -/* Class field offsets for GetClassLong() and GetClassWord() */ -#ifndef GCW_HBRBACKGROUND -#define GCW_HBRBACKGROUND GCL_HBRBACKGROUND -#define GCW_HCURSOR GCL_HCURSOR -#define GCW_HICON GCL_HICON -#define GCW_HMODULE GCL_HMODULE -#define GCW_CBWNDEXTRA GCL_CBWNDEXTRA -#define GCW_CBCLSEXTRA GCL_CBCLSEXTRA -#define GCW_STYLE GCL_STYLE -#endif +#undef GetNextWindow +inline HWND GetNextWindow(HWND hWnd, UINT uFlag) + { return ::GetWindow(hWnd, uFlag); } -/* Window field offsets for GetWindowLong() and GetWindowWord() */ -#ifndef GWW_WNDPROC -#define GWW_WNDPROC GWL_WNDPROC -#define GWW_HINSTANCE GWL_HINSTANCE -#define GWW_HWNDPARENT GWL_HWNDPARENT -#define GWW_STYLE GWL_STYLE -#define GWW_EXSTYLE GWL_EXSTYLE -#define GWW_ID GWL_ID +#undef MessageBox +inline int MessageBox(HWND hWnd, LPCSTR lpText, LPCSTR lpTitle, UINT fuStyle) +#ifdef UNICODE + { return ::MessageBoxExW(hWnd, lpText, lpTitle, fuStyle, 0); } +#else + { return ::MessageBoxExA(hWnd, lpText, lpTitle, fuStyle, 0); } #endif +// These are necessary because WINDOWS.H is not included consistently +// when the CString class is defined, but is included when the CString +// class is implemented. #undef LoadString -inline int LoadString(HINSTANCE hInstance, UINT uID, +inline int LoadString(HINSTANCE hInstance, UINT uID, LPSTR lpBuffer, int nBufferMax) #ifdef UNICODE { return ::LoadStringW(hInstance, uID, lpBuffer, nBufferMax); } @@ -79,47 +62,17 @@ inline BOOL AnsiToOem(LPCSTR lpcstr, LPS inline BOOL OemToAnsi(LPCSTR lpcstr, LPSTR lpstr) { return ::OemToCharA(lpcstr, lpstr); } -#undef GetSysModalWindow -inline HWND GetSysModalWindow(void) - { return NULL;} - -#undef SetSysModalWindow -inline HWND SetSysModalWindow(HWND) - { return NULL; } - -#undef GetNextWindow -inline HWND GetNextWindow(HWND hWnd, UINT uFlag) - { return ::GetWindow(hWnd, uFlag); } +////////////////////////////////////////////////////////////////////////////// +// NOTE: +// The remaining declarations and definitions will not be present in +// the final product. These are a required because of textual inconsistencies +// in the Windows NT interface files. Please ignore these. -#undef MessageBox -inline int MessageBox(HWND hWnd, LPCSTR lpText, LPCSTR lpTitle, UINT fuStyle) -#ifdef UNICODE - { return ::MessageBoxExW(hWnd, lpText, lpTitle, fuStyle, 0); } -#else - { return ::MessageBoxExA(hWnd, lpText, lpTitle, fuStyle, 0); } -#endif +//REVIEW_NT: maybe someday NT will add these to their headers! -#undef RegQueryValue -inline LONG RegQueryValue(HKEY hKey, LPCSTR lpSubKey, - LPSTR lpValue, LONG FAR* lpcbValue ) -#ifdef UNICODE - { return ::RegQueryValueW(hKey, (LPWSTR)lpSubKey, lpValue, - (LPDWORD)lpcbValue); } -#else - { return ::RegQueryValueA(hKey, (LPSTR)lpSubKey, lpValue, - (LPDWORD)lpcbValue); } -#endif // !UNICODE - -#undef RegSetValue -inline LONG RegSetValue(HKEY hKey, LPCSTR lpSubKey, DWORD dwType, - LPCSTR lpData, DWORD cbData ) -#ifdef UNICODE - { return ::RegSetValueW(hKey, (LPWSTR)lpSubKey, dwType, - (LPSTR)lpData, cbData); } -#else - { return ::RegSetValueA(hKey, (LPSTR)lpSubKey, dwType, - (LPSTR)lpData, cbData); } -#endif // !UNICODE +extern "C" +{ +BOOL WINAPI SubtractRect(RECT FAR*, const RECT FAR*, const RECT FAR*); +} -#undef GetCurrentTime -// inline function declared and defined in AFX.H +/////////////////////////////////////////////////////////////////////////////