frostchill Posted November 21, 2013 Share Posted November 21, 2013 Hello guys, i'm new here, I would like to get some help to fix my script, I'm trying to send keystroke to Fiddler Web Debugging, it seem like i have to keep the window focus to get it to work. Func MyExit() Exit EndFunc ;==>MyExit HotKeySet("{ESC}", "MyExit") While True ControlSend("Fiddler Web Debugger", "", "", "{s}") Sleep(1000) WEnd Link to comment Share on other sites More sharing options...
michaelslamet Posted November 21, 2013 Share Posted November 21, 2013 Before ControlSend, why not use WinActivate to give it a focus? Link to comment Share on other sites More sharing options...
frostchill Posted November 21, 2013 Author Share Posted November 21, 2013 (edited) not sure what to do... I search around. I found If WinActive("[CLASS:Notepad]") Then MsgBox(0, "", "Window was active")EndIf Where it say Class:Notepad.. I am not sure what to put in there, I used Au3info.exe to find class, and this is what i found "Class:WindowsForms10.Window.8.app.0.ea7f4a_r11_ad1" looks kinda too long. Where do i need to place these code? Edited November 21, 2013 by frostchill Link to comment Share on other sites More sharing options...
michaelslamet Posted November 21, 2013 Share Posted November 21, 2013 Maybe you can try this way While True If WinExists("Fiddler Web Debugger") Then WinActivate("Fiddler Web Debugger") ControlSend("Fiddler Web Debugger", "", "", "{s}") EndIf Sleep(1000) WEnd Link to comment Share on other sites More sharing options...
frostchill Posted November 21, 2013 Author Share Posted November 21, 2013 Thanks a bunch man, It's working, but it just try to keep that window on top, is there a way to keep it working while it's not focus? Link to comment Share on other sites More sharing options...
michaelslamet Posted November 21, 2013 Share Posted November 21, 2013 Maybe you can save current window handle and then restore it after ControlSend, but still it's annoying: Local $hCurrentWin While True If WinExists("Fiddler Web Debugger") Then $hCurrentWin = WinGetActive() WinActivate("Fiddler Web Debugger") ControlSend("Fiddler Web Debugger", "", "", "{s}") WinActivate($hCurrentWin[0]) EndIf Sleep(1000) WEnd Func WinGetActive() Dim $window[2] Dim $winlist $winlist = WinList() For $i = 1 to $winlist[0][0] If $winlist[$i][0] <> "" AND IsVisible($winlist[$i][1]) Then $window[0] = $winlist[$i][0] $window[1] = $winlist[$i][1] ExitLoop EndIf Next Return $window EndFunc Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc Link to comment Share on other sites More sharing options...
michaelslamet Posted November 21, 2013 Share Posted November 21, 2013 Maybe you want to take a look at this: '?do=embed' frameborder='0' data-embedContent>> I think that will not need the window to be focused like when we're using ControlSend Link to comment Share on other sites More sharing options...
frostchill Posted November 21, 2013 Author Share Posted November 21, 2013 That's too advance for me... still noobie, prefer something simple lol 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