summaryrefslogtreecommitdiffstats
path: root/borders.ahk
diff options
context:
space:
mode:
authorbreadcat2013-08-17 14:01:38 +0100
committerbreadcat2013-08-17 14:01:38 +0100
commitb37dc10eb4968e29208c7939ac0f7a1edda5fe68 (patch)
tree441c42d1a63ce73a4b0ab2d77e6c703ffee21d97 /borders.ahk
parentae251368e6032bc4f492f8f74cceb09fe68b9fcd (diff)
downloadahka-b37dc10eb4968e29208c7939ac0f7a1edda5fe68.tar.gz
ahka-b37dc10eb4968e29208c7939ac0f7a1edda5fe68.tar.bz2
ahka-b37dc10eb4968e29208c7939ac0f7a1edda5fe68.zip
Include Detect OS
Merge both Windows XP and Windows 7 specific hotkey into a single file via OS detection.
Diffstat (limited to 'borders.ahk')
-rw-r--r--borders.ahk90
1 files changed, 90 insertions, 0 deletions
diff --git a/borders.ahk b/borders.ahk
new file mode 100644
index 0000000..0261e6e
--- /dev/null
+++ b/borders.ahk
@@ -0,0 +1,90 @@
+;window border removal ahk script
+;for use at work, on XP
+
+;doesn't work via include, must run standalone
+
+GoSub, HookWindow
+
+HookWindow:
+ ; New Window Hook
+ Gui +LastFound
+ hWnd := WinExist()
+
+ DllCall( "RegisterShellHookWindow", UInt,hWnd )
+ MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
+ OnMessage( MsgNum, "ShellMessage" )
+
+ ShellMessage(wParam,lParam) {
+ If (wParam = 1) ; HSHELL_WINDOWCREATED := 1
+ {
+ Sleep, 10
+ AdjustWindow(lParam)
+ }
+ }
+Return
+
+AdjustWindow(id)
+{
+ WinId := id
+ WinTitle := id = "A" ? "A" : "ahk_id " . id
+
+ ; This is to check if the window is shown in the alt-tab menu, you don't want to do it on every single frame
+ WinGet, WinExStyle, ExStyle, %WinTitle%
+ If (WinExStyle & 0x80)
+ {
+ Return
+ }
+
+ WinGetClass, WinClass, %WinTitle%
+ WinGet, WinProcess, ProcessName, %WinTitle%
+
+ If WinClass In % "CabinetWClass"
+ If WinProcess In % "explorer.exe"
+ {
+ WinSet, Style, -0xC00000, %WinTitle%
+ }
+
+
+
+ If WinClass In % "ShImgVw:CPreviewWnd"
+ {
+ WinSet, Style, -0xC00000, %WinTitle%
+ }
+ If WinProcess In % "Photoshop.exe"
+ {
+ WinSet, Style, -0xC00000, %WinTitle%
+ }
+ If WinProcess In % "sumatrapdf.exe"
+ {
+ WinSet, Style, -0xC00000, %WinTitle%
+ }
+ If WinProcess In % "mintty.exe"
+ {
+ WinSet, Style, -0xC00000, %WinTitle%
+ }
+ If WinProcess In % "7zFM.exe"
+ {
+ WinSet, Style, -0xC00000, %WinTitle%
+ }
+ If WinProcess In % "msaccess.exe"
+ {
+ WinSet, Style, -0xC00000, %WinTitle%
+ }
+ If WinProcess In % "excel.exe"
+ {
+ WinSet, Style, -0xC00000, %WinTitle%
+ }
+ If WinProcess In % "Notepad2.exe"
+ {
+ WinSet, Style, -0xC00000, %WinTitle%
+ }
+ If WinProcess In % "outlook.exe"
+ {
+ WinSet, Style, -0xC00000, %WinTitle%
+ Winset, AlwaysOnTop, off, %WinTitle%
+ }
+ If WinProcess In % "winword.exe"
+ {
+ WinSet, Style, -0xC00000, %WinTitle%
+ }
+} \ No newline at end of file