I'm building an app which needs display a particular form always on top (this is a customer request), so far I'm using the SetWindowPos function with the HWND_TOPMOST value, and that works fine, but when the Windows 7 Flip 3D feature is activated my app doesn't stay in top.
Windows 7 Flip 3D
The question is, how my form can stay on top of all the others windows even if the Windows 7 Flip 3D is activated?
I do this some time ago using the DwmSetWindowAttribute
function modyfing the DWMWA_FLIP3D_POLICY attribute with the DWMFLIP3D_EXCLUDEABOVE value.
Try this code
uses
Winapi.DwmApi;
procedure TForm40.FormCreate(Sender: TObject);
var
pvAttribute: Integer;
begin
pvAttribute:= DWMFLIP3D_EXCLUDEABOVE;
if DwmCompositionEnabled then
DwmSetWindowAttribute(Handle, DWMWA_FLIP3D_POLICY, @pvAttribute, Sizeof(Integer));
end;
And this is the result
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With