|
-
May 1st, 2008, 05:24 PM
#1
Thread Starter
Hyperactive Member
use vb to run another program on the desktop
i use a program that is inaccessible to being connected to and run via code, but i want to automate the use of it
the first thing i want to do is launch the program
c:\crunchnumbers.exe
then the next thing i want to do is go to the File menu, and select open, and then open c:\numbers.csv
now the numbers are loaded in the program.
the next part is tricky because unfortunately there is no menu item, there is just a big fat 'clickable' button that says 'Calculate' on it. normally i'd have to manually click on it to run the numbers, but i want to use code to do the 'click'
once this is done i need to go back to the file menu and select
c:\crunched.txt
from there i can grab the text file and have my vb prog take it from there
-
May 1st, 2008, 05:59 PM
#2
Re: use vb to run another program on the desktop
Find out the position of the button on screen, use Mouse_Event API call.
Or if the button has a shortcut-key, activate the window then SendKeys.
Or if {Tab} keys can be sent to move focus to the button then send {Enter} or {Space} key.
-
May 1st, 2008, 09:32 PM
#3
Hyperactive Member
Re: use vb to run another program on the desktop
using ACTool would be the easiest way
-
May 2nd, 2008, 11:14 AM
#4
Member
Re: use vb to run another program on the desktop
Code:
Private Sub Form_Load()
TmrClick.Interval = 10000 '10 seconds
Enable TmrClick
End Sub
Private Sub TmrClick_Timer()
Command1_Click
TmrClick.Enabled = False 'turn off the timer, it's use is done.
End Sub
_____________________________
. Error Code 34: There is no error .
-
May 2nd, 2008, 12:13 PM
#5
Hyperactive Member
Re: use vb to run another program on the desktop
If you have access to the code of the app you want to run, it can all be a piece of cake. Just automate the processes using command line parameters and then you can go on and just call the prog with required parameters.
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
|