DFBarracks - Forums




Delta Force Barracks Forums - Powered by XMB 1.9.11
Delta Force Barracks Forums
Not logged in [Login - Register]
Go To Bottom

Printable Version  
Author: Subject: Tutorial Level: Beginner: Launching other programs from your program.
bullet magnet
Captain
****


Avatar


Posts: 263
Registered: 6-26-2005
Member Is Offline

Mood: Modding

[*] posted on 6-29-2007 at 08:19 AM
Tutorial Level: Beginner: Launching other programs from your program.


Sometimes in programming you may want to launch something else from your program, such as notepad, or anything.
This is very simple to do and only takes a few lines of code.

1.) Create a new application. In the toolbox, go under the "Components" Tab and add a "Process"

2.) Ok now we have to tell Visual Basic the other file we want to launch, in this case, ill use Notepad.

To do this, click on the process (notice when you added it to the form, it wasn't on the form, it was placed down below). Now in the properties you need to find, start info, and click on the little plus sign, to make all the Sub-Properties appear.

3.) You'll need to type the file path, and the directory that it is in here:


4.) Now add a button, get to its code view, and type this code:
Code:
[size=3] Process1.EnableRaisingEvents = True Process1.Start MessageBox.Show("Notepad Opened") [/size]


The above code, associated the process with the program, and of course, started the process that we selected back in the properties.

5.) We can also terminate that process, add another button, and get to its code-view, type:
Code:
[size=3] Process1.Kill *optional*MessageBox.Show("Notepad Closed") [/size]


For some reason, Process1.Close does not work.




View user's profile View All Posts By User

  Go To Top

Powered by XMB 1.9.11
XMB Forum Software © 2001-2012 The XMB Group
[Queries: 15] [PHP: 41.8% - SQL: 58.2%]












Copyright © 2002 - 2008 All Rights Reserved - DFBarracks.com
Site Design by A.Bullet - ScreamingDemon.com