返回列表 发帖

[AU3基础] 想要把putty視窗縮到工作列最小 @SW_MINIMIZE

想請問以下這一段為什麼沒有辦法視窗縮到最小啊...
  1.         $user = 123
  2.         $password = 123
  3.         $host ="192.168.1.1"
  4.         $port ="22"
  5.         $puty_exe = "putty.exe"   ; putty salve local folder script
  6.         $command = Run(@comspec & " /C "&$puty_exe&" -ssh -l "&$user&" "&$host&" p "&$port&" -pw "&$password,@ScriptDir, @SW_MINIMIZE, 1)
复制代码
附件: 您需要登录才可以下载或查看附件。没有帐号?加入
Mike Pan

本帖最后由 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[0][0]
                If  WinGetProcess($win_list[$i][1]) = $command Then
                        $hWnd = $win_list[$i][1]
                        ExitLoop
                EndIf
        Next
        Sleep(100)
WEnd
WinSetState($hWnd, "", @SW_MINIMIZE)

TOP

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

TOP

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

回复 3# h20040606


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

TOP

直接:
    $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)

TOP

返回列表