我到处看看如何在我的程序中使用Aero。 我没有find任何预览你自己的窗口的C函数,比如文件浏览器或任何主stream浏览器在它们的标题栏上。
有些程序是通过添加一个看起来像Windows 7标题栏的图像来伪装的 – 没有Aero,但是我认为这是一种欺骗行为。 我在下面的链接中find了这个代码:
[DllImport ("dwmapi.dll" Entry Point = "# 113", SetLastError = true)] internal static external DwmpActivateLivePreview uint (uint a, IntPtr b, uint c, uint d); [DllImport ("dwmapi.dll" Entry Point = "# 105", SetLastError = true)] internal static bool external DwmpStartOrStopFlip3D (); // Activate Aero peek into the desired Handle DwmpActivateLivePreview (1, Handle, 0, 1); // Disable Aero peek DwmpActivateLivePreview (0, Handle, 0, 1); // start or stop the Aero Flip 3D DwmpStartOrStopFlip3D ();
但不知道这是什么意思。 Aero Peek的实现是否自动使用PreviewWindows(or whatever)
function?
我迷路了。
这个链接是荷兰语,只需通过谷歌翻译
我不试图切换是否激活Aero Peek和/或Flip,或者在鼠标hover在任务栏图标上时更改应用程序的图标。 相反,我正在寻找一种function,将当前的应用程序屏幕状态置于我自己的后面,并将其作为图像返回给我的应用程序。 作为奖励,(可能是)返回的图像模糊了,还是分开应用的效果? 我认为它的名字是Aero Glass。
据我所知,你想得到你的应用程序后面的窗口的状态(在显示方面)。 你可以做到以下几点,
HWND hwnd_behind = GetNextWindow(your_window_handle, GW_HWNDNEXT); HDC hdc = GetWindowDC(hwnd_behind); RECT rect; GetWindowRect(hwnd_behind,rect); HDC bitmap = MakeABitMapDC(); StretchBlt(bitmap,0,0,dW,dH,hdc,0,0,rect.width,rect.height,SRCCOPY);
您可以将此代码插入处理程序,当窗口要求应用程序预览位图时返回位图。
为了简洁,留下了诸如“MakeABitMapDC”的细节。
我迷路了一大块地方,看看你不明白,但我会尝试反正。
如果意味着你不知道参数在做什么:
[DllImport ("dwmapi.dll" Entry Point = "# 113", SetLastError = true)] internal static external DwmpActivateLivePreview uint (uint a, IntPtr b, uint c, uint d);
基本上是这样的:
所以签名是这样的:
internal static extern uint DwmpActivateLivePreview(uint active, IntPtr handle, IntPtr onTopHandle, uint d);
DwmpStartOrStopFlip3D方法激活“Windows + Tab”效果。
[DllImport("dwmapi.dll", EntryPoint = "#105", SetLastError = true)] internal static extern bool DwmpStartOrStopFlip3D();
请记住,有一个原因,他们没有记录,因为他们不是为了我们使用它们。
如果碰巧你希望在应用程序中有Aero Peek效果,你可以看看位于DWM中的DwmSetIconicLivePreviewBitmap函数。
更多信息在这里: MSDN:DwmSetIconicLivePreviewBitmap函数