|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
VB6 Tutorial **Creating A Program To Open Other Software**
Ok, this tutorial will teach you how to make a program open other programs. Ok Lets Start.
First open up VB, and create a new stand form. name is Program, and change the caption to "Commonly Used Programs", in the properties box for the form. Now click the image icon and drag it over the form: ![]() In the properties box go down to "picture and select an image that you want. Adjust the size of the image box to fit the image. Keep doing the image icon until you have all the programs you want to have an image on it: ![]() If you have a lot of programs start doing the others in checkboxes instead of images. I recommend only putting like game images, not diff programs like Photoshop: ![]() Create Command Button, and change the caption to "launch!" (see the image above). Double Click the Command Button and write the code you want. This is my code: Code:
Private Sub Command1_Click() Dim cs As String Dim p2p As String Dim lime As String Dim max As String Dim ds As String Dim aware As String Dim spy As String Dim mech As String Dim priv As String cs = Check1.Value p2p = Check2.Value lime = Check3.Value max = Check4.Value ds = Check5.Value aware = Check6.Value spy = Check7.Value mech = Check8.Value priv = Check9.Value If cs = True Then Shell "C:\Program Files\Adobe\Photoshop CS\Photoshop.exe" If p2p = True Then Shell "C:\Program Files\Warez P2P Client\warez.exe" If lime = True Then Shell "C:\Program Files\LimeWire\LimeWire.exe" If max = True Then Shell "C:\Program Files\SWiSHmax\SwishMax.exe" If ds = True Then Shell "C:\3dsmax7\3dsmax.exe" If aware = True Then Shell "C:\Program Files\Lavasoft\Ad-Aware SE Professional\Ad-Aware.exe" If spy = True Then Shell "C:\Program Files\Spybot - Search & Destroy\SpybotSD.exe" If mech = True Then Shell "C:\Program Files\Registry Mechanic\RegMech.exe" If priv = True Then Shell "C:\Program Files\Privacy Guardian\pg.exe" Ok the dim parts states that we want to use the syntex written after 'dim' to specify one of the images we put it, or the textboxes. Example: 'dim cs as string' cs is photoshop cs so instead of typing photoshop cs when we code later we'll type cs instead for shorter. Of course the program doesn't know what 'cs' is so we write this after all the 'dims': Code:
cs = Check1.Value This tells the program that cs is check1.value which is the name of my checkbox that I caption 'Photoshop CS' Do the same for the rest. The next coding is telling the program what to do if one of the checkboxes is checked. Example: (If cs = True Then Shell "C:\Program Files\Adobe\Photoshop CS\Photoshop.exe") This tells the program that if cs (check1.value) is 'True' (in other words is checked), to open "C:\Program Files\Adobe\Photoshop CS\Photoshop.exe" which is where my Photoshop CS is located. The ''Then Shell "C:\Program Files\Adobe\Photoshop CS\Photoshop.exe" Tells the program if check1.value is true 'THEN' open Photoshop CS at the following directory (C:\Program Files\Adobe\Photoshop CS\Photoshop.exe). The shell command just tells it that you want the program to open a file from your computer, then you type the directory of the program. Ok for the image files: Double click them and code it but make needed changes to fit your program directory: This is my code: Code:
Private Sub Picture2_Click() Shell "C:\Program Files\Microsoft Games\Halo\halo.exe" End Sub This tells the program to open 'C:\Program Files\Microsoft Games\Halo\halo.exe'. This is the code to my other image: Code:
Private Sub Picture1_Click() Shell "C:\Program Files\Red Storm Entertainment\RavenShield\system\RavenShield.exe" End Sub This again tells the program to open 'C:\Program Files\Red Storm Entertainment\RavenShield\system\RavenShield.exe'. Just click the image and you will launch the program. For the checkboxes you will need to check them first then click the command button to launch the file. The code above: Example: 'shell HardDriveLetter\Folder\OtherFolder\Filename.exe' If you have any problems email me at king___2004@sbcglobal.net Other than that hope you enjoyed this tutorial!
__________________
|
|
#2
|
|||
|
|||
|
Can u help me how to control a program such as Yahoo mesengr? Using VB6? Thanks in advnce!
|
|
#3
|
|||
|
|||
|
Quote:
if you mean like open it like he is showing to open other programs you will need to do something like this in the code Code:
yim = Check1.Value If yim = True Then Shell "C:\Program Files\Yahoo!\Messenger\YahooMessenger.exe" now incase you have installed your YIM onto a different hard drive just change the location to its location that you have.. now if your talking about accually controlling the whole YIM then i can't help you sorry.. hope this helps Smackie |
![]() |
| Viewing: Tutorialized Forums > Desktop Programming > Visual Basic > VB6 Tutorial **Creating A Program To Open Other Software** |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|