CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Start EXE file

  1. #1
    Join Date
    Jun 2000
    Posts
    104

    Start EXE file

    I have an executable VB file that i want to start on the press of a certain function key or may be a combination of keys.Is that possible? If yes then how?Thanks in advance for any reply.


  2. #2
    Join Date
    Jun 2001
    Location
    Israel
    Posts
    228

    Re: Start EXE file


    private Sub Form_KeyPress(KeyAscii as Integer)
    If KeyAscii = vbKeyA then
    Call Shell("c:\MyApp.exe")
    End If
    End Sub




    ----------
    The @host is everywhere!
    ----------

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Start EXE file

    You can also do it like this:
    private Sub Form_KeyPress(KeyAscii as Integer)
    If KeyAscii = vbKeyA then
    call winexec("c:\MyApp.exe",1)
    End If
    End Sub


    But then you'll have to add the Winexec API function in General Declarations




    F. T. W.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured