

Take it or leave it, this is the proper way to use the Aero Peek API.

I spent several months reverse engineering most of the cool Windows 7 taskbar API and this is part of my findings. Static extern int InvokeAeroPeek(bool EM, IntPtr PH, IntPtr C, PeekTypes pT, IntPtr hPN0, int x3244) / When going into or out of peek mode, always pass 0x3244 for this parameter. / When going into or out of peek mode, always pass new IntPtr(32) for this parameter. / Pass if you want to peek on the desktop and if you want to peek on a window. / The handle of the window calling the API method. / IntPtr.Zero if we're coming out of peek mode or peeking on the desktop. / The handle of the window we want to put into peek mode / True if we're going into peek mode False if we're coming out of it. / This is the *Almighty* Aero Peek API! / Denotes that the Peek API is to operate on a window. / Denotes that the Peek API is to operate on the desktop / This flag is here only for completeness and is not used / These flags are used in conjunction with the Aero Peek API. I know this is an older question but, the accepted answer lacks completeness.īelow is the proper usage of the Aero Peek API. You can exclude a window from the Aero Peek effect. If you pass the handle to that form that needs to be on top of the peek effect as the 3th parameter, and the TopMost property of your form is set to true, your form will be on top of the peek effect. When setting the TopMost property of a form, the form still shows sometimes underneath of the aero peek effect. The other two one I haven't been able to identify yet.Īfter some more messing around with this API I figured out the 3th parameter. The second parameter is the handle that Aero peek focuses to. The first parameter is for activating/deactivating the Aero Peek functionality. Internal static extern uint DwmpActivateLivePreview(uint switch, IntPtr hWnd, IntPtr c, uint d) ĭwmpActivateLivePreview(1, Handle, topmostWindowHandle, 1) //activateĭwmpActivateLivePreview(0, Handle, topmostWindowHandle, 1) //deactivate Unfortunately this is in dutch so here is a bit explaining: I have posted an article on my website about this:
