📄 windows.h
字号:
/*****************************************************************************\
* *
* windows.h - Windows functions, types, and definitions *
* *
* Version 5.00 *
* *
* Copyright (c) 1985-1999, Microsoft Corp. All rights reserved. *
* *
*******************************************************************************
*
* The following symbols control inclusion of various parts of this file:
*
* WINVER Windows version number (0x040A). To exclude
* definitions introduced in version 4.1 (or above)
* #define WINVER 0x0300
* 0x0310 or 0x0400 before #including <windows.h>
*
* #define: To prevent inclusion of:
*
* NOKERNEL KERNEL APIs and definitions
* NOGDI GDI APIs and definitions
* NOUSER USER APIs and definitions
* NOSOUND Sound APIs and definitions
* NOCOMM Comm driver APIs and definitions
* NODRIVERS Installable driver APIs and definitions
* NOIMT Installable messge thunk APIs and definitions
* NOMINMAX min() and max() macros
* NOLOGERROR LogError() and related definitions
* NOPROFILER Profiler APIs
* NOMEMMGR Local and global memory management
* NOLFILEIO _l* file I/O routines
* NOOPENFILE OpenFile and related definitions
* NORESOURCE Resource management
* NOATOM Atom management
* NOLANGUAGE Character test routines
* NOLSTRING lstr* string management routines
* NODBCS Double-byte character set routines
* NOKEYBOARDINFO Keyboard driver routines
* NOGDICAPMASKS GDI device capability constants
* NOCOLOR COLOR_* color values
* NOGDIOBJ GDI pens, brushes, fonts
* NODRAWTEXT DrawText() and related definitions
* NOTEXTMETRIC TEXTMETRIC and related APIs
* NOSCALABLEFONT Truetype scalable font support
* NOBITMAP Bitmap support
* NORASTEROPS GDI Raster operation definitions
* NOMETAFILE Metafile support
* NOSYSMETRICS GetSystemMetrics() and related SM_* definitions
* NOSYSTEMPARAMSINFO SystemParametersInfo() and SPI_* definitions
* NOMSG APIs and definitions that use MSG structure
* NOWINSTYLES Window style definitions
* NOWINOFFSETS Get/SetWindowWord/Long offset definitions
* NOSHOWWINDOW ShowWindow and related definitions
* NODEFERWINDOWPOS DeferWindowPos and related definitions
* NOVIRTUALKEYCODES VK_* virtual key codes
* NOKEYSTATES MK_* message key state flags
* NOWH SetWindowsHook and related WH_* definitions
* NOMENUS Menu APIs
* NOSCROLL Scrolling APIs and scroll bar control
* NOCLIPBOARD Clipboard APIs and definitions
* NOICONS IDI_* icon IDs
* NOMB MessageBox and related definitions
* NOSYSCOMMANDS WM_SYSCOMMAND SC_* definitions
* NOMDI MDI support
* NOCTLMGR Control management and controls
* NOWINMESSAGES WM_* window messages
* NOHELP Help support
*
\****************************************************************************/
#ifndef _INC_WINDOWS
#define _INC_WINDOWS /* #defined if windows.h has been included */
#ifndef RC_INVOKED
#pragma pack(1) /* Assume byte packing throughout */
#endif /* RC_INVOKED */
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
#ifdef NOWIN31 /* ;Internal */
#define WINVER 0x0300 /* ;Internal */
#endif /* ;Internal */
/* ;Internal */
/* If WINVER is not defined, assume version 5.0 */
#ifndef WINVER
#define WINVER 0x045A
#endif
#ifdef RC_INVOKED
/* Don't include definitions that RC.EXE can't parse */
#define NOATOM
#define NOGDICAPMASKS
#define NOMETAFILE
#define NOMINMAX
#define NOMSG
#define NOOPENFILE
#define NORASTEROPS
#define NOSCROLL
#define NOSOUND
#define NOSYSMETRICS
#define NOTEXTMETRIC
#define NOWH
#define NODBCS
#define NOSYSTEMPARAMSINFO
#define NOCOMM
#define NOOEMRESOURCE
#endif /* RC_INVOKED */
/* Temp internal compatibility hacks */ /* ;Internal */
#define NOOEMRESOURCE /* ;Internal */
#ifdef OEMRESOURCE /* ;Internal */
#undef NOOEMRESOURCE /* ;Internal */
#endif /* ;Internal */
#define NOCOMM /* ;Internal */
#ifdef USECOMM /* ;Internal */
#undef NOCOMM /* ;Internal */
#endif /* ;Internal */
/* ;Internal */
/* Handle OEMRESOURCE for 3.0 compatibility */
#if (WINVER < 0x030a)
#define NOOEMRESOURCE
#ifdef OEMRESOURCE
#undef NOOEMRESOURCE
#endif
#endif
/******* Common definitions and typedefs ***********************************/
#define VOID void
#define FAR _far
#define NEAR _near
#define PASCAL _pascal
#define CDECL _cdecl
#define CONST const /* ;Internal */
/* ;Internal */
#ifdef BUILDDLL /* ;Internal */
#define WINAPI _loadds _far _pascal /* ;Internal */
#define CALLBACK _loadds _far _pascal /* ;Internal */
/* Note that to use the BUILDDLL version of */ /* ;Internal */
/* WINCAPI, you must compile with -GD */ /* ;Internal */
#define WINCAPI _export _far _cdecl /* ;Internal */
#else /* ;Internal */
#define WINAPI _far _pascal
#define CALLBACK _far _pascal
#define WINCAPI _far _cdecl
#endif /* ;Internal */
/* ;Internal */
#define API WINAPI /* ;Internal */
/****** Simple types & common helper macros *********************************/
typedef int BOOL;
#define FALSE 0
#define TRUE 1
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef WORD WCHAR;
typedef unsigned int UINT;
#ifdef STRICT
typedef signed long LONG;
#else
#define LONG long
#endif
typedef short SHORT;
typedef unsigned long ULONG;
#define LOBYTE(w) ((BYTE)(w))
#define HIBYTE(w) ((BYTE)(((UINT)(w) >> 8) & 0xFF))
#define LOWORD(l) ((WORD)(DWORD)(l))
#define HIWORD(l) ((WORD)((((DWORD)(l)) >> 16) & 0xFFFF))
#define MAKELONG(low, high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
#ifndef NOMINMAX
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#endif /* NOMINMAX */
/* Types use for passing & returning polymorphic values */
typedef UINT WPARAM;
typedef LONG LPARAM;
typedef LONG LRESULT;
#define MAKELPARAM(low, high) ((LPARAM)MAKELONG(low, high))
#define MAKELRESULT(low, high) ((LRESULT)MAKELONG(low, high))
/****** Common pointer types ************************************************/
#ifndef NULL
#define NULL 0
#endif
typedef char NEAR* PSTR;
typedef char NEAR* NPSTR;
#define SZ char /* ;Internal */
/* ;Internal */
typedef char FAR* LPSTR;
typedef const char FAR* LPCSTR;
typedef BYTE NEAR* PBYTE;
typedef BYTE FAR* LPBYTE;
typedef const BYTE FAR* LPCBYTE;
typedef int NEAR* PINT;
typedef int FAR* LPINT;
typedef WORD NEAR* PWORD;
typedef WORD FAR* LPWORD;
typedef long NEAR* PLONG;
typedef long FAR* LPLONG;
typedef DWORD NEAR* PDWORD;
typedef DWORD FAR* LPDWORD;
typedef void FAR* LPVOID;
#define MAKELP(sel, off) ((void FAR*)MAKELONG((off), (sel)))
#define SELECTOROF(lp) HIWORD(lp)
#define OFFSETOF(lp) LOWORD(lp)
#define FIELDOFFSET(type, field) ((int)(&((type NEAR*)1)->field)-1)
/****** Common handle types *************************************************/
#ifdef STRICT
typedef const void NEAR* HANDLE;
#define DECLARE_HANDLE(name) struct name##__ { int unused; }; \
typedef const struct name##__ NEAR* name
#define DECLARE_HANDLE32(name) struct name##__ { int unused; }; \
typedef const struct name##__ FAR* name
#else /* STRICT */
typedef UINT HANDLE;
#define DECLARE_HANDLE(name) typedef UINT name
#define DECLARE_HANDLE32(name) typedef DWORD name
#endif /* !STRICT */
typedef HANDLE* PHANDLE;
typedef HANDLE NEAR* SPHANDLE;
typedef HANDLE FAR* LPHANDLE;
typedef HANDLE HGLOBAL;
typedef HANDLE HLOCAL;
typedef HANDLE GLOBALHANDLE;
typedef HANDLE LOCALHANDLE;
typedef UINT ATOM;
#ifdef STRICT
typedef void (CALLBACK* FARPROC)(void);
typedef void (NEAR PASCAL* NEARPROC)(void);
#else
typedef int (CALLBACK* FARPROC)();
typedef int (NEAR PASCAL* NEARPROC)();
#endif
DECLARE_HANDLE(HSTR);
/****** KERNEL typedefs, structures, and functions **************************/
DECLARE_HANDLE(HINSTANCE);
typedef HINSTANCE HMODULE; /* HMODULEs can be used in place of HINSTANCEs */
typedef DWORD HKL;
#ifndef NOKERNEL
/****** Application entry point function ************************************/
#ifdef STRICT
int PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
#endif
/****** System Information **************************************************/
DWORD WINAPI GetVersion(void);
#if (WINVER >= 0x0400)
typedef struct tagOSVERSIONINFO {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
char szCSDVersion[128];
} OSVERSIONINFO, NEAR *POSVERSIONINFO, FAR *LPOSVERSIONINFO;
#define VER_PLATFORM_WIN32s 0
#define VER_PLATFORM_WIN32_WINDOWS 1
#define VER_PLATFORM_WIN32_NT 2
BOOL WINAPI GetVersionEx(LPOSVERSIONINFO lpBuffer);
UINT WINAPI GetProductName(LPSTR, UINT);
#endif /* WINVER >= 0x0400 */
#if (WINVER >= 0x0400)
#define GFS_PHYSICALRAMSIZE 0x1793
#define GFS_NEARESTMEGRAMSIZE 0x1794
#endif /* WINVER >= 0x0400 */
DWORD WINAPI GetFreeSpace(UINT);
UINT WINAPI GetCurrentPDB(void);
UINT WINAPI GetWindowsDirectory(LPSTR, UINT);
UINT WINAPI GetSystemDirectory(LPSTR, UINT);
#if (WINVER >= 0x030a)
UINT WINAPI GetFreeSystemResources(UINT);
#define GFSR_SYSTEMRESOURCES 0x0000
#define GFSR_GDIRESOURCES 0x0001
#define GFSR_USERRESOURCES 0x0002
#define GFSR_VALID 0x0002 /* ;Internal */
#endif /* WINVER >= 0x030a */
DWORD WINAPI GetWinFlags(void);
#define WF_PMODE 0x0001
#define WF_CPU286 0x0002
#define WF_CPU386 0x0004
#define WF_CPU486 0x0008
#define WF_STANDARD 0x0010
#define WF_WIN286 0x0010
#define WF_ENHANCED 0x0020
#define WF_WIN386 0x0020
#define WF_CPU086 0x0040
#define WF_CPU186 0x0080
#if (WINVER < 0x030a)
#define WF_LARGEFRAME 0x0100
#define WF_SMALLFRAME 0x0200
#endif
#define WF_80x87 0x0400
#define WF_PAGING 0x0800
#define WF_DOSPAGING 0x1000
#define WF_HASCPUID 0x2000
#define WF_WINNT 0x4000
#define WF_WLO 0x8000
#define WF_CPUMASK 0xFC000000
#define WF_CPU_X86 0
#define WF_CPU_R4000 1
#define WF_CPU_ALPHA 2
#define WF_CPU_CLIPPER 3
LPSTR WINAPI GetDOSEnvironment(void);
DWORD WINAPI GetCurrentTime(void);
DWORD WINAPI GetTickCount(void);
DWORD WINAPI GetTimerResolution(void);
/****** Error handling ******************************************************/
#if (WINVER >= 0x030a)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -