|
-
May 10th, 2013, 09:31 AM
#1
Thread Starter
Member
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.
-
May 11th, 2013, 01:27 AM
#2
Fanatic Member
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
Yes!!!
Working from home is so much better than working in an office...
Nothing can beat the combined stress of getting your work done on time whilst
1. one toddler keeps pressing your AVR's power button
2. one baby keeps crying for milk
3. one child keeps running in and out of the house screaming and shouting
4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
5. working at 1 O'clock in the morning because nobody is awake at that time
6. being grossly underpaid for all your hard work

-
May 11th, 2013, 01:28 AM
#3
Fanatic Member
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
Yes!!!
Working from home is so much better than working in an office...
Nothing can beat the combined stress of getting your work done on time whilst
1. one toddler keeps pressing your AVR's power button
2. one baby keeps crying for milk
3. one child keeps running in and out of the house screaming and shouting
4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
5. working at 1 O'clock in the morning because nobody is awake at that time
6. being grossly underpaid for all your hard work

-
May 11th, 2013, 02:02 AM
#4
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.
-
May 11th, 2013, 02:28 AM
#5
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.
Last edited by Niya; May 11th, 2013 at 02:34 AM.
Reason: Minor grammer error.
-
May 13th, 2013, 02:30 AM
#6
Thread Starter
Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|