title: Questions regarding "warning C4312: 'type cast'"
body: <p>This is the code I have:</p>
  
  <pre><code>HWND WebformCreate(HWND hParent, UINT id)
  {
      return CreateWindowEx(0, WEBFORM_CLASS, _T("about:blank"),
          WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE, 0, 0, 100, 100, hParent,
          (HMENU)id, GetModuleHandle(NULL), 0);
  }
  </code></pre>
  
  <p>This is the warning I get:</p>
  
  <pre><code>warning C4312: 'type cast' : conversion from 'UINT' to 'HMENU' of greater size
  </code></pre>
  
  <p>These are the questions I have:</p>
  
  <ol>
  <li>Why does the compiler think it's a bad idea to cast to a bigger type?</li>
  <li>What's the best way to get rid of the warning? (I don't want to disable it.)</li>
  <li>Doing a double type cast like this: <code>(HMENU)(UINT_PTR)id</code> gets rid of the warning. Why/how?</li>
  <li>Disabling "Detect 64-bit Portability Issues" (Wp64) also gets rid of the warning. Why is Wp64 deprecated? Should I have it on?</li>
  </ol>