Apostelman Posted March 20, 2014 Posted March 20, 2014 Hi, i'm trying to implement AutoitX into my C# Project. I Created a ClassLibrary and added the AutoItX3.Assembly In my Console Project i added the 3 .DLL Files which get copied to the output directory as well. I was able to activate windows, send keys to the focused window and so on... What doesn't work are the commands ControlSend or ControlSetText. I use them like this: AutoItX.Send("{ENTER}"); AutoItX.Sleep(3000); AutoItX.Send("{F6}"); AutoItX.ControlSetText("My Window Title", "", "[NAME:MyTextBox]", "TEST"); ControlSetText just returns 0, nothing happens... If i use the SAME excact code in SciTE everything works like a charme One thing that works from within C# is the following AutoItX.Send("{ENTER}"); AutoItX.Sleep(3000); AutoItX.Send("{F6}"); AutoItX.ControlSetText("", "", "WindowsForms10.EDIT.app.0.2bf8098_r13_ad121", "TEST"); No Window-Title and the ugly Class-Name+Instance. What am i doing wrong? Why is the first code returning 0? Is the a hidden error-message somewhere to be found? Apo
wangzhengbo Posted March 21, 2014 Posted March 21, 2014 Hi, i'm trying to implement AutoitX into my C# Project. I Created a ClassLibrary and added the AutoItX3.Assembly In my Console Project i added the 3 .DLL Files which get copied to the output directory as well. I was able to activate windows, send keys to the focused window and so on... What doesn't work are the commands ControlSend or ControlSetText. I use them like this: AutoItX.Send("{ENTER}"); AutoItX.Sleep(3000); AutoItX.Send("{F6}"); AutoItX.ControlSetText("My Window Title", "", "[NAME:MyTextBox]", "TEST"); ControlSetText just returns 0, nothing happens... If i use the SAME excact code in SciTE everything works like a charme One thing that works from within C# is the following AutoItX.Send("{ENTER}"); AutoItX.Sleep(3000); AutoItX.Send("{F6}"); AutoItX.ControlSetText("", "", "WindowsForms10.EDIT.app.0.2bf8098_r13_ad121", "TEST"); No Window-Title and the ugly Class-Name+Instance. What am i doing wrong? Why is the first code returning 0? Is the a hidden error-message somewhere to be found? Apo Maybe you used wrong controlId in AutoItX.ControlSetText("My Window Title", "", "[NAME:MyTextBox]", "TEST");
Apostelman Posted March 21, 2014 Author Posted March 21, 2014 no, the code wouldn't work in scite either. but it does
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