Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keying in background IE window
#1
Hello,
I need to change value of the field in background IE window. With e.SetText it will change value but i also need to send result to the server by keying 'Y or clicking "Save" button on the page.
That button is normally inactive until the value in the field changes but i cannot make button active with QM commands like e.SetText. In order to do it i need to get IE window in foreground and then use key command. Unfortunately i have to keep window in background to avoid interference with other tasks.
When i run code:
el.SetText("3")
el.SetFocus
'Y
- It changes the value to '3', sets focus on that field in background but then keys "Enter" in foreground window where cursor currently is.

Please advise me if there some better code to dial text or Enter in order page script to sense it. Or, if there is a good way to send update command to server differently.
Thanks.
#2
pasting to notepad (when notepad is in background)

example
Macro Macro1716
Code:
Copy      Help
int w=win("Internet Explorer" "IEFrame")
int c=child("" "Internet Explorer_Server" w)
SendCharactersToWindow c "bird"
SendKeysToWindow c key(Y)
#3
Thanks for help, Gintaras!
SendCharactersToWindow works but SendKeysToWindow does not send any key in my case. Nothing makes Save button unhidden on the page either.
But i was lucky to find out SendKey c VK_RRETURN was activating the Save button though it did not do save value by itself. Then script just hits the button with el.Click and server updates the value.
I think i am happy.


Forum Jump:


Users browsing this thread: 1 Guest(s)