反向SetLayeredWindowAttributes

时间:2015-07-08 12:44:07

标签: java winapi alpha-transparency

我正在使用此代码共享屏幕。我有一个我创建的空中桌面应用程序(透明背景)。我不希望共享该窗口,即客户端不应该看到它。所以我使用SetLayeredWindowAttributes来隐藏窗口,然后捕获桌面并将图像发送给客户端,然后取消隐藏我的窗口。

我使用SetLayeredWindowAttributes使我的窗口透明。如何扭转这一点,即让我的窗户再次可见。

这是我的代码

private int GWL_EXSTYLE = -20;
private int WS_EX_LAYERED = 0x00080000;
private int LWA_ALPHA = 0x00000002;
private int LWA_COLORKEY = 0x00000001;
int winLong = User32Extra.INSTANCE.GetWindowLong(hwnd, GWL_EXSTYLE);
User32Extra.INSTANCE.SetWindowLong(hwnd, GWL_EXSTYLE, winLong | WS_EX_LAYERED);
User32Extra.INSTANCE.SetWindowPos(hwnd, null, 100, 100, 100, 100,(0x0002) | (0x0001) | (0x0004) | (0x0020));
User32Extra.INSTANCE.SetLayeredWindowAttributes(hwnd, null, 128,LWA_ALPHA);
/* My code*/
User32Extra.INSTANCE.SetWindowLong(hwnd, winLong & ~WS_EX_LAYERED);
User32Extra.INSTANCE.SetWindowPos(hwnd, null, 100, 100, 100, 100,(0x0002) | (0x0001) | (0x0004) | (0x0020));
User32Extra.INSTANCE.SetLayeredWindowAttributes(hwnd, null, 128,LWA_ALPHA);

要发送哪些参数才能使我的窗口再次可见?

0 个答案:

没有答案