title: Disable alt-enter in a Direct3D (DirectX) application
body: <p>I'm reading <a href="https://rads.stackoverflow.com/amzn/click/com/1598220535" rel="noreferrer" rel="nofollow noreferrer">Introduction to 3D Game Programming with DirectX 10</a> to learn some DirectX, and I was trying to do the proposed exercises (chapter 4 for the ones who have the book).</p>
  
  <p>One exercise asks to disable the Alt+Enter functionality (toggle full screen mode) using <a href="http://msdn.microsoft.com/en-us/library/ee421919%28VS.85%29.aspx" rel="noreferrer"><code>IDXGIFactory::MakeWindowAssociation</code></a>.</p>
  
  <p>However it toggles full screen mode anyway, and I can't understand why. This is my code:</p>
  
  <pre><code>HR(D3D10CreateDevice(
          0,                 //default adapter
          md3dDriverType,
          0,                 // no software device
          createDeviceFlags, 
          D3D10_SDK_VERSION,
          &amp;md3dDevice) );
  
  IDXGIFactory *factory;
  HR(CreateDXGIFactory(__uuidof(IDXGIFactory), (void **)&amp;factory));
  HR(factory-&gt;CreateSwapChain(md3dDevice, &amp;sd, &amp;mSwapChain));
  factory-&gt;MakeWindowAssociation(mhMainWnd, DXGI_MWA_NO_ALT_ENTER);
  ReleaseCOM(factory);
  </code></pre>