Jump to content

controlsend function


Recommended Posts

hello,

i am having a strange error with ControlSend function.

What i want to do is send keys to an inactive windows.

It works just fine but when i type something in MS Word for example

and i press SHIFT or CTRL or ALT everything becomes crazy. Random caps lock on / caps lock off, some of the characters on my keyboard switch to US keyboard.

So can anyone explain to me how to solve this problem

Thank you!

while 1

sleep(100)
    
        If  $a = 1      Then
        ControlSend("notepad", "", "", "3")
        sleep($value*1000)
        EndIf
        
                      If    $b = 1      Then
        ControlSend("notepad", "", "", "4")
        sleep($value*1000)
        EndIf
WEnd
Edited by amakrkr
Link to comment
Share on other sites

Currently, your controlsend dosent know which control of the window to act on, because you have no controlID set (third parameter)

You can get its ID by using the windowinfotool.

yeah i know

problem is my windows dont have any controls thos i cant put in the 3rd value.

Link to comment
Share on other sites

Well its going to be dependant on what control you are sending to, and the rest of your code.

My notepad edit control has an ID 0f 15, and its never called just, "notepad".

yea nvm that i just have put that window as an example. in my program i use other window that dont have any controls.

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