It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Run an application

Moderator: dafunkymunky

Run an application

Postby Acer_iwk on Wed Jul 30, 2008 9:05 pm

HOW TO RUN AN APPLICATION BY A COMMAND BUTTON?
Acer_iwk
 
Posts: 7
Joined: Wed Jul 30, 2008 8:35 pm

Postby Acer_iwk on Wed Jul 30, 2008 9:41 pm

every body ! please help me out here!
I am somewhat new to VB
what's code to run a .exe file e.g. "c:\file.exe" by clicking a comand button?
Acer_iwk
 
Posts: 7
Joined: Wed Jul 30, 2008 8:35 pm

Postby sendtoanurag on Thu Jul 31, 2008 7:13 am

U have to use ShellExecute API

I m giving sample to open a site

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub Form_Load()
Dim r As Long
r = ShellExecute(0, "open", "https://www.meebo.com", 0, 0, 1)

End Sub

Hope it helps
sendtoanurag
 
Posts: 29
Joined: Tue Mar 18, 2008 2:51 pm

Postby Acer_iwk on Thu Jul 31, 2008 11:24 am

Thank You sendtoanurag ! this was what I exactly needed!
THANX for F1.
Acer_iwk
 
Posts: 7
Joined: Wed Jul 30, 2008 8:35 pm

Postby Acer_iwk on Thu Jul 31, 2008 11:27 am

By the way what are thes 0 and 1's for?
what hapens if i modify them and what values take?
Acer_iwk
 
Posts: 7
Joined: Wed Jul 30, 2008 8:35 pm

Postby sendtoanurag on Fri Aug 01, 2008 4:27 am

I am afraid I can't explain all.
Never mind u can get it here
http://www.vb-helper.com/howto_shellexecute.html

If any problem feel free to ask
sendtoanurag
 
Posts: 29
Joined: Tue Mar 18, 2008 2:51 pm

Postby Acer_iwk on Fri Aug 01, 2008 5:56 pm

thanks alot that helped.
Acer_iwk
 
Posts: 7
Joined: Wed Jul 30, 2008 8:35 pm


Who is online

Users browsing this forum: No registered users and 5 guests