MonsieurOUXX Posted October 25, 2011 Share Posted October 25, 2011 (edited) Suppose you create an IE using the special function _IECreate2 found here : It has to be done this way because I need to take advantage of the command line parameters. Now as you can see, IE is an entirely autonomous window -- that is, the embedding is faked.That means, for example, that you can press Alt+F4 inside the "embedded" IE ... and it will close it without closing your AutoIt window! Now how can I make sure that the focus doesn't go on IE?For example, how can I intercept the focus being given to IE and add an event that would immediately pass it forward to someone else? Any clever solution is accepted, even if you think out of the box. the goal is simply to prevent wise guys from pressing key combinations on my "embedded" IE. Edited October 25, 2011 by MonsieurOUXX Link to comment Share on other sites More sharing options...
Skitty Posted October 25, 2011 Share Posted October 25, 2011 Suppose you create an IE using the special function _IECreate2 found here : It has to be done this way because I need to take advantage of the command line parameters. Now as you can see, IE is an entirely autonomous window -- that is, the embedding is faked.That means, for example, that you can press Alt+F4 inside the "embedded" IE ... and it will close it without closing your AutoIt window! Now how can I make sure that the focus doesn't go on IE?For example, how can I intercept the focus being given to IE and add an event that would immediately pass it forward to someone else? Any clever solution is accepted, even if you think out of the box. the goal is simply to prevent wise guys from pressing key combinations on my "embedded" IE. Capture the key strokes with "HotKeySet" (If thats what its called)? I remember people saying that hotkey thing prevents it from passing through and let's you decide what to do with it. Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 25, 2011 Share Posted October 25, 2011 (edited) $hwnd_ie = WinGetHandle("Some IE Window") $hwnd_other = WinGetHandle("Some Other Window") While 1 Sleep(10) If WinActive($hwnd_ie) Then WinActivate($hwnd_other) EndIf Wend Edit: *gets wise* $hwnd_ie = WinGetHandle("Some Embedded IE Window") ProcessClose(WinGetProcess($hwnd_ie)) Edited October 25, 2011 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
MilesAhead Posted October 25, 2011 Share Posted October 25, 2011 (edited) You can use GetWindowLong and SetWindowLong to set the window to WS_EX_NOACTIVATE Or you can use the equivalent functions in UDF Edited October 25, 2011 by MilesAhead My Freeware Page Link to comment Share on other sites More sharing options...
MonsieurOUXX Posted October 26, 2011 Author Share Posted October 26, 2011 Thanks guys, your answers are all very valuable! I'll run some tests. However I'm a bit confused by this one : $hwnd_ie = WinGetHandle("Some Embedded IE Window") ProcessClose(WinGetProcess($hwnd_ie)) ...won't this one kill my embedded IE? as we say in French "use a hammer to kill a fly" Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 26, 2011 Share Posted October 26, 2011 Yep. It will. I was showing a way to kill your embedded window without needing alt-F4 Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache 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