Jump to content

Recommended Posts

Posted

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

Posted (edited)

I've made an image

Posted Image

I'm trying to puss the second button from the left

I use the line ControlSend("YENC-POWER-POST-A&A-v11b", "", "59392", "^q", 0) but it doesn't work.

Edited by eekhoorn12
Posted (edited)

anyone?

Okay, you asked for it... "anyone", that is.

It seems that you are having trouble with just one or two lines of code... please post them.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted

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.

Posted (edited)

Have you tried ControlFocus and ControlClick?

Also, I do not think that you want the control ID of 59392. Is there a control ID or ClassName for the menu bar?

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

  • Moderators
Posted (edited)

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.

Posted (edited)

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
  • Moderators
Posted

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.

Posted

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.

Posted (edited)

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
Posted

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

Posted

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.

Posted

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

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

Posted

I've been reading things about COM for the past days but I can't figure it out. Could someone give an example with the program I send in my first post. I hope I can figur out everything else on my owne.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...