c++directxdirectx-11direct3ddirect3d11

Disable switching fullscreen(alt+enter) in a Direct3D 11


As written in the title, how?

I thought that DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH in DXGI_SWAP_CHAIN_DESC::flags was responsible about this, but even when I set DXGI_SWAP_CHAIN_DESC::flags to 0, the switching doesn't disable.


Solution

  • According to @Simon Mourier, I should have used IDXGIFactory::MakeWindowAssociation. And to disable MessageBeep, I should have used WM_MENUCHAR and returned MNC_CLOSE << 16 when it occurs.