.net 防止DirectX全屏中断。

.net 防止DirectX全屏中断。,.net,fullscreen,directx-11,sharpdx,.net,Fullscreen,Directx 11,Sharpdx,我正在使用sharpdx的工具包制作一个全屏directx 11窗口 现在,每当另一个应用程序打开窗口时,整个屏幕都会丢失。(例如来自skype的弹出窗口、错误消息等) 我已经看到其他游戏可以以某种方式避免这种情况,所以我想知道sharpdx工具包是否也可以做到这一点,如果可以,如何做到 如果工具包无法实现,如何使用directx 11函数实现 谢谢 我不久前创建的XNA应用程序也有类似的问题。我使用Windows API PInvoke取得了一些成功 private static class

我正在使用sharpdx的工具包制作一个全屏directx 11窗口

现在,每当另一个应用程序打开窗口时,整个屏幕都会丢失。(例如来自skype的弹出窗口、错误消息等)

我已经看到其他游戏可以以某种方式避免这种情况,所以我想知道sharpdx工具包是否也可以做到这一点,如果可以,如何做到

如果工具包无法实现,如何使用directx 11函数实现


谢谢

我不久前创建的XNA应用程序也有类似的问题。我使用Windows API PInvoke取得了一些成功

private static class NativeMethods
{
    [DllImport("user32.dll", SetLastError = true)]
    [return: MarshalAs(UnmanagedType.Bool)]
    public static extern bool LockSetForegroundWindow(uint uLockCode);
    public static readonly uint LSFW_LOCK = 1;
    public static readonly uint LSFW_UNLOCK = 2;
}

// Prevent annoying windows notifications etc from stealing focus and ruining the show!
NativeMethods.LockSetForegroundWindow(NativeMethods.LSFW_LOCK);