title: InitCommonControlsEx() function not recognised by compiler
body: <p>I am trying to call InitCommonControlsEx() in the main entry of a window program, and although I included the header  and linked to the ComCtl32.Lib, for some reason the compiler underlines that function as undefined.  Following is the code...</p>
  
  <pre><code>#include &lt;CommCtrl.h&gt;
  
  int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow)
  {
  INITCOMMONCONTROLSEX initControls;
  initControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
  initControls.dwICC = ICC_BAR_CLASSES;
  InitCommonControlsEx(&amp;initControls);
  }
  </code></pre>
  
  <p>I know that the inclusion of the  is doing something, because if I delete the inclusion of that header, then the compiler doesn't recognise the class INITCOMMONCONTROLSEX.</p>
  
  <p>I am really confused.  I went into the CommCtrl.h file and found that many sections were underlined in red giving warnings by the compiler, including any reference to WINAPI.  Could it be that I have a broken header?  I know the functions declaration is in there, it's in the following picture...</p>
  
  <p><a href="https://i.stack.imgur.com/W4CFG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W4CFG.jpg" alt="enter image description here"></a></p>
  
  <p>I've been googling for hours and can't figure it out.  There's not a DLL file I also need, is there?  As I said I've already linked the ComCtl32.Lib, sometimes referred to as comctl32.lib (I don't think the capitals matter).  Furthermore, on my computer I have 4 instances of this ComCtl32.Lib, two are for 64bit and two are for x86.  But, my feeling is that the problem is it just can't find declaration of that function from that header.  Thank you.  </p>
  
  <p>Edit:  Thanks to Harry Johnson I fixed the problem.  I had no idea that including standard header files requires that you include other header files before them.  In this case the compiler didn't recognise anything because windows.h wasn't included BEFORE CommCtrl.h.  An obvious mistake for anyone who knows what they're doing.  You can delete this question entirely.  I expected that when including a header that windows provides that all relevant dependencies are included in that header.  </p>