Automate a running process
Hi
I use piece of software on my computer to make calls that requires me to log in and out at the end of the day, which sometimes I forget to do.
I was going to automate this to it logs me in and out at my start times but having some trouble getting started.
I know where the dlls that control what I need are and I know the process thats runnings name and PID but not sure how to start controlling this.
I have been toying with GetType but unsure of what exactly needs to go in the string parameter.
Any help appretiated.
Re: Automate a running process
hi
system.diagnostics.Process.GetProcesses gets all running processes
(although i heard there are some special processes you cant access straight away, but i never come accross any)
anyway with a for each loop you can pick 1 out and set a reference to do other things
Re: Automate a running process
hi
system.diagnostics.Process.GetProcesses gets all running processes
(although i heard there are some special processes you cant access straight away, but i never come accross any)
anyway with a for each loop you can pick 1 out and set a reference to do other things
Re: Automate a running process
You can't easily automate something that provides no interface for doing so. Is it a Console application that you type instructions into at the commandline? If it's a Windows app then you can use the Windows API to send messages directly to controls in that app but that is quite convoluted and not necessarily the most robust thing in the world.
Re: Automate a running process
If its a Windowed app, you must first get its main window handle and from there you can get its child windows(controls) and finally you can use the SendMessage API to automate the login. Its tedious to develop but it can be done.
Re: Automate a running process
Thanks guys, sorry for no reply, the weekend called.
I understand about SendMessage and using the API so thats my backup plan but past attempts havent been so good, it think its because the log-off button creates a pop up menu that I can't get the handle for. Maybe this is intentional to stop exactly what I am trying to do haha.
With regards to the GetProcesses I'll give this a go.
Anyone know of any tuts or anything around this? I understand most the theory but a noob when it comes to implementing it.