mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-02 16:15:28 +08:00
修复win11设置效果崩溃的错误
This commit is contained in:
@ -136,6 +136,13 @@ static inline bool setWindowEffect(HWND hwnd, const QString &key, const bool &en
|
||||
if (!isWin11OrGreater()) {
|
||||
return false;
|
||||
}
|
||||
if(module && !pDwmSetWindowAttribute){
|
||||
pDwmSetWindowAttribute = reinterpret_cast<DwmSetWindowAttributeFunc>(
|
||||
GetProcAddress(module, "DwmSetWindowAttribute"));
|
||||
if (!pDwmSetWindowAttribute) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (enable) {
|
||||
pDwmExtendFrameIntoClientArea(hwnd, &extendedMargins);
|
||||
if (isWin1122H2OrGreater()) {
|
||||
@ -163,6 +170,13 @@ static inline bool setWindowEffect(HWND hwnd, const QString &key, const bool &en
|
||||
if (!isWin1122H2OrGreater()) {
|
||||
return false;
|
||||
}
|
||||
if(module && !pDwmSetWindowAttribute){
|
||||
pDwmSetWindowAttribute = reinterpret_cast<DwmSetWindowAttributeFunc>(
|
||||
GetProcAddress(module, "DwmSetWindowAttribute"));
|
||||
if (!pDwmSetWindowAttribute) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (enable) {
|
||||
pDwmExtendFrameIntoClientArea(hwnd, &extendedMargins);
|
||||
const DWORD backdropType = _DWMSBT_TABBEDWINDOW;
|
||||
@ -180,6 +194,13 @@ static inline bool setWindowEffect(HWND hwnd, const QString &key, const bool &en
|
||||
if (!isWin11OrGreater()) {
|
||||
return false;
|
||||
}
|
||||
if(module && !pDwmSetWindowAttribute){
|
||||
pDwmSetWindowAttribute = reinterpret_cast<DwmSetWindowAttributeFunc>(
|
||||
GetProcAddress(module, "DwmSetWindowAttribute"));
|
||||
if (!pDwmSetWindowAttribute) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (enable) {
|
||||
MARGINS margins{-1, -1, -1, -1};
|
||||
pDwmExtendFrameIntoClientArea(hwnd, &margins);
|
||||
|
Reference in New Issue
Block a user