|
Post by Splitwirez on Sept 29, 2017 7:13:44 GMT -8
I've been working on a tool to cancel out calls to the DwmExtendFrameIntoClientArea function. This should resolve a lot of issues with glowing translucent titlebars and Window borders. It may also fix some full-glass Windows. Here, have a download link.
|
|
|
Post by anixx on Sept 29, 2017 20:34:57 GMT -8
Can you please describe the principle behind this tool? It seems that when restoring the window it still takes time to make it non-transparent (about 1 second). Does it consume processing power when idle? Is the source code available?
|
|
|
Post by anixx on Sept 29, 2017 22:28:53 GMT -8
It seems it conflicts with my combine script (that adds client edge, 32px icons, removes address bar). The conflict is possibly because the both hook the shell event of opening a new window. If you disclose the principle by which your program works, I possibly could add this functionality to the combine script so to remove the conflict.
|
|
|
Post by anixx on Sept 29, 2017 22:56:43 GMT -8
Another issue, it displays a window for a short time when starting...
|
|
|
Post by Splitwirez on Sept 30, 2017 1:33:11 GMT -8
Can you please describe the principle behind this tool? Not really, I suck at explaining stuff D: It seems that when restoring the window it still takes time to make it non-transparent (about 1 second). ...I figured checking more frequently would just be stupid ._. Does it consume processing power when idle? Probably...haven't checked, but it runs a timer that strips the extended glass off all open windows every second, including those that never had any to begin with, so I wouldn't be surprised... Is the source code available? Not so far, and while I'd like to provide it, I'm quite hesitant about providing it here, given all the legal shenanigans apparently being pulled by our "wonderful" forum host... (talking about the company in question, not r.O.B. , ofc, lol) It seems it conflicts with my combine script (that adds client edge, 32px icons, removes address bar). The conflict is possibly because the both hook the shell event of opening a new window. If you disclose the principle by which your program works, I possibly could add this functionality to the combine script so to remove the conflict. Well that would imply I was hooking that shell event to begin with, which I'm not. I don't even know how to hook shell events. Another issue, it displays a window for a short time when starting... ...that's an issue?
|
|
|
Post by anixx on Sept 30, 2017 2:23:49 GMT -8
> Well that would imply I was hooking that shell event to begin with, which I'm not. I don't even know how to hook shell events.
Well, it seems the problem was not related to your program.
Anyway, if you are just checking every second, it is a very suboptimal approach that makes your program to consume processing power.
This AHK script uses shell hook so it does not take processor's time when resident unless a window is created. Additionally, it works instantly, without a delay. The only shortcoming is the effect on the window animations. If we could combine your and mine approach... That is use the shell hook but use your method of disabling transparency:
#NoTrayIcon #NoEnv Gui +LastFound hWnd := WinExist() SetControlDelay, -1 SetBatchLines -1
DllCall( "RegisterShellHookWindow", UInt,hWnd ) MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" ) OnMessage( MsgNum, "ShellMessage" ) Return ShellMessage(wParam,lParam) {
If (wParam = 1 ) { WCA_ACCENT_POLICY := 19 accentStructSize := VarSetCapacity(AccentPolicy, 4*4, 0) NumPut(1, AccentPolicy, 0, "UInt")
padding := A_PtrSize == 8 ? 4 : 0 VarSetCapacity(WindowCompositionAttributeData, 4 + padding + A_PtrSize + 4 + padding) NumPut(WCA_ACCENT_POLICY, WindowCompositionAttributeData, 0, "UInt") NumPut(&AccentPolicy, WindowCompositionAttributeData, 4 + padding, "Ptr") NumPut(accentStructSize, WindowCompositionAttributeData, 4 + padding + A_PtrSize, "UInt") DllCall("SetWindowCompositionAttribute", "Ptr", lParam, "Ptr",
&WindowCompositionAttributeData)
}
}
}
EDIT: The effect on window animations is only under Windows 8.1, not under Win 10/11
|
|
|
Post by Splitwirez on Sept 30, 2017 7:41:46 GMT -8
> Well that would imply I was hooking that shell event to begin with, which I'm not. I don't even know how to hook shell events. Well, it seems the problem was not related to your program. Anyway, if you are just checking every second, it is a very suboptimal approach that makes your program to consume processing power. This AHK script uses shell hook so it does not take processor's time when resident unless a window is created. Additionally, it works instantly, without a delay. The only shortcoming is the effect on the window animations. If we could combine your and mine approach... That is use the shell hook but use your method of disabling transparency: #NoTrayIcon #NoEnv Gui +LastFound hWnd := WinExist() SetControlDelay, -1 SetBatchLines -1 DllCall( "RegisterShellHookWindow", UInt,hWnd ) MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" ) OnMessage( MsgNum, "ShellMessage" ) Return ShellMessage(wParam,lParam) { If (wParam = 1 ) { WCA_ACCENT_POLICY := 19 accentStructSize := VarSetCapacity(AccentPolicy, 4*4, 0) NumPut(1, AccentPolicy, 0, "UInt") padding := A_PtrSize == 8 ? 4 : 0 VarSetCapacity(WindowCompositionAttributeData, 4 + padding + A_PtrSize + 4 + padding) NumPut(WCA_ACCENT_POLICY, WindowCompositionAttributeData, 0, "UInt") NumPut(&AccentPolicy, WindowCompositionAttributeData, 4 + padding, "Ptr") NumPut(accentStructSize, WindowCompositionAttributeData, 4 + padding + A_PtrSize, "UInt") DllCall("SetWindowCompositionAttribute", "Ptr", lParam, "Ptr", &WindowCompositionAttributeData) } } } My approach is poorly-optimized, but it is more reliable - some Windows may use DwmExtendFrameIntoClientArea AFTER they are created, such as when maximizing/restoring down, which a script like yours would be unable to take care of. However, if you insist on using your approach, all I did was call DwmExtendFrameIntoClientArea with the margins all set to zero. EDIT: And to clarify, I have no idea how to do that in AutoHotkey.
|
|
|
Post by anixx on Sept 30, 2017 9:53:09 GMT -8
Okay, this AHK script works for me (tested on IE, Pale Moon, Mobility Center):
#NoTrayIcon #NoEnv Gui +LastFound hWnd := WinExist() SetControlDelay, -1 SetBatchLines -1
DllCall( "RegisterShellHookWindow", UInt,hWnd ) MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" ) OnMessage( MsgNum, "ShellMessage" ) Return ShellMessage(wParam,lParam) {
If (wParam = 1 ) {
cxLeftWidth := 0 cxRightWidth := 0 cyTopHeight := 0 cyBottomHeight := 0
; init structure
global MARGINS ; create the MARGINS structure VarSetCapacity(MARGINS, 16, 0) ; Set capacity to hold four 4-byte integers and initialize them all to zero. ; fill the structure NumPut(cxLeftWidth, MARGINS, 0) ; NumPut(cxRightWidth, MARGINS, 4) ; NumPut(cyTopHeight, MARGINS, 8) ; NumPut(cyBottomHeight, MARGINS, 12) ; Sleep, 100 DllCall("dwmapi\DwmExtendFrameIntoClientArea", "uint" , lParam, "uint" , &MARGINS) NumPut(cxLeftWidth, MARGINS, 0) ; NumPut(cxRightWidth, MARGINS, 4) ; NumPut(cyTopHeight, MARGINS, 8) ; NumPut(cyBottomHeight, MARGINS, 12) ; Sleep, 100 DllCall("dwmapi\DwmExtendFrameIntoClientArea", "uint" , lParam, "uint" , &MARGINS)
NumPut(cxLeftWidth, MARGINS, 0) ; NumPut(cxRightWidth, MARGINS, 4) ; NumPut(cyTopHeight, MARGINS, 8) ; NumPut(cyBottomHeight, MARGINS, 12) ; Sleep, 100 DllCall("dwmapi\DwmExtendFrameIntoClientArea", "uint" , lParam, "uint" , &MARGINS)
NumPut(cxLeftWidth, MARGINS, 0) ; NumPut(cxRightWidth, MARGINS, 4) ; NumPut(cyTopHeight, MARGINS, 8) ; NumPut(cyBottomHeight, MARGINS, 12) ; Sleep, 100 DllCall("dwmapi\DwmExtendFrameIntoClientArea", "uint" , lParam, "uint" , &MARGINS)
NumPut(cxLeftWidth, MARGINS, 0) ; NumPut(cxRightWidth, MARGINS, 4) ; NumPut(cyTopHeight, MARGINS, 8) ; NumPut(cyBottomHeight, MARGINS, 12) ; Sleep, 100 DllCall("dwmapi\DwmExtendFrameIntoClientArea", "uint" , lParam, "uint" , &MARGINS)
} }
|
|
|
Post by anixx on Sept 30, 2017 10:54:09 GMT -8
Well, this does not actually work well for PaleMoon, because it re-applies transparency after being minimized or maximized. For IE and other programs works well though. I think we should find a theme-based solution for PaleMoon (I actually found the relevant lines in the theme, but when I package it, the browser says the theme is corrupted).
|
|
|
Post by anixx on Oct 1, 2017 0:33:23 GMT -8
Okay, another approach, this time I intentionally EXTEND the frame into non-client area. This script removes transparency from all windows, and does not disrupt Windows animations except closing animations. In other words, minimize/restore works well, but when closing a window, it becomes a black rectangle. combine.ahk (5.92 KB)
|
|
|
Post by 6sicsix on Oct 24, 2017 2:02:55 GMT -8
I've been working on a tool to cancel out calls to the DwmExtendFrameIntoClientArea function. This should resolve a lot of issues with glowing translucent titlebars and Window borders. It may also fix some full-glass Windows. Here, have a download link. Hi Splitwirez, do you mind if I include this in my windows 10 script (to run at logon?) I will add a credits section mentioning you and a link to this page. Thanks
|
|
|
Post by Splitwirez on Oct 25, 2017 6:50:30 GMT -8
Sure :V
|
|
|
Post by zero3k on Feb 25, 2018 18:58:41 GMT -8
Okay, another approach, this time I intentionally EXTEND the frame into non-client area. This script removes transparency from all windows, and does not disrupt Windows animations except closing animations. In other words, minimize/restore works well, but when closing a window, it becomes a black rectangle. It doesn't work on the 32-bit version of Pale Moon.
|
|
|
Post by 6sicsix on Apr 10, 2018 2:02:22 GMT -8
Okay, another approach, this time I intentionally EXTEND the frame into non-client area. This script removes transparency from all windows, and does not disrupt Windows animations except closing animations. In other words, minimize/restore works well, but when closing a window, it becomes a black rectangle. It doesn't work on the 32-bit version of Pale Moon. If you are seeing black then it is working. Works for me, weird transparency when it is not working instead of black.
|
|
gcomputzide
Sophomore Member
As gcomputing goes on, it comes to the zide.
Posts: 150
OS: Windows 10 1909
Theme: Classic Theme (Winamp 3.0)
CPU: Asus K53E: Intel(R) Pentium(R) CPU B950 @ 2.10GHz
RAM: AMD 8 GB, QUMO 4 GB
GPU: Asus K53E: Intel HD Graphics 3000
|
Post by gcomputzide on Sept 5, 2019 1:41:20 GMT -8
|
|
romserg
New Member
Posts: 21
OS: W10
Theme: Classic
|
Post by romserg on Aug 24, 2020 1:14:52 GMT -8
So, I have improved the Splitwirez program a bit. Now you can specify a timer interval for removing transparent window titles and select the programs for which to use it. This will reduce the load on the processor. I didn’t hang up the window handler because I don’t know much about it, and anixx had problems with it.
|
|