Hi,
If we need to use size values from "AutoIt Window Info" this code is better:
Global $ActualColumns = Int(($PaneWidth-26)/8)
Global $ActualRows = Int(($PaneHeight-29)/15)
Code is NOT perfect because "window info" shows intermediate values
ex:
putty width 100 = PaneWidth should be 826
putty width 101 = PaneWidth should be 834 (826 + 8)
sometimes "Window Info" shows value between 827 and 833 (this is not good because results are not precise)
Best to use values directly from putty:
; session1 - window 1
$PuttyWidth = '126'
$PuttyHeight = '22'
$PaneWidth = Int(($PuttyWidth*8)+26)
$PaneHeight = Int(($PuttyHeight*15)+29)
Global $ActualColumns = Int(($PaneWidth-26)/8)
Global $ActualRows = Int(($PaneHeight-29)/15)
RegWrite("HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\session1\", "TermWidth", "REG_DWORD", $ActualColumns)
RegWrite("HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\session1\", "TermHeight", "REG_DWORD", $ActualRows)
Run(&$putty' -load "session1"')
WinWait("session1", "")
WinMove("session1", "", 0, 504)
; session1 - window 2
[...]
; session1 - window 3
[...]