<!DOCTYPE html>
<html class="client-js"><head>
  <meta charset="UTF-8">
  <title>windows.h</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script>
    function importScript() { return 1 } // this is to avoid the error from site.js
  </script>
  <script>let articleId = 'Windows.h'</script>
  <link rel="canonical" href="https://en.wikipedia.org/wiki/Windows.h">
  <link href="../-/mw/skins.minerva.base.reset|skins.minerva.content.styles|ext.cite.style|site.styles|mobile.app.pagestyles.android|mediawiki.page.gallery.styles|mediawiki.skinning.content.parsoid.css" rel="stylesheet" type="text/css">
  <link href="../-/style.css" rel="stylesheet" type="text/css"><link href="../-/content.parsoid.css" rel="stylesheet" type="text/css"><link href="../-/inserted_style.css" rel="stylesheet" type="text/css">
  <script src="../-/script.js"></script><script src="../-/masonry.min.js"></script><script src="../-/article_list_home.js"></script><script src="../-/images_loaded.min.js"></script><script src="../-/node_module/details-element-polyfill/dist/details-element-polyfill.js"></script>
</head>

<body class="mediawiki mw-hide-empty-elt ns-0 ns-subject stable skin-minerva action-view animations">
  <div id="mw-mf-viewport" class="feature-header-v2">
    <div id="mw-mf-page-center">
      <div id="content" class="mw-body">
        <a id="top"></a>
        <div id="bodyContent" class="content mw-parser-output">
          
          <div id="mw-content-text" style="direction: ltr;"><h1 class="section-heading" tabindex="0" aria-haspopup="true" data-section-id="0">
  <span class="mw-headline" id="title_0">windows.h</span>
</h1>
<div id="mf-section-0" class="mf-section-0" aria-pressed="true" aria-expanded="true">
  <p><b>windows.h</b> is a <a href="Microsoft_Windows" title="Microsoft Windows">Windows</a>-specific header file for the <a href="C_(programming_language)" title="C (programming language)">C</a> and <a href="C%2B%2B" title="C++">C++</a> programming languages which contains declarations for all of the functions in the <a href="Windows_API" title="Windows API">Windows API</a>, 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 <a href="Windows_API" title="Windows API">Win32 API</a> can be added to a C programming project by including the <span>&lt;</span>windows.h<span>&gt;</span> header file and linking to the appropriate libraries. To use functions in <i>xxxx</i>.<a href="Dynamic_link_library" title="Dynamic link library" class="mw-redirect">dll</a>, the program must be linked to <i>xxxx</i>.lib (or lib<i>xxxx</i>.dll.a in <a href="MinGW" title="MinGW">MinGW</a>). Some headers are not associated with a .dll but with a <a href="Static_library" title="Static library">static library</a> (e.g. scrnsave.h needs scrnsave.lib).</p>


<p><span>
</span><meta property="mw:PageProp/displaytitle" content="windows.h"></p> 


</div><details data-level="2" open="">
    <summary class="section-heading"><h2 id="Child_header_files">Child header files</h2></summary>
    
<p>There are a number of <b>child header files</b> that are automatically included with windows.h. Many of these files cannot simply be included by themselves (they are not <i>self-contained</i>), because of dependencies.</p>

<p>windows.h may include any of the following header files:</p>

<ul><li>excpt.h    <span>–</span> <a href="Exception_handling" title="Exception handling">Exception handling</a></li>
<li><a href="Stdarg.h" title="Stdarg.h">stdarg.h</a> <span>–</span> variable-argument functions (standard C header)</li>
<li>windef.h   <span>–</span> various macros and types</li>
<li>winnt.h    <span>–</span> various macros and types (for <a href="Windows_NT" title="Windows NT">Windows NT</a>)</li>
<li>basetsd.h  <span>–</span> various types</li>
<li>guiddef.h  <span>–</span> the <code><a href="GUID" title="GUID" class="mw-redirect">GUID</a></code> type</li>
<li><a href="Ctype.h" title="Ctype.h" class="mw-redirect">ctype.h</a>  <span>–</span> character classification (standard C header)</li>
<li><a href="String.h" title="String.h" class="mw-redirect">string.h</a> <span>–</span> strings and buffers (standard C header)</li>
<li>winbase.h  <span>–</span> kernel32.dll: kernel services; <span class="new">advapi32.dll</span>:kernel services(e.g. CreateProcessAsUser function), access control(e.g. AdjustTokenGroups function).</li>
<li>winerror.h <span>–</span> Windows error codes</li>
<li>wingdi.h   <span>–</span> <a href="Graphics_Device_Interface" title="Graphics Device Interface">GDI</a> (Graphics Device Interface)</li>
<li>winuser.h  <span>–</span> user32.dll: user services</li>
<li>winnls.h   <span>–</span> NLS (Native Language Support)</li>
<li>wincon.h   <span>–</span> console services</li>
<li>winver.h   <span>–</span> version information</li>
<li>winreg.h   <span>–</span> <a href="Windows_registry" title="Windows registry" class="mw-redirect">Windows registry</a></li>
<li>winnetwk.h <span>–</span> WNet (Windows Networking)</li>
<li>winsvc.h   <span>–</span> <a href="Windows_service" title="Windows service">Windows services</a> and the <a href="Service_Control_Manager" title="Service Control Manager">SCM</a> (Service Control Manager)</li>
<li>imm.h      <span>–</span> <a href="Input_Method_Editor" title="Input Method Editor" class="mw-redirect">IME</a> (Input Method Editor)</li></ul>


    <details data-level="3" open="">
    <summary class="section-heading"><h3 id="Extra_includes">Extra includes</h3></summary>
    
<ul><li>cderr.h   <span>–</span> <code>CommDlgExtendedError</code> function error codes</li>
<li>commdlg.h <span>–</span> Common Dialog Boxes</li>
<li>dde.h     <span>–</span> <a href="Dynamic_Data_Exchange" title="Dynamic Data Exchange">DDE</a> (Dynamic Data Exchange)</li>
<li>ddeml.h   <span>–</span> DDE Management Library</li>
<li>dlgs.h    <span>–</span> various constants for Common Dialog Boxes</li>
<li>lzexpand.h <span>–</span> <a href="Lempel-Ziv" title="Lempel-Ziv" class="mw-redirect">LZ</a> (Lempel-Ziv) compression/decompression</li>
<li>mmsystem.h <span>–</span> Windows Multimedia</li>
<li>nb30.h     <span>–</span> <a href="NetBIOS" title="NetBIOS">NetBIOS</a></li>
<li>rpc.h      <span>–</span> <a href="Remote_Procedure_Call" title="Remote Procedure Call" class="mw-redirect">RPC</a> (Remote procedure call)</li>
<li>shellapi.h  <span>–</span> <a href="Windows_Shell" title="Windows Shell" class="mw-redirect">Windows Shell</a> API</li>
<li>wincrypt.h  <span>–</span> Cryptographic API</li>
<li>winperf.h   <span>–</span> Performance monitoring</li>
<li>winresrc.h  <span>–</span> used in <a href="Resource_(Windows)" title="Resource (Windows)">resources</a></li>
<li>winsock.h   <span>–</span> <a href="Winsock" title="Winsock">Winsock</a> (Windows Sockets), version 1.1</li>
<li>winspool.h  <span>–</span> <a href="Print_spooler" title="Print spooler" class="mw-redirect">Print Spooler</a></li>
<li>winbgim.h  <span>–</span> <span class="new">Standard graphics library</span></li></ul>


</details>
<details data-level="3" open="">
    <summary class="section-heading"><h3 id="OLE_and_COM">OLE and COM</h3></summary>
    
<ul><li>ole2.h     <span>–</span> <a href="Object_Linking_and_Embedding" title="Object Linking and Embedding">OLE</a> (Object Linking and Embedding)</li>
<li>objbase.h  <span>–</span> <a href="Component_Object_Model" title="Component Object Model">COM</a> (Component Object Model)</li>
<li>oleauto.h  <span>–</span> <a href="OLE_Automation" title="OLE Automation">OLE Automation</a></li>
<li>olectlid.h <span>–</span> various <a href="GUID" title="GUID" class="mw-redirect">GUID</a> definitions</li></ul>


</details>

</details><details data-level="2" open="">
    <summary class="section-heading"><h2 id="Macros">Macros</h2></summary>
    
<p>Several macros affect the behavior of windows.h.</p>

<ul><li>UNICODE <span>–</span> when defined, this causes TCHAR to be a synonym of <a href="Wide_character" title="Wide character">WCHAR</a> instead of <a href="Character_(computing)" title="Character (computing)">CHAR</a>, 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.)</li>
<li>RC_INVOKED <span>–</span> defined when the <a href="Resource_(Windows)" title="Resource (Windows)">resource</a> compiler (RC.EXE) is in use instead of a C compiler.</li>
<li>WINVER <span>–</span> used to enable features only available in newer operating systems. Define it to 0x0501 for <a href="Windows_XP" title="Windows XP">Windows XP</a>, and 0x0600 for <a href="Windows_Vista" title="Windows Vista">Windows Vista</a>.</li>
<li>WIN32_LEAN_AND_MEAN <span>–</span> used to reduce the size of the header files and speed up compilation. Excludes things like cryptography, <a href="Dynamic_Data_Exchange" title="Dynamic Data Exchange">DDE</a>, <a href="Remote_procedure_call" title="Remote procedure call">RPC</a>, the <a href="Windows_Shell" title="Windows Shell" class="mw-redirect">Windows Shell</a> and <a href="Windows_Sockets" title="Windows Sockets" class="mw-redirect">Winsock</a>.</li></ul>


    
</details><details data-level="2" open="">
    <summary class="section-heading"><h2 id="See_also">See also</h2></summary>
    
<table role="presentation" class="mbox-small  sistersitebox" style="background-color:#f9f9f9;border:1px solid #aaa;color:#000">
<tbody><tr>
<td class="mbox-image"><figure-inline class="noviewer"><span><img src="../I/Wikibooks-logo-en-noslogan.svg.png.webp" data-file-width="400" data-file-height="400" data-file-type="drawing" height="40" width="40" loading="lazy"></span></figure-inline></td>
<td class="mbox-text plainlist">Wikibooks has a book on the topic of: <i><b><a href="https://en.wikibooks.org/wiki/Windows%20Programming%20" title="wikibooks:Windows Programming " class="external">Windows Programming</a></b></i></td></tr>
</tbody></table>
<ul><li>Windows.pas</li></ul>






    
</details><!--htdig_noindex--><div><div style="clear:both; background-image:linear-gradient(180deg, #E8E8E8, white); border-top: dashed 2px #AAAAAA; padding: 0.5em 0.5em 0.5em 0.5em; margin-top: 1em; direction: ltr;">
    This article is issued from <a class="external text" title="Last edited on 2020-09-21" href="https://en.wikipedia.org/wiki/?title=Windows.h&amp;oldid=979632131">Wikipedia</a>. The text is licensed under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons - Attribution - Sharealike</a>. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
        </div>
      </div>
    </div>
  </div>
  <script src="../-/mw/jsConfigVars.js"></script>
  <script src="../-/mw/startup.js"></script>
<script src="../-/mw/jquery.js"></script>
<script src="../-/mw/mediawiki.js"></script>
<script src="../-/mw/site.js"></script>



</body></html>