I think the problem is this.
Since you create the device yourself (and not through the factory), any calls made in the created factory will not change anything.
So, either you:
a) Create a factory earlier and create a device through it
OR
b) Extract the factory, which is actually used to create the device through the code below.
IDXGIDevice * pDXGIDevice; HR( md3dDevice->QueryInterface(__uuidof(IDXGIDevice), (void **)&pDXGIDevice) ); IDXGIAdapter * pDXGIAdapter; HR( pDXGIDevice->GetParent(__uuidof(IDXGIAdapter), (void **)&pDXGIAdapter) ); IDXGIFactory * pIDXGIFactory; pDXGIAdapter->GetParent(__uuidof(IDXGIFactory), (void **)&pIDXGIFactory);
And call the function through factory (after creating the SwapChain)
pIDXGIFactory->MakeWindowAssociation(mhMainWnd, DXGI_MWA_NO_ALT_ENTER);
MSDN: IDXGIFactory
Daniel Dimovski
source share