eekhoorn12 Posted December 6, 2005 Posted December 6, 2005 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 freePost_program.rar
Lemmens Peter Posted December 6, 2005 Posted December 6, 2005 I think you don't send all the correct paramsControlSend ( "title", "text", controlID, "string" [, flag] )Parameterstitle = 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
eekhoorn12 Posted December 6, 2005 Author Posted December 6, 2005 (edited) I've made an imageI'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 December 6, 2005 by eekhoorn12
herewasplato Posted December 7, 2005 Posted December 7, 2005 (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 December 15, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size]
eekhoorn12 Posted December 7, 2005 Author Posted December 7, 2005 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.
herewasplato Posted December 7, 2005 Posted December 7, 2005 (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 December 7, 2005 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size]
eekhoorn12 Posted December 7, 2005 Author Posted December 7, 2005 I've tried every controlid or classname I could find but none worked.
Moderators SmOke_N Posted December 7, 2005 Moderators Posted December 7, 2005 (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 December 7, 2005 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.
eekhoorn12 Posted December 7, 2005 Author Posted December 7, 2005 (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 December 7, 2005 by eekhoorn12
Moderators SmOke_N Posted December 7, 2005 Moderators Posted December 7, 2005 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.
doomkiller Posted December 7, 2005 Posted December 7, 2005 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.
eekhoorn12 Posted December 8, 2005 Author Posted December 8, 2005 (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 December 8, 2005 by eekhoorn12
seandisanti Posted December 8, 2005 Posted December 8, 2005 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...
eekhoorn12 Posted December 8, 2005 Author Posted December 8, 2005 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.
seandisanti Posted December 8, 2005 Posted December 8, 2005 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.
Lemmens Peter Posted December 9, 2005 Posted December 9, 2005 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
eekhoorn12 Posted December 10, 2005 Author Posted December 10, 2005 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.
Drath Posted December 14, 2005 Posted December 14, 2005 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now