Visual Basics button

Sharky Forums


Results 1 to 6 of 6

Thread: Visual Basics button

  1. #1
    Sushi
    Join Date
    Jan 2001
    Posts
    2

    Question Visual Basics button

    In Visual Basics what script do you put in the button to get it to execute a batch file?

    Also does anyone know where I can get myself some good tutorials for VB 6.0?

    Thanx

    ------------------
    800mhz @ 880 =D

  2. #2
    Mako Shark dighn's Avatar
    Join Date
    Nov 2000
    Location
    Vancouver, BC Canada
    Posts
    3,171

    Post

    just use the api function "ShellExecute()"

    in VB it would look like this
    ShellExecute 0, "", "patchtobatchfileeg c:\batchfile.bat", "", "", 1

    you gotta declare it first though
    shellexecute can be used to open any registered file

    ------------------
    ??..??!12?@#(?{}
    .

  3. #3
    Sushi
    Join Date
    Jan 2001
    Posts
    2

    Question

    Sorry I'm really new to VB... How do I declare something?

    ------------------
    800mhz @ 880 =D

  4. #4
    Expensive Sushi
    Join Date
    Jan 2001
    Posts
    11

    Lightbulb

    To declare variables you can have either public or private and are declared like:

    Private lVariable As Type
    Type are like String, Boolean, Integer, Double, etc.

    Subs:
    Sub SubName (var1 As Type, var2 As Type...)
    .
    .
    End Sub

    Functions:
    Function FuncName (var1 As......)
    .
    .
    FuncName = "Results"
    End Function

    I hope that helped you out!


    ------------------
    --- Dan

    AMD K7 Athlon 700
    128 MB RAM
    Voodoo 3 2000

    17 years old
    --- Dan

    AMD K7 Athlon 700
    128 MB RAM
    Voodoo 3 2000

    17y

  5. #5
    Super Bunny Mod muisejt's Avatar
    Join Date
    Dec 2000
    Location
    Nova Scotia, Canada
    Posts
    9,833

    Post

    Try this site out. You may want to go to a book store or library and look books on VB programming.

    ------------------
    PIII 800EB
    Tyan Trinity 400
    Voodoo5 5500 AGP
    256MB PC-133 CAS3 RAM (Does CAS2 just fine though)
    SBLive! X-Gamer
    If your sig is longer than your post then type more.

  6. #6
    Mako Shark dighn's Avatar
    Join Date
    Nov 2000
    Location
    Vancouver, BC Canada
    Posts
    3,171

    Post

    declaring an API fuction is not the same thing

    just make a new module and put this line inthe general section: Public 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


    ------------------
    ??..??!12?@#(?{}
    .

Posting Permissions

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