Jump to content

Paste Text using _SendMessage to a window


 Share

Recommended Posts

Hey,

I am trying to figure out a way to send text instantly to a window. The problem is its an application that doesn't have any control ID. I only use the Window title to send text.

At the moment, I use something like this and it's working fine.

$winTitle = "Window1"
ClipPut("TEXT")
ControlSend($winTitle, "", "", "^v",0)

The thing is, when I am doing something else, when it presses control (^) to paste it, it interferes with what I am doing. I looked into it, and I found _SendMessage

I tried using it with the window handle and it's not working, nothing is happening.

$hWnd = WinGetHandle($winTitle)
_SendMessage($hWnd, 770, 0, 0)

Am I doing something wrong here ? It's not a big deal, if I can't get it to work, because it interferes for like a second, but it would be nice if it didn't :)

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