# C1.Util.DX.DXGI.Factory2.CreateSwapChain1ForHwnd

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DXGI_Factory2_CreateSwapChain1ForHwnd_" data-uid="C1.Util.DX.DXGI.Factory2.CreateSwapChain1ForHwnd*">CreateSwapChain1ForHwnd Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DXGI_Factory2_CreateSwapChain1ForHwnd_" data-uid="C1.Util.DX.DXGI.Factory2.CreateSwapChain1ForHwnd*"></a>
<h4 id="C1_Util_DX_DXGI_Factory2_CreateSwapChain1ForHwnd_C1_Util_DX_ComObject_System_IntPtr_C1_Util_DX_DXGI_SwapChainDescription1__System_Nullable_C1_Util_DX_DXGI_SwapChainFullScreenDescription__C1_Util_DX_DXGI_Output_" data-uid="C1.Util.DX.DXGI.Factory2.CreateSwapChain1ForHwnd(C1.Util.DX.ComObject,System.IntPtr,C1.Util.DX.DXGI.SwapChainDescription1@,System.Nullable{C1.Util.DX.DXGI.SwapChainFullScreenDescription},C1.Util.DX.DXGI.Output)">CreateSwapChain1ForHwnd(ComObject, IntPtr, ref SwapChainDescription1, SwapChainFullScreenDescription?, Output)</h4>
<div class="markdown level1 summary"><p>HRESULT IDXGIFactory2::CreateSwapChainForHwnd([In] IUnknown* pDevice,[In] HWND hWnd,[In] const DXGI_SWAP_CHAIN_DESC1* pDesc,[In, Optional] const DXGI_SWAP_CHAIN_FULLSCREEN_DESC* pFullscreenDesc,[In, Optional] IDXGIOutput* pRestrictToOutput,[Out, Fast] IDXGISwapChain1** ppSwapChain)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public SwapChain1 CreateSwapChain1ForHwnd(ComObject deviceRef, IntPtr hWnd, ref SwapChainDescription1 descRef, SwapChainFullScreenDescription? fullscreenDescRef, Output restrictToOutputRef)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateSwapChain1ForHwnd(deviceRef As ComObject, hWnd As IntPtr, ByRef descRef As SwapChainDescription1, fullscreenDescRef As SwapChainFullScreenDescription?, restrictToOutputRef As Output) As SwapChain1</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.ComObject.html">ComObject</a></td>
      <td><span class="parametername">deviceRef</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">IntPtr</a></td>
      <td><span class="parametername">hWnd</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DXGI.SwapChainDescription1.html">SwapChainDescription1</a></td>
      <td><span class="parametername">descRef</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DXGI.SwapChainFullScreenDescription.html">SwapChainFullScreenDescription</a>?</td>
      <td><span class="parametername">fullscreenDescRef</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DXGI.Output.html">Output</a></td>
      <td><span class="parametername">restrictToOutputRef</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DXGI.SwapChain1.html">SwapChain1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
