Jump to content

can't figur out the controlsend


Recommended Posts

I think you don't send all the correct params

ControlSend ( "title", "text", controlID, "string" [, flag] )

Parameters

title = The title of the window to access.

text = The text of the window to access.

controlID = The control to interact with. See Controls.

string = String of characters to send to the control.

flag [optional] Changes how "keys" is processed:

flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow.

flag = 1, keys are sent raw.

ControlSend("YENC-POWER-POST-A&A-v11b", "", "", "^q", 0)

You're trying to send ctrl-q to a window with title "YENC-POWER-POST-A&A-v11b" but without knowing the controlId. By the way is Ctrl-q used to add files in pp.exe ? (I didn't check the exe)

If you want to know the title, text and controlID of a window, you can use "AutoIt Window Info" (C:\Program Files\AutoIt_v3\AU3Info.exe) to check the values.

good luck,

Peter

Link to comment
Share on other sites

I'm trying to send ctrl q to the program. I can do that with send but if I use send I cant minimize the window so I try to use controlsend. But it doesn't work. I use ControlSend("YENC-POWER-POST-A&A-v11b", "", "59392", "^q", 0) to send ctrl q but nothing happens. I'm trying to open the window that opens when you click on the second icon from the left. As you can see in the picture 2 posts above this one.

Link to comment
Share on other sites

  • Moderators

WinSetState("YENC-POWER-POST-A&A-v11b", "", @SW_MINIMIZE)
If WinGetState("YENC-POWER-POST-A&A-v11b") = 23 Then
  ;Do something
EndIf

Would that work?

Edit:

Changed 16 to 23, forgot it used BitAnd() to add all the factors together.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Well I don't know what it is but if my code is this:

While 1
 ;Start PowerPost
    run("pp.exe")
 ;wait 4000 milliseconden
    sleep(4000)
    WinSetState("YENC-POWER-POST-A&A-v11b", "", @SW_MINIMIZE)
    exitloop
Wend

Nothing happens

Edited by eekhoorn12
Link to comment
Share on other sites

  • Moderators

What do you mean nothing happens... Does your .exe open?

Does this minimize?

Run("pp.exe", "", @SW_MINIMIZE)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

What do you mean nothing happens... Does your .exe open?

Does this minimize?

Run("pp.exe", "", @SW_MINIMIZE)
Sorry for my bad explanation.

It start pp but it doesn't minimize it.

The code you say there does minimize it but after that the program wouldn't maximize.

Edited by eekhoorn12
Link to comment
Share on other sites

I would like to say (w/o looking at the code) that ControlSend doesn't work all the time. I use it for my script but find tht sometimes it will put text into a box and sometimes it won't.. there is a ControlSendPlus but I have not tried it yet.

i've never had any problems with control send... did you post the issues when your script wasn't doing what you expected it to? Or do you have the script that is having issues to post?

@eek - why are you sending a hotkey to a toolbar? Try control sending to another control in the window, off of the toolbar. I'm at work so can't download your thing to give you the whole solution...

Link to comment
Share on other sites

I've tried every option now. I used the following code:

While 1
   ;Start PowerPost
    run("pp.exe")
    msgbox(0,"test","Gestart")
   ;Wacht 1500 milliseconden
    sleep(4000)
    msgbox(0,"test","geslapen")
    ControlSend("YENC-POWER-POST-A&A-v11b", "", "ToolbarWindow321", "^q", 0)
    msgbox(0,"test","Gezonden")
    exitloop
Wend

For controlsend I used:

ControlSend("YENC-POWER-POST-A&A-v11b", "", "SysListView321", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "59648", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "msctls_statusbar321", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "59393", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "SysHeader321", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "AfxControlBar421", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "59419", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "59392", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "ToolbarWindow321", "^q", 0)

None of them worked.

Link to comment
Share on other sites

I've tried every option now. I used the following code:

While 1
  ;Start PowerPost
    run("pp.exe")
    msgbox(0,"test","Gestart")
  ;Wacht 1500 milliseconden
    sleep(4000)
    msgbox(0,"test","geslapen")
    ControlSend("YENC-POWER-POST-A&A-v11b", "", "ToolbarWindow321", "^q", 0)
    msgbox(0,"test","Gezonden")
    exitloop
Wend

For controlsend I used:

ControlSend("YENC-POWER-POST-A&A-v11b", "", "SysListView321", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "59648", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "msctls_statusbar321", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "59393", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "SysHeader321", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "AfxControlBar421", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "59419", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "59392", "^q", 0)

ControlSend("YENC-POWER-POST-A&A-v11b", "", "ToolbarWindow321", "^q", 0)

None of them worked.

those don't look like MS controls to me... (which are required for controlsend). You may want to get the COM/OLE Object viewer, and use COM interaction to interact with the controls.
Link to comment
Share on other sites

Hi ya all,

I've tried to run your script also.

The ControlSend doesn't work quiet well because the menubar has nothing to identify it. No Id, no class, no text...zip, ziltsh, nada

BUT I tried "Winativate" followed by "Send" and this WORKS !!!

Just try these two functions,

Good luck

Peter

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