DonationCoder.com Software > Post New Requests Here
IDEA: AutoMaximize Windows
BigVent:
Give this a shot & see what it does for you.
--- Code: Autohotkey ---;http://www.autohotkey.com/board/topic/19672-detect-when-a-new-window-is-opened/;DLLCall / Shell / MsgBox = SKAN ;-------------------------------------------------------------------;--Program monitors newly opened windows & maximizes accordingly--;------------------------------------------------------------------- #SingleInstance, force#Persistent#NoEnvSetTitleMatchMode, 2SetWorkingDir %A_ScriptDir% DetectHiddenWindows, ononexit, exitsub Gui +LastFoundhWnd := WinExist() DllCall( "RegisterShellHookWindow", UInt,hWnd )MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )OnMessage( MsgNum, "ShellMessage" )Return ShellMessage( wParam,lParam ){ Local k If ( wParam = 1 ) ; HSHELL_WINDOWCREATED := 1 { NewID := lParam SetTimer, MsgBox, -1 }} MsgBox: WinGetTitle, Title, ahk_id %NewID% WinGetClass, Class, ahk_id %NewID% WinWait, ahk_id %NewID% ;add items you do NOT want maximized here... e.g. Properties Window (Alt+Enter), WinRar, etc. ;*Note: WinTitles need to be case sensitive if InStr(Title, "Properties") || InStr(Title, "WinRar") return else minmax_func()Return ralt & Esc:: ;right Alt key & Escexitsub:{ critical Exitapp} ;=================;==Function(s)====;=================minmax_func(){ global NewID, minmax WinGet, minmax, minmax, ahk_id %NewID% if (minmax=0) { WinMaximize, ahk_id %NewID% ;use PostMessage for stubborn windows ;PostMessage, 0x112, 0xF030,,, NewID ; 0x112 = WM_SYSCOMMAND, 0xF030 = SC_MAXIMIZE } else if (minmax=-1) { WinRestore, ahk_id %NewID% }}
Stamimail:
It has the same problems as described above (except the popup balloons).
I do not know if it's the right way, but maybe some of the cases can be solved by using: WinKey+UpArrow
Navigation
[0] Message Index
[*] Previous page
Go to full version