Sign in to follow this  
Followers 0
eekhoorn12

can't figur out the controlsend

27 posts in this topic

I can't figur out how the controlsend works. if send my code with this message and the program i am trying to use it on. don't worry its free

Post_program.rar

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#3 ·  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

Share this post


Link to post
Share on other sites

anyone?

Share this post


Link to post
Share on other sites

#5 ·  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]

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#7 ·  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]

Share this post


Link to post
Share on other sites

I've tried every controlid or classname I could find but none worked.

Share this post


Link to post
Share on other sites

#9 ·  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

[center]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.[/center]

Share this post


Link to post
Share on other sites

#10 ·  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

Share this post


Link to post
Share on other sites

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

Does this minimize?

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

[center]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.[/center]

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#13 ·  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

Share this post


Link to post
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...


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
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.

Share this post


Link to post
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.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

No one

Share this post


Link to post
Share on other sites

I have been having problems with Send and ControlSend as well, none of them work for the program I am trying to control as well.


Share this post


Link to post
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
Sign in to follow this  
Followers 0