sumkid 0 Posted October 10, 2007 well im looking for a way to make it so if a key is pressed it will send that key to multiple windows this is what i have so far... expandcollapse popupSleep(2000) HotKeySet("{ESC}","qt") $hexKey = '0x' & $hexKey $list = ProcessList("process.exe") for $i = 1 to $list[0][0] msgbox(0, $list[$i][0], $list[$i][1]) next $var = WinList() For $i = 1 to $list[0][0] If $list[$i][0] <> "" AND IsVisible($list[$i][1]) Then MsgBox(0, "Details", "Title=" & $list[$i][0] & @LF & "Handle=" & $list[$i][1]) EndIf Next Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc Func _IsPressed($hexKey) If _IsPressed('31') Then ControlSend($list, "", "Edit1", "1") EndIf If _IsPressed('32') Then ControlSend($list, "", "Edit1", "2") EndIf If _IsPressed('33') Then ControlSend($list, "", "Edit1", "3") EndIf If _IsPressed('34') Then ControlSend($list, "", "Edit1", "4") EndIf If _IsPressed('35') Then ControlSend($list, "", "Edit1", "5") EndIf If _IsPressed('36') Then ControlSend($list, "", "Edit1", "6") EndIf If _IsPressed('37') Then ControlSend($list, "", "Edit1", "7") EndIf If _IsPressed('38') Then ControlSend($list, "", "Edit1", "8") EndIf If _IsPressed('39') Then ControlSend($list, "", "Edit1", "9") EndIf If _IsPressed(41) Then ControlSend($list, "", "Edit1", "a") EndIf If _IsPressed(44) Then ControlSend($list, "", "Edit1", "d") EndIf If _IsPressed(53) Then ControlSend($list, "", "Edit1", "s") EndIf If _IsPressed(57) Then ControlSend($list, "", "Edit1", "w") EndIf EndFunc Func qt() Exit EndFunc any ideas on what i may be doing wrong? Share this post Link to post Share on other sites
PsaltyDS 42 Posted October 10, 2007 (edited) well im looking for a way to make it so if a key is pressed it will send that key to multiple windows this is what i have so far...any ideas on what i may be doing wrong?Pretty much everything... _IsPressed() is already declared in Misc.au3, and you redeclared the function with broken code. Just include Misc.au3.You list windows to $var, but then try to display them from $list.Your version of _IsPressed() function is recursively calling itself.Your ControlSend() calls are attempting to use an entire array as the window handle, vice a valid array reference.The attempted window handle reference is coming from the list of processes, not the list of windows.Etc., etc., etc....You can't possibly have bothered to check this code with SciTE Tidy and Syntax Checker. Are you even using SciTE? P.S. ...and don't dual post the same topic. You were already getting help on this. Edited October 10, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Share this post Link to post Share on other sites
Blue_Drache 260 Posted October 10, 2007 he's phishing... Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Share this post Link to post Share on other sites
Richard Robertson 187 Posted October 10, 2007 What the heck is duelboxing? Is that supposed to be dual, as in, two at a time? Duel is a fight. Share this post Link to post Share on other sites
DW1 102 Posted October 10, 2007 If you check out the code posted, I would agree that he is "fighting" logic at this point.... maybe thats what duelboxing means... AutoIt3 Online Help Share this post Link to post Share on other sites
Blue_Drache 260 Posted October 10, 2007 And with two threads about it, I agree, it's a nice play on words... Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Share this post Link to post Share on other sites