1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Visual Basic

Discussion in 'Software Development' started by computerdumb002, Apr 3, 2008.

Thread Status:
Not open for further replies.
  1. computerdumb002

    computerdumb002 Thread Starter

    Joined:
    Mar 4, 2008
    Messages:
    34
    Hi, can anyone show me code that i can apply to a button in Visual Basic to open up a program, i am having trouble... Thanks in advance (Y)
     
  2. leroys1000

    leroys1000 Banned

    Joined:
    Aug 15, 2007
    Messages:
    6,319
  3. Shajahan

    Shajahan

    Joined:
    Apr 6, 2008
    Messages:
    5
    Use Visual Basic's Shell Function as shown in above post.

    Shell Application_Path_and_File, [Application Windo Style]

    Shell "c:\windows\system32\cmd.exe" , vbNormalFocus

    Or use Windows APIs:
    SheExecute:

    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
    Const SW_SHOWNORMAL = 1
    Private Sub Form_Load()
    ShellExecute Me.hwnd, vbNullString, "mailto:[email protected]", vbNullString, "C:\", SW_SHOWNORMAL
    End Sub

    if you want to open a document, Open FindExecutable, ShellExecute or ShellExecuteEx
    Fore more details, Have a download of API Guide
    http://www.freevbcode.com/ShowCode.asp?ID=7073
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/700030

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice