久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 Areo Snap、陰影、最小化動畫和抖動的無邊框

Borderless Window Using Areo Snap, Shadow, Minimize Animation, and Shake(使用 Areo Snap、陰影、最小化動畫和抖動的無邊框窗口)
本文介紹了使用 Areo Snap、陰影、最小化動畫和抖動的無邊框窗口的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在制作一個在 Windows 上帶有無邊框窗口的應用程序.但是,由于窗口是無邊框的,所以我沒有陰影、捕捉、最小化動畫或抖動.我環顧四周,沒有找到解釋如何實現這一點的網站.但是,我知道這是可能的,因為 Office 2013、Visual Studio 2012 和 Steam 都具有這些功能并且是無邊界的.我專門使用 QT 和 C++,但如果您已經為另一個窗口庫解決了這個問題,我也想聽聽您的解決方案.任何一個.我所說的 areo 陰影并不是指兩側的陰影,我指的是所有活動的本機 areo windows 應用程序的所有側面的發光陰影.

解決方案

在使用 Spy++ 檢查 Steam 的窗口(它的窗口樣式,它如何回復窗口消息)并嘗試匹配它所做的一切之后,結合來自這個 ,F11切換無邊框/窗口模式,F12切換無邊框陰影開啟并關閉.

I am making a application with a borderless window on Windows. However, since the window is borderless, I have no areo shadow, snap, minimization animation, or shake. I have looked around and found no site that explains how to implement this. However, I know it is possible because Office 2013, Visual Studio 2012, and Steam all have these features and are borderless. I am specifically using QT and C++ but if you have solved this for another windowing library I would like to hear your solutions as well. either. And by areo shadow I don't mean drop shadow on two sides, I mean the glowing shadow on all sides of all active native areo windows applications.

解決方案

After using Spy++ to inspect Steam's window (its window styles, how it replies to window messages) and trying to match everything it does, combined with the DWMAPI calls from this C# borderless window behavior, I believe I figured it out.

To hide the window's border, handle the WM_NCCALCSIZE message in your WindowProc:

case WM_NCCALCSIZE: {
    if (window->is_borderless) {
        return 0;
    } else {
        return DefWindowProc(hwnd, msg, wparam, lparam);
    }
}

To enable the shadow, all you need to do is:

MARGINS borderless = {1,1,1,1};
DwmExtendFrameIntoClientArea(hwnd, &borderless);

To turn it back off, restore the default margins MARGINS windowed = {0,0,0,0};. Perhaps throw in a SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED | SWP_ASYNCWINDOWPOS | SWP_NOSIZE | SWP_NOMOVE ); also, to make sure the frame gets redrawn.

However, this does not seem to work with all window styles, apparently your window style must not contain a titlebar. Title bars work fine, and adding one seems to enable the minimize animation.

The simplest window style I got the shadow to work with was WS_POPUP | WS_THICKFRAME, to also get aero snap, maximizing, minimizing, and the smooth minimize animation I used WS_POPUP | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION.

Changing DWMWA_NCRENDERING_POLICY or DWMWA_ALLOW_NCPAINT via DwmSetWindowAttribute does not appear to be required, the default settings seem to work.

One word of caution: DwmExtendFrameIntoClientArea does exactly what the name suggests, so if you are drawing an image with an alpha channel directly into your client area (say with opengl, direct3d/2d), a small frame will be visible through it:

So you might have to put a non transparent widget, brush or something behind the transparent element.

If all goes well, it should then look like this:

Here is a small example project, F11 toggles borderless/windowed mode, F12 toggles the borderless shadow on and off.

這篇關于使用 Areo Snap、陰影、最小化動畫和抖動的無邊框窗口的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數據?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫 for() 循環: for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環?)
Reusing thread in loop c++(在循環 C++ 中重用線程)
Precise thread sleep needed. Max 1ms error(需要精確的線程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環形?)
主站蜘蛛池模板: 性国产xxxx乳高跟 | 日日做夜夜爽毛片麻豆 | 99精品久久| 伊人精品久久久久77777 | 成人日韩av| 久草网站 | 视频在线一区二区 | 亚洲色在线视频 | 国产日韩在线观看一区 | 欧美视频在线播放 | 翔田千里一区二区 | 蜜臀久久| 国产精品一区二区三区四区 | 黄色片免费在线观看 | 国产精品久久久久影院色老大 | 国产中文区二幕区2012 | 特黄毛片 | 欧美色综合 | 国产一区二区三区久久久久久久久 | 精精国产xxxx视频在线播放 | 国产精品久久久久久婷婷天堂 | 国产精品亚洲精品 | 国产精品视频在线观看 | 成人黄色电影在线观看 | 久久手机在线视频 | 黄色欧美在线 | 午夜小视频在线播放 | 日本免费一区二区三区视频 | 精品视频一区二区三区 | 国产中文一区二区三区 | 久久久成人网 | 久久久91精品国产一区二区三区 | 国产精品激情小视频 | 一区二区三区小视频 | 国产精品久久一区 | 日韩在线播放一区 | 亚洲福利视频一区二区 | 一级免费视频 | 午夜视频在线观看视频 | 国产精品成人一区二区三区夜夜夜 | 91偷拍精品一区二区三区 |