![]() WinMove, ahk_id %WID%,%win_min_w%, %win_min_h% However, FindWindowEx permits you to uniquely identify all existing windows. That is the best method to use immediately following creation of a new window. Well' I've sorted out how to keep track of the right windows: I simply grab the ahk_id (%WID%) immediately after creating it and then reference that whenever I want to work with that window. Return, DllCall( "user32.dll\GetSystemMetrics", "int", p_index ) p_type " is undefined!"įindWindowEx( p_hw_parent, p_hw_child, p_class, p_title ) WinMove, ahk_id %hw_putty2%, %win_min_w%, %win_min_h% Hw_putty2 := FindWindowEx( 0, hw_putty1, "PuTTY", 0 ) WinMove, ahk_id %hw_putty1%, %win_min_w%, %win_min_h% Hw_putty1 := FindWindowEx( 0, 0, "PuTTY", 0 ) note: identifies windows in z-order (i.e., activation order from top-to-bottom) MsgBox, default minimum window dimensions are %win_min_w% x %win_min_h% Win_min_h := GetSystemMetrics( SM_CYMIN ) Win_min_w := GetSystemMetrics( SM_CXMIN ) The following code will identify the default window dimensions and resize two PuTTY terminal windows to their minimum dimensions. Windows imposes default dimensions for window sizes, below which a window sizing operation will be ineffective. All things equal, then it is necessary to identify them in some given order (e.g., z-order, creation order, etc.).Ģ. Typically, that is the window class and title/text. In order to programmatically identify a window, there must be some unique known attribute. (as long as I keep focus on the right window - I open several with the same title.)ġ. I've checked the putty settings I can find and think of, and have enabled for instance the 'Remote-controlled terminal resizing' and made sure I'm not set to 'Forbid resizing completely'.Īs a workaround, I am able to simulate the keypresses for Alt-Space, Size, Left-Arrow, Up-arrow, etc, but it doesn't look very elegant in the script. ![]() When the script runs, I can see the putty window 'flicker' a little, but it doesn't change from it's startup size. ![]() (I'm using WinMove syntactically correct - I manage to reposition the windows and also test with Notepad.exe to make use of the resize function) The problem I'm encountering is simply that AutoHotKey can't resize the putty window. I'm setting up a very simple script to startup various putty.exe terminal windows, initiate monitoring of some log files and position the windows nicely on my screen. Apologies for the (potentiall) dumb question, but I'm stuck and need your help. ![]()
0 Comments
Leave a Reply. |