CarlosFrias Posted June 30, 2021 Share Posted June 30, 2021 Hi, I'm trying to create a procedure that can do some repeating actions on a particular program window like typing some commands, clicking some buttons and stuff like that. I'm using the nuget AutoIT (version 3.3.12) package for .net I want to do this using a webAPI hosted on a remote VM, so upon a request the program would do some task and return a result. I've created an ASP.net WebAPI and when I run it from Visual Studio (or Rider) the request goes though and all the autoIT function calls run as expected, but when I deploy the webAPI on IIS and try to make the request the autoIT function call don't appear to work. Everything else works. I've been trying to debug this by logging to a text file and for instance the first AutoIT function that I call is: var hWnd = AutoItX.WinGetHandle(_winTitle); to grab the window handle of the program I want to manipulate, and when I write the hWnd value to the log file I see that that value is zero. Which doesn't happen when running directly from Visual Studio. Maybe I'm missing some permission that I have to give to the API, or missing dlls or something like that. I'm not very experienced on ASP.net, so I could be doing something incorrectly. If someone has any idea on what can be the problem, please help. Kind regards, Carlos Link to comment Share on other sites More sharing options...
TheXman Posted June 30, 2021 Share Posted June 30, 2021 Are you saying that you want to install AutoItX on your web server in order to have AutoItX execute commands on remote computers, through a web API? CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
CarlosFrias Posted June 30, 2021 Author Share Posted June 30, 2021 Hi TheXman, thanks for the reply. Not on remote computers, I want to have AutoItX execute commands on an app running in a server. And those commands would be triggered by http requests. The AutoItX and the App I want it to manipulate would be running both on a remote windows VM. Link to comment Share on other sites More sharing options...
TheXman Posted June 30, 2021 Share Posted June 30, 2021 (edited) Okay, I understand what you are asking and trying to do. If you don't want to have to deal with IIS and ASP.Net, then the HTTPAPI UDF in my signature or one of the other AutoIt-based web servers would be much easier to implement. That would also give you access to all of the AutoIt functionality as opposed to the subset that AutoItX exposes. Edited June 30, 2021 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
CarlosFrias Posted June 30, 2021 Author Share Posted June 30, 2021 Thanks TheXman, I'll have a look at HttpApi UDF Link to comment Share on other sites More sharing options...
TheXman Posted June 30, 2021 Share Posted June 30, 2021 (edited) Mine is basically a wrapper for the Microsoft Win32 HttpAPI APIs. The benefit is that it is documented by Microsoft, there are numerous examples of its implementation on the web, and the Win32 APIs use HTTP standards for communication. This is another light-weight web server that is built upon a different framework. It might be even easier to implement than the HTTPAPI UDF because it is designed specifically around wrapping web services around AutoIt scripts. Edited June 30, 2021 by TheXman tarretarretarre and CarlosFrias 2 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
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