Jump to content

Sending Keystroke to Window is not working


Recommended Posts

Hi there.

I'm trying to send Keystrokes to Windows, that are minimized or not active.

I'm new to AutoIT, but I'm not new to VB.

I copied a Codeline from this forum for testings.

The line is:

ControlSend ( "Editor", "", "", "lalala" , 1)

For testing I opened the editor (notepad.exe) and saved one file with the name "1.txt". So if I'm watcinh the process in my taskmanager there is written "1.txt - Editor".

But when I type the following:

ControlSend ( "1.txt - Editor", "", "", "lalala" , 1)

then it's not working. There still is no text.

First question is what my mistake is and then I want to ask you, if it's possible to send the command directly to the process "notepad.exe".

I've read a few times about "pID", the process-ID. Do I need the pID and where do I find it? I don't need to find the pID with AutoIT. The process I will use in future never changes during running :)

I hope you understand my problem and can help me :)

Thanks so much

XspYroX

Link to comment
Share on other sites

ControlSend("1.txt", "", "Edit1", "lalala")

WinGetProcess ( "title" [, "text"] )

Success: Returns a numeric Process ID (PID).

send to proces i dono if its posigle directly

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

First: This works. Many thanks.

But I'm still not sure what this "Edit1" as 3rd parameter is from.

How can I retrieve this parameter from other applications?

XspYroX

Edited by xspyrox
Link to comment
Share on other sites

First: This works. Many thanks.

But I'm still not sure what this "Edit1" as 3rd parameter is from.

How can I retrieve this parameter from other applications?

XspYroX

autoit instalation come with "AutoIt Window Info" program used to finde out almost everything from the window

>>>> Window <<<<
Title:  
Class:  
Position:   
Size:   
Style:  
ExStyle:    
Handle: 

>>>> Control <<<<
Class:  
Instance:   
ClassnameNN:    
Advanced (Class):   
ID: 
Text:   
Position:   
Size:   
ControlClick Coords:    
Style:  
ExStyle:    
Handle: 

>>>> Mouse <<<<
Position:   
Cursor ID:  
Color:  

>>>> StatusBar <<<<

>>>> Visible Text <<<<


>>>> Hidden Text <<<<

on its options turn on "highlight controls" if its turned off, and start exploring with your mouse, notepad or any other window you have, and soon youl get what your after for :)

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

This works so great^^. Thanks :)

Now I just have to find out how to read the value of certain memory-adresses^^. I'm trying to search in the forum. If you can tell me in a few sentences, then an answer to this message would be great, too:)

XspYroX

Link to comment
Share on other sites

This works so great^^. Thanks :)

Now I just have to find out how to read the value of certain memory-adresses^^. I'm trying to search in the forum. If you can tell me in a few sentences, then an answer to this message would be great, too:)

XspYroX

i never did use this so i dono if itl help you, NomadMemory.au3

use forum search to find examples on this UDF

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

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