Scriper Posted July 8, 2007 Share Posted July 8, 2007 2 NotepadProgramm(A and run at the same time. Bothe are same in Titel, Text and Control ID. My wish is : When i typ one key in A, this key are typed in B. I try to code with ControlSend, but its not ok because Both are same in Titel, Control Id. Can anyone help me ? Link to comment Share on other sites More sharing options...
Valuater Posted July 8, 2007 Share Posted July 8, 2007 but its not ok because Both are same in Titel, Control Id. Can anyone help me ?Use the Window handle. Get it immediately after the program runsRun("notepad.exe") WinWaitActive("") $window1 = WinGetHandle("") WinMove($window1, "", 100, 100, 300, 200) Run("notepad.exe") WinWaitActive("") $window2 = WinGetHandle("") WinMove($window2, "", 500, 300, 300, 200) ControlSend($window1, "", "Edit1", "Test #1") ControlSend($window2, "", "Edit1", "Test #2") ControlSend($window1, "", "Edit1", @CRLF & "Test #1... again")8) Link to comment Share on other sites More sharing options...
Scriper Posted July 8, 2007 Author Share Posted July 8, 2007 My wish is : When i type A in Windows1, A ist typed automatisch in Windows2. #include <misc.au3>Run("notepad.exe")WinWaitActive("")$window1 = WinGetHandle("")Run("notepad.exe")WinWaitActive("")$window2 = WinGetHandle("")Func _IsAnyKeyPressed($start = 0, $end = 255) For $i = $start to $end if (_IsPressed(Hex($i))) Then return $i Next return -1EndFuncwhile(true) Local $val $val = _IsAnyKeyPressed() if ( $val > -1 ) Then ControlSend($window2,"","Edit",Chr($val)) EndIfWEndBut isnt successful Link to comment Share on other sites More sharing options...
Valuater Posted July 8, 2007 Share Posted July 8, 2007 maybe easier Dim $text, $text_hold Run("notepad.exe") WinWaitActive("") $window1 = WinGetHandle("") WinMove($window1, "", 100, 100, 300, 200) Run("notepad.exe") WinWaitActive("") $window2 = WinGetHandle("") WinMove($window2, "", 500, 300, 300, 200) While 1 $text = WinGetText($window2) If $text <> $text_hold Then ControlSetText($window1, "", "Edit1", $text) $text_hold = $text EndIf sleep(50) WEnd I dont like "key loggers" 8) Link to comment Share on other sites More sharing options...
Scriper Posted July 8, 2007 Author Share Posted July 8, 2007 maybe easier Dim $text, $text_hold Run("notepad.exe") WinWaitActive("") $window1 = WinGetHandle("") WinMove($window1, "", 100, 100, 300, 200) Run("notepad.exe") WinWaitActive("") $window2 = WinGetHandle("") WinMove($window2, "", 500, 300, 300, 200) While 1 $text = WinGetText($window2) If $text <> $text_hold Then ControlSetText($window1, "", "Edit1", $text) $text_hold = $text EndIf sleep(50) WEnd I dont like "key loggers" 8) No, i am not key logger. i want to test how can person use controlsend to control 2 same programm at the same time. Also, i want to code one programm for mmorpg. I have 2 account, I control one and the Bot control the other. The Bot follow me always. Have you any Idea for this Problem ? Many thank Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now