ipmitool 发表于 2017-1-6 08:51:44

想要把putty視窗縮到工作列最小 @SW_MINIMIZE

想請問以下這一段為什麼沒有辦法視窗縮到最小啊...        $user = 123
        $password = 123
        $host ="192.168.1.1"
        $port ="22"
        $puty_exe = "putty.exe"   ; putty salve local folder script
        $command = Run(@comspec & " /C "&$puty_exe&" -ssh -l "&$user&" "&$host&" p "&$port&" -pw "&$password,@ScriptDir, @SW_MINIMIZE, 1)

h20040606 发表于 2017-1-6 10:56:06

本帖最后由 h20040606 于 2017-1-6 10:57 编辑

回复 1# ipmitool


    $user = 123
$password = 123
$host = "192.168.1.1"
$port = "22"
$puty_exe = "putty.exe" ; putty salve local folder script
$command = Run($puty_exe & " -ssh -l " & $user & " " & $host & " p " & $port & " -pw " & $password, @ScriptDir)
$hWnd=""
While $hWnd = ""
        $win_list = WinList()
        For $i = 1 To $win_list
                IfWinGetProcess($win_list[$i]) = $command Then
                        $hWnd = $win_list[$i]
                        ExitLoop
                EndIf
        Next
        Sleep(100)
WEnd
WinSetState($hWnd, "", @SW_MINIMIZE)

h20040606 发表于 2017-1-6 10:58:43

直接run,循环获得窗口句柄,就可以了

ipmitool 发表于 2017-1-6 13:26:56

本帖最后由 ipmitool 于 2017-1-6 13:30 编辑

回复 3# h20040606


    您好, 請問沒有辦法一執行就直接是縮下去的嗎?
    因為不想讓人有感覺視窗跳出來...拜託了!

h20040606 发表于 2017-1-6 20:09:59

直接:
    $user = 123
$password = 123
$host = "192.168.1.1"
$port = "22"
$puty_exe = "putty.exe" ; putty salve local folder script
$command = Run($puty_exe & " -ssh -l " & $user & " " & $host & " p " & $port & " -pw " & $password, @ScriptDir,@SW_MINIMIZE)
页: [1]
查看完整版本: 想要把putty視窗縮到工作列最小 @SW_MINIMIZE