Creating a Simple Launcher in VB6 menu

User Tag List

Results 1 to 3 of 3
  1. #1
    aliceamphetamine's Avatar Sergeant
    Reputation
    5
    Join Date
    Mar 2008
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating a Simple Launcher in VB6

    Hi everyone, This is my first guide that I have ever done that relates to World of Warcraft and I am unsure if this is the write forum section for this. Basically, I will show you how to make a simple launcher that will change the realmlist.wtf and allow you to launch the WoW.exe

    Like I said this is my first guide, So please do easy on me.


    For this guide, I would expect readers to know at least a little bit about Visual Basic 6 and how to navigate through the program. (yes, I know Visual Basic 6 is old, But that's how I roll.)

    First off, Let's create a New Standard Exe



    Then click "Open"

    Now then. This will bring up an interface that allows you to basically drag and drop different controls onto your form/application.

    Select the CommandButton control and add two buttons. (These will serve as a button for patching the realmlist.wtf and the other for launching WoW.exe)

    Now Double Click on the first button. It will bring up a text based interface that will allow you to add/edit bits of codes. You should see:
    Code:
    Private Sub Command1_Click()
    
    End Sub
    Above that. Let's first add some goodies to help us with saving the realmlist.wtf and launching wow.

    Add the following bit of code before the Private Sub Command1

    Code:
    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 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
    
    ' Open the default browser on a given URL
    ' Returns True if successful, False otherwise
    
    Public Function OpenBrowser(ByVal URL As String) As Boolean
        Dim res As Long
        
        ' it is mandatory that the URL is prefixed with http:// or https://
        If InStr(1, URL, "http", vbTextCompare) <> 1 Then
            URL = "http://" & URL
        End If
        
        res = ShellExecute(0&, "open", URL, vbNullString, vbNullString, _
            vbNormalFocus)
        OpenBrowser = (res > 32)
    End Function
    Public Function SaveFileFromTB(txtRealm As String, _
    FilePath As String, Optional Append As Boolean = False) _
    As Boolean
    
    'PURPOSE: Saves contents of text control (e.g., Text Box,
    'Rich Text Box) specified by TxtBox to file specified by FilePath
    
    'If Append = true, then TxtBox's contents are
    'appended to existing file contents
    'else existing file is overwritten
    
    'Returns: True if Successful, false otherwise
    
    Dim iFile As Integer
    
    iFile = FreeFile
    If Append Then
    Open FilePath For Append As #iFile
    Else
    Open FilePath For Output As #iFile
    End If
    
    Print #iFile, txtRealm
    SaveFileFromTB = True
    
    ErrorHandler:
    
    Close #iFile
    End Function
    So you code should currently look as such

    Code:
    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 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
    
    ' Open the default browser on a given URL
    ' Returns True if successful, False otherwise
    
    Public Function OpenBrowser(ByVal URL As String) As Boolean
        Dim res As Long
        
        ' it is mandatory that the URL is prefixed with http:// or https://
        If InStr(1, URL, "http", vbTextCompare) <> 1 Then
            URL = "http://" & URL
        End If
        
        res = ShellExecute(0&, "open", URL, vbNullString, vbNullString, _
            vbNormalFocus)
        OpenBrowser = (res > 32)
    End Function
    Public Function SaveFileFromTB(txtRealm As String, _
    FilePath As String, Optional Append As Boolean = False) _
    As Boolean
    
    'PURPOSE: Saves contents of text control (e.g., Text Box,
    'Rich Text Box) specified by TxtBox to file specified by FilePath
    
    'If Append = true, then TxtBox's contents are
    'appended to existing file contents
    'else existing file is overwritten
    
    'Returns: True if Successful, false otherwise
    
    Dim iFile As Integer
    
    iFile = FreeFile
    If Append Then
    Open FilePath For Append As #iFile
    Else
    Open FilePath For Output As #iFile
    End If
    
    Print #iFile, txtRealm
    SaveFileFromTB = True
    
    ErrorHandler:
    
    Close #iFile
    End Function
    
    Private Sub Command1_Click()
    
    End Sub
    For the Private Sub Command1_Click Let's tidy this up so that it will patch the realmlist.wtf

    Code:
    Private Sub Command1_Click()
    SaveFileFromTB "set realmlist", App.Path + "\realmlist.wtf"
    End Sub
    Edit: set realmlist - This should be changed to reflect your realmlist. ( in the format of set realmlist cheese.bounceme.net within the quotation marks.)

    Now for the second button to launch wow.exe

    Code:
    Private Sub Command2_Click()
    Shell (App.Path + "\WoW.exe")
    Unload Me
    End Sub
    That is basically it. Now file save as.. name your project.. Yes i know its not a looker but I will surely write a tutorial on making a GUI for your launcher.

    Remember that for this to work. it needs to be placed in the default/root World of Warcraft directory.(Commonly C:\World of Warcraft or C:\Program Files\World of Warcraft.

    Post questions if you have any.

    Creating a Simple Launcher in VB6
  2. #2
    TuFF's Avatar Contributor
    Reputation
    120
    Join Date
    Aug 2007
    Posts
    352
    Thanks G/R
    6/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice Post
    But Wrong Section, Belongs in Programming > VB6

  3. #3
    X-CON's Avatar Banned
    Reputation
    47
    Join Date
    Aug 2008
    Posts
    187
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea nice post

Similar Threads

  1. Help with creating a simple addon
    By Dante in forum WoW Bots Questions & Requests
    Replies: 2
    Last Post: 03-19-2013, 05:59 PM
  2. [Request] Help me to create a simple macro/bot to collect 2 chests
    By Xiandri in forum SWTOR Bots and Programs
    Replies: 3
    Last Post: 01-06-2012, 01:08 PM
  3. Looking for someone who can create a Simple WoW bot for me.
    By Hellson in forum WoW Bots Questions & Requests
    Replies: 0
    Last Post: 08-11-2010, 03:03 PM
  4. [Buying] Looking for someone who can create a Simple WoW bot for me.
    By Hellson in forum World of Warcraft Buy Sell Trade
    Replies: 0
    Last Post: 08-08-2010, 07:46 PM
  5. [Guide] Create a server launcher. EASY WAY
    By c0ddingt0n in forum WoW EMU Guides & Tutorials
    Replies: 6
    Last Post: 08-05-2008, 03:08 AM
All times are GMT -5. The time now is 09:13 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search