1
Post New Requests Here / Re: IDEA: AutoMaximize Windows
« on: April 24, 2015, 09:27 AM »
Give this a shot & see what it does for you.
Code: Autohotkey [Select]
- ;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
- SetWorkingDir %A_ScriptDir%
- onexit, exitsub
- Gui +LastFound
- Return
- ShellMessage( wParam,lParam )
- {
- Local k
- If ( wParam = 1 ) ; HSHELL_WINDOWCREATED := 1
- {
- NewID := lParam
- }
- }
- ;add items you do NOT want maximized here... e.g. Properties Window (Alt+Enter), WinRar, etc.
- ;*Note: WinTitles need to be case sensitive
- return
- else
- minmax_func()
- Return
- ralt & Esc:: ;right Alt key & Esc
- exitsub:
- {
- }
- ;=================
- ;==Function(s)====
- ;=================
- minmax_func()
- {
- global NewID, minmax
- if (minmax=0)
- {
- ;use PostMessage for stubborn windows
- ;PostMessage, 0x112, 0xF030,,, NewID ; 0x112 = WM_SYSCOMMAND, 0xF030 = SC_MAXIMIZE
- }
- else
- if (minmax=-1)
- {
- }
- }