Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Why are background windows are not responding for PostMessage method, Where the foreground windows are working fine?

by pradeep,krishna (Scribe)
on Apr 01, 2014 at 09:29 UTC ( [id://1080508]=perlquestion: print w/replies, xml ) Need Help??

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

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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1080508]
Approved by sweetblood
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-03-29 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found