pradeep,krishna has asked for the wisdom of the Perl Monks concerning the following question:

Hi fellow monks...

I have the following code to
  -> To find the login window(Which may be present in background
  ->And press ENTER key on all the windows found.

@Login_Windows = FindWindowLike(0, "Login"); for(@Login_Windows ) { PostMessage($_, SendKeys("~"), 13, 0); }

The code is working fine if the "Login" windows are in foreground, but none of the background windows are responding for the code.
I know that SendKeys function works only on the foreground windows. So i have used inside PostMessage method.
I don't know whether my code is wrong or not.
If the code itself is wrong, guide me with the correct method.
Help me in solving this.
Thanks in advance....
Pradeep Krishna

  • Comment on Why are background windows are not responding for PostMessage method, Where the foreground windows are working fine?
  • Download Code

Replies are listed 'Best First'.
Re: Why are background windows are not responding for PostMessage method, Where the foreground windows are working fine?
by Anonymous Monk on Apr 01, 2014 at 09:33 UTC
    because you can't just make stuff up and expect anyone, even windows , to like it
Re: Why are background windows are not responding for PostMessage method, Where the foreground windows are working fine?
by Corion (Patriarch) on Apr 02, 2014 at 07:34 UTC

    Your approach does likely not work because PostMessage() is not documented to use SendKeys() as an argument. Where is the documentation where your approach is documented?