Projects

Find all our projects in development below.
All source code is GNU General Public License (GPL)

QuickQuery Half-Life Edition

Browsing QuickQuery HL Edition/AddProgramForm.frm (9.12 KB)

VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form AddProgramForm 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   2775
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   5685
   ClipControls    =   0   'False
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "AddProgramForm.frx":0000
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2775
   ScaleWidth      =   5685
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.ComboBox cboPP 
      Height          =   315
      ItemData        =   "AddProgramForm.frx":000C
      Left            =   1800
      List            =   "AddProgramForm.frx":0022
      Style           =   2  'Dropdown List
      TabIndex        =   12
      Top             =   1560
      Width           =   3375
   End
   Begin VB.CommandButton Command5 
      Caption         =   "..."
      Height          =   255
      Left            =   5280
      Style           =   1  'Graphical
      TabIndex        =   5
      ToolTipText     =   "Browse for folder"
      Top             =   500
      Width           =   300
   End
   Begin VB.TextBox txtPath 
      Height          =   315
      Left            =   1800
      MaxLength       =   1000
      TabIndex        =   4
      Top             =   480
      Width           =   3375
   End
   Begin VB.CommandButton Command4 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   375
      Left            =   3120
      TabIndex        =   15
      Top             =   2280
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "OK"
      Default         =   -1  'True
      Height          =   375
      Left            =   1800
      TabIndex        =   14
      Top             =   2280
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Height          =   255
      Left            =   5280
      Picture         =   "AddProgramForm.frx":0061
      Style           =   1  'Graphical
      TabIndex        =   8
      ToolTipText     =   "Click for command line help"
      Top             =   855
      Width           =   300
   End
   Begin VB.CommandButton Command3 
      Caption         =   "..."
      Height          =   255
      Left            =   5280
      Style           =   1  'Graphical
      TabIndex        =   2
      ToolTipText     =   "Browse for program"
      Top             =   120
      Width           =   300
   End
   Begin VB.ComboBox cboRun 
      Height          =   315
      ItemData        =   "AddProgramForm.frx":00F0
      Left            =   1800
      List            =   "AddProgramForm.frx":00FD
      Style           =   2  'Dropdown List
      TabIndex        =   10
      Top             =   1200
      Width           =   3375
   End
   Begin VB.TextBox txtCmd 
      Height          =   315
      Left            =   1800
      MaxLength       =   1000
      TabIndex        =   7
      Top             =   840
      Width           =   3375
   End
   Begin VB.TextBox txtTarget 
      Height          =   315
      Left            =   1800
      MaxLength       =   1000
      TabIndex        =   1
      Top             =   120
      Width           =   3375
   End
   Begin VB.CheckBox chkClose 
      Caption         =   "&End program when Half-Life terminates"
      Height          =   255
      Left            =   1800
      TabIndex        =   13
      ToolTipText     =   "Determines whether to end the program when Half-Life is terminated"
      Top             =   1920
      Width           =   3255
   End
   Begin MSComDlg.CommonDialog EXEDialog 
      Left            =   0
      Top             =   0
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
      DialogTitle     =   "Browse for program"
      Filter          =   "Program Files (*.exe;*.com)|*.exe;*.com|All Files (*.*)|*.*"
   End
   Begin VB.Label lblPP 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "&Process Priority:"
      Height          =   255
      Left            =   240
      TabIndex        =   11
      Top             =   1620
      Width           =   1455
   End
   Begin VB.Label lblStart 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "&Start in:"
      Height          =   255
      Left            =   120
      TabIndex        =   3
      Top             =   525
      Width           =   1575
   End
   Begin VB.Image ProgImg 
      Height          =   480
      Left            =   120
      Picture         =   "AddProgramForm.frx":0126
      Top             =   2160
      Width           =   480
   End
   Begin VB.Label lblRun 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "&Run:"
      Height          =   255
      Left            =   240
      TabIndex        =   9
      Top             =   1245
      Width           =   1455
   End
   Begin VB.Label lblCmd 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "&Cmd Line Arguments:"
      Height          =   255
      Left            =   120
      TabIndex        =   6
      ToolTipText     =   "Command Line Arguments"
      Top             =   885
      Width           =   1575
   End
   Begin VB.Label lblTarget 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "&Target:"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   165
      Width           =   1575
   End
End
Attribute VB_Name = "AddProgramForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Public ListIndex As Long

Private Sub Command1_Click()
    MsgBox "Command Line Argument variables:" + vbCrLf + vbCrLf + _
    "%address% - Inserts the server's address." + vbCrLf + _
    "%game% - Inserts the game type." + vbCrLf + _
    "%pass% - Inserts the password the user entered for the server." + vbCrLf + vbCrLf + _
    "Note: All variables are case sensative.", vbInformation, _
    "Command Line Help"
End Sub

Private Sub Command2_Click()
Dim objListItem As Object
    If (cboPP.ListIndex = 1 Or cboPP.ListIndex = 3) And Not IsCompatible() Then
        MsgBox "Below Normal and Above Normal process priorities are only available on Windows 2000 or later operating systems.", vbExclamation
        cboPP.SetFocus
        Exit Sub
    End If
    If ListIndex = 0 Then
        Set objListItem = OptionsForm.LVPrograms.ListItems.Add()
    Else
        Set objListItem = OptionsForm.LVPrograms.ListItems(ListIndex)
    End If
    With objListItem
        .Text = txtTarget.Text
        .SubItems(1) = txtPath.Text
        .SubItems(2) = txtCmd.Text
        Select Case cboRun.ListIndex
            Case 1
                .SubItems(3) = "Minimized"
            Case 2
                .SubItems(3) = "Maximized"
            Case Else
                .SubItems(3) = "Normal"
        End Select
        .SubItems(4) = CStr(cboPP.ListIndex)
        Select Case chkClose.Value
            Case 1
                .SubItems(5) = "True"
            Case Else
                .SubItems(5) = "False"
        End Select
    End With
    If ListIndex = 0 Then
        objListItem.Selected = True
        objListItem.EnsureVisible
        LV_CheckItem OptionsForm.LVPrograms, objListItem.Index - 1, True
    End If
    Set objListItem = Nothing
    Unload Me
End Sub

Private Sub Command3_Click()
On Error GoTo CancelErr
    EXEDialog.FileName = txtTarget.Text
    EXEDialog.ShowOpen
    txtTarget.Text = EXEDialog.FileName
    txtTarget.SetFocus
    txtTarget.SelStart = 0
    txtTarget.SelLength = Len(txtTarget.Text)
    If InStr(txtTarget.Text, "\") Then txtPath.Text = Left(txtTarget.Text, InStrRev(txtTarget.Text, "\") - 1)
    If Right(txtPath.Text, 1) = ":" Then txtPath.Text = txtPath.Text + "\"
CancelErr:
End Sub

Private Sub Command4_Click()
    Unload Me
End Sub

Private Sub Command5_Click()
Dim strFolder As String
    strFolder = FolderBrowse(hWnd, "Browsing for folder...")
    If strFolder <> "" Then txtPath.Text = strFolder
End Sub

Private Sub Form_Load()
    EXEDialog.flags = cdlOFNOverwritePrompt + cdlOFNLongNames + cdlOFNHideReadOnly
    cboRun.ListIndex = 0
    cboPP.ListIndex = 2
    CButton Command3
    CButton Command5
    If OptionsForm.chkWait.Value = 0 Then chkClose.Enabled = False
End Sub


Download QuickQuery HL Edition/AddProgramForm.frm

Back to file list


Back to project page