2016-11-02 21 views
0

こんにちはすべてのimは現在、壊れたWTSプロファイルをより簡単に管理(kill/delete)するためのスクリプトを作成しています。だから私たちのサポートの人のために私はそれを管理するために自動スクリプトを思い付くために簡単にするために。AUTOIT GUI管理一時停止スクリプト(バックグラウンドの場合)

私のスクリプトが「Enter」キーを聞いていることを除いて、すべてがスムーズに動いています。これが押されると、関数などが呼び出されます。 しかし、私のスクリプトがバックグラウンドで実行されていて、ユーザーが何か他のものをGoogleに求めている場合、彼は常にEnterキーを登録します。

複雑な検索(アスタリスクなど)であれば、プロファイルが格納されているnetsharesの不要なI/Oが生成されるため、問題を解決するにはどうすればよいでしょうか。問題の

コード:あなたはHotkeySetで

While 1 
     $nMsg = GUIGetMsg() 
     Switch $nMsg 
      Case $GUI_EVENT_CLOSE 
       Exit 
      Case $SearchButton 
       $sSearchString = GUICtrlRead($SubmitField) & "*" 
       If $sSearchString = "*" Then ; 
        _OutputConsole_Updater() 
        GUICtrlSetData($ConsoleOutput, "[" & @HOUR & ":" & @MIN & ":" & @SEC & "] -" & " Keine Eingabe getätigt, bitte Suchbegriff eingeben") 
       Else 
        _ReloadBox() 
        _SearchAll() 
       EndIf 
      Case $DeleteButton 
       _DeleteSelection() 
      Case $DeleteAll 
        _DeleteAllCheck()   
      Case $nMsg = _IsPressed("0D") 
       $sSearchString = GUICtrlRead($SubmitField) & "*" ; 
       If $sSearchString = "*" Then ; 
        _OutputConsole_Updater() 
        GUICtrlSetData($ConsoleOutput, "[" & @HOUR & ":" & @MIN & ":" & @SEC & "] -" & " Keine Eingabe getätigt, bitte Suchbegriff eingeben") 
       Else 
        _ReloadBox() 
        _SearchAll() 
       EndIf 
     EndSwitch 
WEnd 

答えて

0

を操作しますか?スクリプトがアクティブな場合にのみ、この機能を有効にしてください。

 If WinActive($scriptTitle) = 0 Then 
      _setHotKeys() 
     Endif 

Func _setHotKeys($state = 1) 
    If $state = 1 Then 
     HotKeySet('!1') 
     HotKeySet('!2') 
     HotKeySet('!3') 
     HotKeySet('!4') 
     HotKeySet('!5') 
     HotKeySet('!6') 
     HotKeySet('!7') 
     HotKeySet('!8') 
    ElseIf $state = 0 Then 
     HotKeySet('!1', '_setTab0') 
     HotKeySet('!2', '_setTab1') 
     HotKeySet('!3', '_setTab2') 
     HotKeySet('!4', '_setTab3') 
     HotKeySet('!5', '_setTab4') 
     HotKeySet('!6', '_setTab5') 
     HotKeySet('!7', '_setTab6') 
     HotKeySet('!8', '_setTab7') 
    EndIf 
EndFunc ;==>_setHotKeys 
+0

私は行方不明でした。今は意図したとおりに動作します。 –

+0

ニース、彼らは私の答えを投票してください。 – Xenobiologist

関連する問題