(C ++ / win32)隐藏窗口,以便用户不能使用alt-tab或切换到它 [英] (C++/win32) Hide a window so that the user cannot alt-tab or switch to it
本文介绍了(C ++ / win32)隐藏窗口,以便用户不能使用alt-tab或切换到它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前使用 ShowWindow(hwnd,SW_HIDE)
,但 Alt Tab
有没有办法完全隐藏窗口而不销毁它?
Is there a way to completely hide a window without destroying it?
>编辑:我应该添加使用 WS_EX_TOOLBOX
样式没有帮助。有足够的 Alt Tab 和 ShowWindow(SW_SHOW)
,会发生一些奇怪的事情。
I should add that using the WS_EX_TOOLBOX
style doesn't help. With enough AltTab and ShowWindow(SW_SHOW)
, some strange things happen.
推荐答案
尝试此代码以隐藏窗口_
我试试此代码,并且在您按下 Alt时隐藏窗口不会出现 + Tab [我正在使用win-xp]
要显示窗口,请按 Tab
Try this code to hide window
I have try this code and hidden window will be not appear while you pressing Alt + Tab [ I am using win-xp]
To show window press Tab + Esc
HWND hwnd_win = GetForegroundWindow();
ShowWindow(hwnd_win,SW_HIDE);
while(1)
{
Sleep(1000);
if(GetAsyncKeyState(VK_ESCAPE|VK_TAB ))
break;
}
ShowWindow(hwnd_win,SW_SHOW);
这篇关于(C ++ / win32)隐藏窗口,以便用户不能使用alt-tab或切换到它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文