Visual Basic
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Tutorialized ForumsDesktop ProgrammingVisual Basic

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old March 18th, 2005, 04:00 PM
daggerz.x. daggerz.x. is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Indiana
Posts: 14 daggerz.x. New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to daggerz.x. Send a message via Yahoo to daggerz.x.
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!
__________________

Reply With Quote
  #2  
Old October 29th, 2008, 11:08 PM
yeds13 yeds13 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 1 yeds13 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 31 sec
Reputation Power: 0
Question how to control a program using VB6?

Can u help me how to control a program such as Yahoo mesengr? Using VB6? Thanks in advnce!

Reply With Quote
  #3  
Old November 21st, 2008, 08:31 AM
Smackie Smackie is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 1 Smackie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 57 sec
Reputation Power: 0
Quote:
Originally Posted by yeds13
Can u help me how to control a program such as Yahoo mesengr? Using VB6? Thanks in advnce!


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

Reply With Quote
Reply

Viewing: Tutorialized ForumsDesktop ProgrammingVisual Basic > VB6 Tutorial **Creating A Program To Open Other Software**


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek