windows.h

windows.h is a Windows-specific header file for the C programming language which contains declarations for all of the functions in the Windows API, all the common macros used by Windows programmers, and all the data types used by the various functions and subsystems. It defines a very large number of Windows specific functions that can be used in C. The Win32 API can be added to a C programming project by including the <windows.h> header file and linking to the appropriate libraries. To use functions in xxxx.dll, the program must be linked to xxxx.lib (or libxxxx.a in MinGW). Some headers are not associated with a .dll but with a static library (e.g. scrnsave.h needs scrnsave.lib).

There are a number of child header files that are automatically included with windows.h. Many of these files cannot simply be included by themselves, because of dependencies.

windows.h may include any of the following header files:

  • excpt.h – Exception handling
  • stdarg.h – variable-argument functions (standard C header)
  • windef.h – various macros and types
  • winnt.h – various macros and types (for Windows NT)
  • basetsd.h – various types
  • guiddef.h – the GUID type
  • ctype.h – character classification (standard C header)
  • string.h – strings and buffers (standard C header)
  • winbase.h – kernel32.dll: kernel services
  • winerror.h – Windows error codes
  • wingdi.h – GDI (Graphics Device Interface)
  • winuser.h – user32.dll: user services
  • winnls.h – NLS (Native Language Support)
  • wincon.h – console services
  • winver.h – version information
  • winreg.h – Windows registry
  • winnetwk.h – WNet (Windows Networking)
  • winsvc.h – Windows services and the SCM (Service Control Manager)
  • imm.h – IME (Input Method Editor)

Extra includes:

  • cderr.h – CommDlgExtendedError function error codes
  • commdlg.h – Common Dialog Boxes
  • dde.h – DDE (Dynamic Data Exchange)
  • ddeml.h – DDE Management Library
  • dlgs.h – various constants for Common Dialog Boxes
  • lzexpand.h – LZ (Lempel-Ziv) compression/decompression
  • mmsystem.h – Windows Multimedia
  • nb30.h – NetBIOS
  • rpc.h – RPC (Remote procedure call)
  • shellapi.h – Windows Shell API
  • wincrypt.h – Cryptographic API
  • winperf.h – Performance monitoring
  • winresrc.h – used in resources
  • winsock.h – Winsock (Windows Sockets), version 1.1
  • winsock2.h – Winsock (Windows Sockets), version 2
  • winspool.h – Print Spooler

OLE and COM:

  • ole2.h – OLE (Object Linking and Embedding)
  • objbase.h – COM (Component Object Model)
  • oleauto.h – OLE Automation
  • olectlid.h – various GUID definitions

[edit] Macros

Several macros affect the behavior of windows.h.

  • UNICODE – when defined, this causes TCHAR to be a synonym of WCHAR instead of CHAR, and all type-generic API functions and messages that work with text will be defined to the -W versions instead of the -A versions. (It is similar to the windows C runtime's _UNICODE macro.)
  • RC_INVOKED – defined when the resource compiler (RC.EXE) is in use instead of a C compiler.
  • WINVER – used to enable features only available in newer operating systems. Define it to 0x0501 for Windows XP, and 0x0600 for Windows Vista.
  • WIN32_LEAN_AND_MEAN – used to reduce the size of the header files and speed up compilation. Excludes things like cryptography, DDE, RPC, the Windows Shell and Winsock.
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值