我正在使用sharpdx的工具包来制作一个全屏的directx 11窗口。
现在,每当另一个应用程序打开一个窗口时,这个全屏就会丢失。(例如,来自skype的弹出窗口、错误消息...)
我已经看到其他游戏可以以某种方式避免这种情况,所以我想知道这是否也可以使用sharpdx工具包,如果是的话,是如何做到的?
如果工具包不能做到这一点,如何使用directx 11函数来实现呢?
谢谢!
发布于 2014-04-04 17:30:51
我在不久前创建的XNA应用程序中遇到了类似的问题。我使用Windows API PInvoke取得了一些成功。
MSDN
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);https://stackoverflow.com/questions/21527252
复制相似问题