Jump to content

Controlsend to 2 program with the same name


Recommended Posts

Hello everyone!

There are 2 running programs with the same name for example Notepad - Untitled both the programs going in the background, how can i make a ControlSend command for these windows (1 for the 1st window, and 1 for the 2nd, or 1 for both the windows)?

Please help me. Thank you!

Link to comment
Share on other sites

Best thing to do is to get the instances.

You can do this by identifying the window title if they are different.

If they are not different, you can try something similar to this function I wrote for a StealthBot program (note: I only checked a max of 10 instances):

For $i = 1 To 10
        If StringInStr(WinGetTitle("[CLASS:ThunderRT6FormDC; INSTANCE:" & $i & "]"), $SB_User) > 0 Then
            $stealthbotwin = WinGetProcess("[CLASS:ThunderRT6FormDC; INSTANCE:" & $i & "]")
            MsgBox(0, "Attach Successful", "Successfuly attached to Stealthbot window with user " & $SB_User)
            Log_Action("Successfuly attached to Stealthbot window with user " & $SB_User)
            Return
        EndIf
    Next

[center][/center]

Link to comment
Share on other sites

Quick and easy way is to get the handle when you first create the window and use that to refer to it from then on. The title can change or might not be unique, but the window handle is guaranteed to be unique and not change for the life of that window.

:idea:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Quick and easy way is to get the handle when you first create the window and use that to refer to it from then on. The title can change or might not be unique, but the window handle is guaranteed to be unique and not change for the life of that window.

:idea:

it's better for me, (i don't understand the other) thank you
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...