HugoNatalis Posted March 1, 2019 Share Posted March 1, 2019 Hello all, After a few failing researches, I would ask you how to send any keyboard keys to a hidden IE window, as for example I would do : #include <IE.au3> $oIE = _IECreate("www.the-website.com",0,0) _IELoadWait($oIE) ;; here something to send ("{ENTER}") to $oIE _IEAction($oIE,"visible") Hope some of you could help me thx ! Link to comment Share on other sites More sharing options...
HugoNatalis Posted March 1, 2019 Author Share Posted March 1, 2019 Just now, HugoNatalis said: Hello all, After a few failing researches, I would ask you how to send any keyboard keys to a hidden IE window, as for example I would do : #include <IE.au3> $oIE = _IECreate("www.the-website.com",0,0) _IELoadWait($oIE) ;; here something to send ("{ENTER}") to $oIE _IEAction($oIE,"visible") Hope some of you could help me thx ! Link to comment Share on other sites More sharing options...
BrewManNH Posted March 1, 2019 Share Posted March 1, 2019 Why are you using Send when you're already using the IE* functions? Send can't send keys to a non-visible window, it can only send them to the currently active window. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
HugoNatalis Posted March 1, 2019 Author Share Posted March 1, 2019 3 hours ago, BrewManNH said: Why are you using Send when you're already using the IE* functions? Send can't send keys to a non-visible window, it can only send them to the currently active window. "Send" word I used is not matching with the function Send(), i just used it to show where i wanted to insert the correct task/function to do what I want (which is the reason i created this topic haha) Link to comment Share on other sites More sharing options...
Nine Posted March 1, 2019 Share Posted March 1, 2019 31 minutes ago, HugoNatalis said: "Send" word I used is not matching with the function Send(), i just used it to show where i wanted to insert the correct task/function to do what I want (which is the reason i created this topic haha) Again, if you have read the way you should post a question, you would know how to do it. Make a runable script (not just a two liners) that we all can replicate, then tell us what is wrong. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
rm4453 Posted March 2, 2019 Share Posted March 2, 2019 What are you wanting to send? Link to comment Share on other sites More sharing options...
HugoNatalis Posted March 2, 2019 Author Share Posted March 2, 2019 11 hours ago, Nine said: Again, if you have read the way you should post a question, you would know how to do it. Make a runable script (not just a two liners) that we all can replicate, then tell us what is wrong. Okay I think I understand, here is my script : #include <IE.au3> $oIE = _IECreate("www.the-website.com",0,0) _IELoadWait($oIE) Send("{ENTER}") _IEAction($oIE,"visible") The problem is when I want to to send ENTER to $oIE, i received ENTER in the current opened window, the AutoIT script, which i do not want. I don't know what to use instead of Send("{ENTER}") into the hidden IE window. If some know it, help please ! Link to comment Share on other sites More sharing options...
rm4453 Posted March 2, 2019 Share Posted March 2, 2019 3 minutes ago, HugoNatalis said: Okay I think I understand, here is my script : #include <IE.au3> $oIE = _IECreate("www.the-website.com",0,0) _IELoadWait($oIE) $hWnd = _IEPropertyGet($oIE, "hwnd") ; Grab hWnd of IE window ControlSend($hWnd, "", "", "{ENTER}") ; Use ControlSend to send what you want ; Send("{ENTER}") ; Won't work with hidden windows only sends to current selected window _IEAction($oIE,"visible") The problem is when I want to to send ENTER to $oIE, i received ENTER in the current opened window, the AutoIT script, which i do not want. I don't know what to use instead of Send("{ENTER}") into the hidden IE window. If some know it, help please ! 7 I modified your code above and put some comments that should help. Let me know if you have any other questions. Link to comment Share on other sites More sharing options...
HugoNatalis Posted March 2, 2019 Author Share Posted March 2, 2019 2 minutes ago, rm4453 said: I modified your code above and put some comments that should help. Let me know if you have any other questions. As simple as this, that's exactly what i wanted ! Thanks for the lesson ! Link to comment Share on other sites More sharing options...
rm4453 Posted March 2, 2019 Share Posted March 2, 2019 Just now, HugoNatalis said: As simple as this, that's exactly what i wanted ! Thanks for the lesson ! Of course always glad to help! Good Luck! HugoNatalis 1 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