My combine
Sept 5, 2017 23:16:21 GMT -8
Post by anixx on Sept 5, 2017 23:16:21 GMT -8
This is my combined AHK script that I use so to modity the UI. Any improvements are welcome.
combine.7z (421.19 KB)
Code with comments:
combine.7z (421.19 KB)
Code with comments:
#NoTrayIcon
#NoEnv
#SingleInstance, Force
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 or wParam = 6 or wParam=4)
{
WinGetClass, WinClass, ahk_id %lParam%
If (wParam = 1) {
If (WinClass = "NativeHWNDHost") {
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(19, WindowCompositionAttributeData, 0, "UInt")
NumPut(&AccentPolicy, WindowCompositionAttributeData, 4 + padding, "Ptr")
NumPut(accentStructSize, WindowCompositionAttributeData, 4 + padding + A_PtrSize, "UInt")
DllCall("SetWindowCompositionAttribute", "Ptr", lParam, "Ptr", &WindowCompositionAttributeData)
}
}
if (WinClass = "CabinetWClass") {
; Classic toolbars (Win98 style, comment out for Win95 style)
Control, Style, +0x800000, ReBarWindow322, ahk_id %lParam%
Control, Style, +0x00000400, ReBarWindow322, ahk_id %lParam%
ControlGetPos,,,,h, ReBarWindow322, ahk_id %lParam%
ControlMove, ReBarWindow322,,,,h+1, ahk_id %lParam%
ControlMove, ReBarWindow322,,,,h, ahk_id %lParam%
; ClientEdge
Control, ExStyle, +0x200, FolderView, ahk_id %lParam%
Control, ExStyle, +0x200, SysListView321, ahk_id %lParam%
Control, ExStyle, +0x200, SysTreeView321, ahk_id %lParam%
SendMessage, 0x108F,,,FolderView, ahk_id %lParam%
; Make icon labels below
If (ErrorLevel=0x2){
Control, Style, +0x2, FolderView, ahk_id %lParam%
Control, Style, +0x2, SysListView321, ahk_id %lParam%
Control, Style, -0x2, FolderView, ahk_id %lParam%
Control, Style, -0x2, SysListView321, ahk_id %lParam%
}
; Remove navbar (repeat several times)
ControlGetPos, ,y1,,ha,ReBarWindow321, ahk_id %lParam%
SendMessage, 0x0082,,,ReBarWindow321, ahk_id %lParam%
Control, Hide,, WorkerW1, ahk_id %lParam%
Control, Hide,, ReBarWindow321, ahk_id %lParam%
ControlGetPos,,y2,,h1,ShellTabWindowClass1, ahk_id %lParam%
ControlMove, ShellTabWindowClass1,, y1,,y2-y1+h1, ahk_id %lParam%
ControlMove, ReBarWindow321,,,,0, ahk_id %lParam%
WinSet, Redraw,, ahk_id %lParam%
Sleep, 100
SendMessage, 0x0082,,,ReBarWindow321, ahk_id %lParam%
Control, Hide,, WorkerW1, ahk_id %lParam%
Control, Hide,, ReBarWindow321, ahk_id %lParam%
ControlGetPos,,y2,,h1,ShellTabWindowClass1, ahk_id %lParam%
ControlMove, ShellTabWindowClass1,, y1,,y2-y1+h1, ahk_id %lParam%
ControlMove, ReBarWindow321,,,,0, ahk_id %lParam%
WinSet, Redraw,, ahk_id %lParam%
Sleep, 100
SendMessage, 0x0082,,,ReBarWindow321, ahk_id %lParam%
Control, Hide,, WorkerW1, ahk_id %lParam%
Control, Hide,, ReBarWindow321, ahk_id %lParam%
ControlGetPos,,y2,,h1,ShellTabWindowClass1, ahk_id %lParam%
ControlMove, ShellTabWindowClass1,, y1,,y2-y1+h1, ahk_id %lParam%
ControlMove, ReBarWindow321,,,,0, ahk_id %lParam%
WinSet, Redraw,, ahk_id %lParam%
Sleep, 100
SendMessage, 0x0082,,,ReBarWindow321, ahk_id %lParam%
Control, Hide,, WorkerW1, ahk_id %lParam%
Control, Hide,, ReBarWindow321, ahk_id %lParam%
ControlMove, ShellTabWindowClass1,, y1,,y2-y1+h1, ahk_id %lParam%
ControlMove, ReBarWindow321,,,,0, ahk_id %lParam%
WinSet, Redraw,, ahk_id %lParam%
Sleep, 100
SendMessage, 0x0082,,,ReBarWindow321, ahk_id %lParam%
Control, Hide,, WorkerW1, ahk_id %lParam%
Control, Hide,, ReBarWindow321, ahk_id %lParam%
ControlMove, ShellTabWindowClass1,, y1,,y2-y1+h1, ahk_id %lParam%
ControlMove, ReBarWindow321,,,,0, ahk_id %lParam%
}
; ClientEdge in Mathematica
if (WinClass = "NotebookFrame") {
Control, ExStyle, +0x200, NotebookContent1, ahk_id %lParam%
WinGetPos, , , , h, ahk_id %lParam%
WinMove, ahk_id %lParam%,,,,,h-1
WinMove, ahk_id %lParam%,,,,,h
}
}
}