我试图在AOL中隐藏嵌入广告窗口。这是我试图隐藏的窗口/控件的图片:
此窗口/控件是聊天室窗口的子项。
以下是我目前正在尝试使用的代码:
public static void hideAdvertisement()
{
IntPtr hWND = AOL.FindWindow("AOL Frame25", null);
IntPtr child = AOL.FindWindowEx(hWND, (IntPtr)null, "MDIClient", null);
IntPtr chatRoom = AOL.FindWindowEx(child, (IntPtr)null, "AOL Child", null);
IntPtr advertisementParent = AOL.FindWindowEx(chatRoom, (IntPtr)null, "ATL:69F46668", null);
IntPtr advertisement = AOL.FindWindowEx(advertisementParent, (IntPtr)null, "Internet Explorer_Server", null);
long style = AOL.GetWindowLong(advertisement, -16);
style &= ~(0x10000000L);
style &= ~(0x00040000L);
AOL.ShowWindow(advertisement, 0);
AOL.SetWindowLong(advertisement, -16, (int)style);
AOL.ShowWindow(advertisement, 5);
AOL.ShowWindow(advertisement, 0);
}
我绝对相信我有适合控制的手柄。我可以看到在Spy ++中发送的消息。
除了上面的代码,我也尝试了其他的东西。
让我明白ShowWindow(handle, 0); (SW_HIDE)
对我不起作用。有什么想法吗?