Jump to content

Recommended Posts

Posted

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 !

Posted
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 !

 

Posted

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 Gude
How 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

Posted
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)

Posted
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.

Posted
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 !

Posted
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.

Posted
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 :drool:!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...