⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stdhdrs.h

📁 早期的WINDOWS编程,适合刚接触WINDOWS编程的初学者
💻 H
字号:
//This is a header which should be pre-compiled
//This header has all the common header files which are used by OLE applications

//Use for strict definitions
#ifndef STRICT
#define STRICT
#endif

//Tells windows.h to include the OLE header files
//
#define INC_OLE2

//Required so that we wont use nameless unions, which Borland doesn't support
#ifdef __TURBOC__
#define NONAMELESSUNION
#endif

//For Win16 we want a Borland CLASS to be class huge and for
//other compilers we want CLASS to be class far
//

#ifndef CLASS
#ifdef __TURBOC__
#define CLASS class huge
#else
#define CLASS class far
#endif
#endif

#ifdef WIN32
#define NEARDATA
#else
#define NEARDATA __near
#endif

//We needs windows
#ifndef _INC_WINDOWS
#include <windows.h>
#endif

//For message crackers (16/32 portability)
#include <windowsx.h>
//if you compiling for 16 bits you may need to use
//windowsx.h16 instead of windowsx.h, check you include directory
//

//Just in case Windows.h didn't include ole2.h, we will explictly include it
//
#ifndef _OLE2_H_
#include <ole2.h>
#endif

//Just in case Windows.h didn't include Winsock.h, we will explictly include it
//
#ifndef _WINSOCKAPI_
#include <winsock.h>
#endif

//Using the Win95 during the beta gave Borland 4.5 problems, so use the
//standard files and just fix-up whatever else we need
//
#ifdef __BORLANDC__
#ifndef VER_PLATFORM_WIN32_WINDOWS
#define VER_PLATFORM_WIN32_WINDOWS 1
#endif
#endif

//Message Cracker for WM_DISPLAYCHANGE just for consistency
//
/* void Cls_OnDisplayChange(HWND hwnd, BOOL fChanged, int x, int y) */
#define HANDLE_WM_DISPLAYCHANGE(hwnd, wParam, lParam, fn) \
    ((fn)((hwnd), (BOOL)wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)), 0L)
#define FORWARD_WM_DISPLAYCHANGE(hwnd, fChanged, x, y, fn) \
    (void)(fn)((hwnd), WM_DISPLAYCHANGE,(WPARAM)(fChanged), MAKELPARAM((x), (y)))

#ifdef HANDLE_WM_CREATE
#undef HANDLE_WM_CREATE
#endif

#ifdef FORWARD_WM_CREATE
#undef FORWARD_WM_CREATE
#endif

/* BOOL Cls_OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct) */
#define HANDLE_WM_CREATE(hwnd, wParam, lParam, fn) \
    ((fn)((hwnd), (LPCREATESTRUCT)(lParam)))
#define FORWARD_WM_CREATE(hwnd, lpCreateStruct, fn) \
    (BOOL)(DWORD)(fn)((hwnd), WM_CREATE, 0L, (LPARAM)(LPCREATESTRUCT)(lpCreateStruct))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -