Jump to content
Sign in to follow this  
Term!nX

Send Input to a dedicated Windows only?

Recommended Posts

Term!nX

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.

Share this post


Link to post
Share on other sites
GEOSoft

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

Share this post


Link to post
Share on other sites
herewasplato

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

Share this post


Link to post
Share on other sites
b14cksan

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?

Share this post


Link to post
Share on other sites
herewasplato

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]

Share this post


Link to post
Share on other sites
b14cksan

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

no.

thanx. that helps a little. i appreciate it man. hope i can bust this one by myself

Share this post


Link to post
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
Sign in to follow this  

×