Jump to content

Send Input to a dedicated Windows only?


Recommended Posts

Hi!

May I send inputs to a dedicated windows, even when it is not activated? Imagine I want to write 2 letters simultaneously and automatically. Is it possible to send inputs to an unactive windows? If you do not understand dont hesitate to ask its hard to explain what I mean.

Link to comment
Share on other sites

Hi!

May I send inputs to a dedicated windows, even when it is not activated? Imagine I want to write 2 letters simultaneously and automatically. Is it possible to send inputs to an unactive windows? If you do not understand dont hesitate to ask its hard to explain what I mean.

You could use FileWrite or FileWriteLine to send the text to a file without opening it at all.

Also if you are working with MSWord then take a look at the Word UDF.

Word Management

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

...May I send inputs to a dedicated windows, even when it is not activated?...

run this sample code:
Run("notepad")
WinWait("Untitled - Notepad")
WinSetState("Untitled - Notepad", "", @SW_MINIMIZE)

$state = WinGetState("Untitled - Notepad")
Do
    Sleep(9)
Until BitAND($state, 16)

ControlSend("Untitled - Notepad", "", "Edit1", "text 2 send")
WinSetState("Untitled - Notepad", "", @SW_RESTORE)
-MSP-

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

  • 3 weeks later...

run this sample code:

Run("notepad")
WinWait("Untitled - Notepad")
WinSetState("Untitled - Notepad", "", @SW_MINIMIZE)

$state = WinGetState("Untitled - Notepad")
Do
    Sleep(9)
Until BitAND($state, 16)

ControlSend("Untitled - Notepad", "", "Edit1", "text 2 send")
WinSetState("Untitled - Notepad", "", @SW_RESTORE)
-MSP-
thanx alot for that, problem is i want it to send the key to an allready opened program let's say a program called XZZYB.exe and to repeat the text a number of times at a particular interval.

i'm totally new to autoit. probabli it's very simple to modify that but i don't know how. can you help me?

Link to comment
Share on other sites

thanx alot for that...

You are welcome. Are you the original poster (OP) to this thread?

...send the key to an allready opened program...

See the AutoIt help file under ControlSend.

...and to repeat the text a number of times...

See the AutoIt help file under For/Next.

...at a particular interval...

See the AutoIt help file under Sleep.

...can you help me?

That remains to be seen. :-)

For $i = 1 To 100
    ControlSend("Untitled - Notepad", "", "Edit1", "text 2 send")
    Sleep(20000)
Next
See the AutoIt help file for how to modify the ControlSend line in the sample above.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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