C++的Windows.h有哪些实用函数?

关注者
23
被浏览
191,481

9 个回答

Windows.h里基本上直接或间接包含了所有Windows常用的API. 维基百科 上抄来了一个列表

  • 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; advapi32.dll :kernel services(e.g. CreateProcessAsUser function), access control(e.g. AdjustTokenGroups function).
  • 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)

上述头文件都是被Windows.h间接包含的。

至于实用的函数,那就要看你如何定义“实用”了。这里就不讨论了。

OutputDebugStringW/OutputDebugStringA

DebugBreak