Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing MainForm.frm (25.50 KB)
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form MainForm
BorderStyle = 1 'Fixed Single
Caption = "Gateway Multi-function Keyboard Utility Setup"
ClientHeight = 3510
ClientLeft = 45
ClientTop = 330
ClientWidth = 6390
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "MainForm.frx":0000
MaxButton = 0 'False
ScaleHeight = 3510
ScaleWidth = 6390
StartUpPosition = 2 'CenterScreen
Begin VB.PictureBox TSBack
BorderStyle = 0 'None
Height = 1335
Index = 0
Left = 240
ScaleHeight = 1335
ScaleWidth = 5895
TabIndex = 31
TabStop = 0 'False
Top = 1320
Width = 5895
Begin VB.CheckBox chkCDPlayer
Caption = "Enable Windows &CD Player Support"
Height = 255
Left = 120
TabIndex = 2
Top = 960
Value = 1 'Checked
Width = 5655
End
Begin VB.CheckBox chkWMP
Caption = "Enable Windows &Media Player Support"
Height = 255
Left = 120
TabIndex = 1
Top = 600
Value = 1 'Checked
Width = 5655
End
Begin VB.CheckBox chkWinamp
Caption = "Enable &Winamp Support"
Height = 255
Left = 120
TabIndex = 0
Top = 240
Value = 1 'Checked
Width = 5655
End
End
Begin VB.PictureBox TSBack
BorderStyle = 0 'None
Height = 1335
Index = 7
Left = 240
ScaleHeight = 1335
ScaleWidth = 5895
TabIndex = 41
TabStop = 0 'False
Top = 1320
Width = 5895
Begin VB.ComboBox cboWAKeyBind
Enabled = 0 'False
Height = 315
ItemData = "MainForm.frx":0442
Left = 3000
List = "MainForm.frx":0455
Style = 2 'Dropdown List
TabIndex = 23
Top = 560
Width = 1695
End
Begin VB.PictureBox WATitlePic
BackColor = &H00C00000&
Enabled = 0 'False
Height = 255
Left = 3000
ScaleHeight = 195
ScaleWidth = 315
TabIndex = 25
ToolTipText = "Click to change color"
Top = 960
Width = 375
End
Begin VB.CheckBox chkWADisp
Caption = "&Allow Displaying of Winamp Song Title"
Height = 255
Left = 120
TabIndex = 21
Top = 240
Width = 5655
End
Begin VB.Label lblKeyBind
Caption = "Winamp Song Title Display &Hotkey:"
Enabled = 0 'False
Height = 255
Left = 405
TabIndex = 22
Top = 600
Width = 2535
End
Begin VB.Label lblWATitleColor
Caption = "Winamp Song Title Display &Color:"
Enabled = 0 'False
Height = 255
Left = 405
TabIndex = 24
Top = 975
Width = 2415
End
End
Begin VB.PictureBox TSBack
BorderStyle = 0 'None
Height = 1335
Index = 6
Left = 240
ScaleHeight = 1335
ScaleWidth = 5895
TabIndex = 39
TabStop = 0 'False
Top = 1320
Width = 5895
Begin VB.TextBox txtSleep
Height = 315
Left = 120
TabIndex = 19
Top = 480
Width = 5175
End
Begin VB.CommandButton cmdSleep
Caption = "..."
Height = 255
Left = 5400
Style = 1 'Graphical
TabIndex = 20
ToolTipText = "Browse..."
Top = 500
Width = 375
End
Begin VB.Label lblSleep
Caption = "&Launch Program:"
Height = 255
Left = 120
TabIndex = 18
Top = 240
Width = 1335
End
End
Begin VB.PictureBox TSBack
BorderStyle = 0 'None
Height = 1335
Index = 1
Left = 240
ScaleHeight = 1335
ScaleWidth = 5895
TabIndex = 38
TabStop = 0 'False
Top = 1320
Width = 5895
Begin VB.CheckBox chkDisplayVolume
Caption = "&Show volume display on volume change"
Height = 255
Left = 120
TabIndex = 3
Top = 240
Value = 1 'Checked
Width = 5655
End
Begin VB.PictureBox VolPic
BackColor = &H00C00000&
Height = 255
Left = 2080
ScaleHeight = 195
ScaleWidth = 315
TabIndex = 5
ToolTipText = "Click to change color"
Top = 600
Width = 375
End
Begin VB.Label lblColor
Caption = "&Volume Display Color:"
Height = 255
Left = 400
TabIndex = 4
Top = 615
Width = 1575
End
End
Begin VB.PictureBox TSBack
BorderStyle = 0 'None
Height = 1335
Index = 2
Left = 240
ScaleHeight = 1335
ScaleWidth = 5895
TabIndex = 34
TabStop = 0 'False
Top = 1320
Width = 5895
Begin VB.TextBox txtHelp
Height = 315
Left = 120
TabIndex = 7
Top = 480
Width = 5175
End
Begin VB.CommandButton cmdHelp
Caption = "..."
Height = 255
Left = 5400
Style = 1 'Graphical
TabIndex = 8
ToolTipText = "Browse..."
Top = 495
Width = 375
End
Begin VB.Label lblHelp
Caption = "&Launch Program:"
Height = 255
Left = 120
TabIndex = 6
Top = 240
Width = 1335
End
End
Begin VB.PictureBox TSBack
BorderStyle = 0 'None
Height = 1335
Index = 8
Left = 240
ScaleHeight = 1335
ScaleWidth = 5895
TabIndex = 40
TabStop = 0 'False
Top = 1320
Width = 5895
Begin VB.CheckBox chkStartup
Caption = "&Run the Gateway Multi-function Keyboard Utility on startup"
Height = 255
Left = 120
TabIndex = 26
Top = 240
Value = 1 'Checked
Width = 5445
End
End
Begin MSComDlg.CommonDialog ColorDialog
Left = 480
Top = 0
_ExtentX = 847
_ExtentY = 847
_Version = 393216
CancelError = -1 'True
End
Begin MSComDlg.CommonDialog BrowseDialog
Left = 0
Top = 0
_ExtentX = 847
_ExtentY = 847
_Version = 393216
CancelError = -1 'True
DialogTitle = "Browse for Program"
Filter = "Program Files (*.exe;*.com)|*.exe;*.com"
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "Cancel"
Height = 375
Left = 5040
TabIndex = 29
Top = 3000
Width = 1215
End
Begin VB.CommandButton cmdOK
Caption = "OK"
Default = -1 'True
Height = 375
Left = 3720
TabIndex = 28
Top = 3000
Width = 1215
End
Begin VB.CommandButton cmdAbout
Caption = "&About"
Height = 375
Left = 120
TabIndex = 27
Top = 3000
Width = 1215
End
Begin VB.PictureBox TitleBox
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
Height = 495
Left = 240
ScaleHeight = 495
ScaleWidth = 5895
TabIndex = 32
TabStop = 0 'False
Top = 840
Width = 5895
Begin VB.Image SmallIcon
Height = 240
Left = 5520
Picture = "MainForm.frx":04A5
Top = 120
Width = 240
End
Begin VB.Label TitleLabel
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "CD/DVD Controls"
BeginProperty Font
Name = "Tahoma"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 120
TabIndex = 33
Top = 120
Width = 2100
End
End
Begin VB.PictureBox TSBack
BorderStyle = 0 'None
Height = 1335
Index = 3
Left = 240
ScaleHeight = 1335
ScaleWidth = 5895
TabIndex = 35
TabStop = 0 'False
Top = 1320
Width = 5895
Begin VB.TextBox txtInternet
Height = 315
Left = 120
TabIndex = 10
Top = 480
Width = 5175
End
Begin VB.CommandButton cmdInternet
Caption = "..."
Height = 255
Left = 5400
Style = 1 'Graphical
TabIndex = 11
ToolTipText = "Browse..."
Top = 495
Width = 375
End
Begin VB.Label lblInternet
Caption = "&Launch Program:"
Height = 255
Left = 120
TabIndex = 9
Top = 240
Width = 1335
End
End
Begin VB.PictureBox TSBack
BorderStyle = 0 'None
Height = 1335
Index = 4
Left = 240
ScaleHeight = 1335
ScaleWidth = 5895
TabIndex = 36
TabStop = 0 'False
Top = 1320
Width = 5895
Begin VB.TextBox txtEmail
Height = 315
Left = 120
TabIndex = 13
Top = 480
Width = 5175
End
Begin VB.CommandButton cmdEmail
Caption = "..."
Height = 255
Left = 5400
Style = 1 'Graphical
TabIndex = 14
ToolTipText = "Browse..."
Top = 495
Width = 375
End
Begin VB.Label lblEmail
Caption = "&Launch Program:"
Height = 255
Left = 120
TabIndex = 12
Top = 240
Width = 1335
End
End
Begin VB.PictureBox TSBack
BorderStyle = 0 'None
Height = 1335
Index = 5
Left = 240
ScaleHeight = 1335
ScaleWidth = 5895
TabIndex = 37
TabStop = 0 'False
Top = 1320
Width = 5895
Begin VB.CommandButton cmdShortcut
Caption = "..."
Height = 255
Left = 5400
Style = 1 'Graphical
TabIndex = 17
ToolTipText = "Browse..."
Top = 495
Width = 375
End
Begin VB.TextBox txtShortcut
Height = 315
Left = 120
TabIndex = 16
Top = 480
Width = 5175
End
Begin VB.Label lblShortcut
Caption = "&Launch Program:"
Height = 255
Left = 120
TabIndex = 15
Top = 240
Width = 1335
End
End
Begin MSComctlLib.TabStrip MainTab
Height = 2655
Left = 120
TabIndex = 30
Top = 120
Width = 6135
_ExtentX = 10821
_ExtentY = 4683
MultiRow = -1 'True
HotTracking = -1 'True
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 9
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "CD/DVD Controls"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Volume Controls"
ImageVarType = 2
EndProperty
BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Help Button"
ImageVarType = 2
EndProperty
BeginProperty Tab4 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Internet Button"
ImageVarType = 2
EndProperty
BeginProperty Tab5 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "E-mail Button"
ImageVarType = 2
EndProperty
BeginProperty Tab6 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Shortcut Button"
ImageVarType = 2
EndProperty
BeginProperty Tab7 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Sleep Button"
ImageVarType = 2
EndProperty
BeginProperty Tab8 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Winamp"
ImageVarType = 2
EndProperty
BeginProperty Tab9 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Options"
ImageVarType = 2
EndProperty
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
Attribute VB_Name = "MainForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function ShellAbout Lib "shell32" Alias "ShellAboutA" (ByVal hWnd As Long, ByVal szApp As String, ByVal szOtherStuff As String, ByVal hIcon As Long) As Long
Private Const RegAppRoot = "Software\Jason's PC Software\Gateway Multi-function Keyboard Utility\"
Sub SetTabIndex(TabIndex As Integer)
Dim i As Integer
For i = TSBack.LBound To TSBack.UBound
TSBack(i).Enabled = IIf(TabIndex = i, True, False)
Next i
TSBack(TabIndex).ZOrder 0
TitleLabel.Caption = MainTab.SelectedItem.Caption
End Sub
Private Sub chkDisplayVolume_Click()
If chkDisplayVolume.Value = 0 Then
lblColor.Enabled = False
VolPic.Enabled = False
Else
lblColor.Enabled = True
VolPic.Enabled = True
End If
End Sub
Private Sub chkWADisp_Click()
If chkWADisp.Value = 0 Then
lblKeyBind.Enabled = False
cboWAKeyBind.Enabled = False
lblWATitleColor.Enabled = False
WATitlePic.Enabled = False
Else
lblKeyBind.Enabled = True
cboWAKeyBind.Enabled = True
lblWATitleColor.Enabled = True
WATitlePic.Enabled = True
End If
End Sub
Private Sub cmdAbout_Click()
ShellAbout hWnd, "Gateway Multi-function Keyboard Utility", _
"Version: " & App.Major & "." & App.Minor & _
IIf(App.Revision = 0, "", "." & App.Revision) & vbCrLf + _
"Programmed By Jason's PC Software", Icon
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdEmail_Click()
On Error GoTo CancelErr
BrowseDialog.FileName = txtEmail.Text
BrowseDialog.ShowOpen
txtEmail.Text = BrowseDialog.FileName
txtEmail.SetFocus
txtEmail.SelStart = 0
txtEmail.SelLength = Len(txtEmail.Text)
CancelErr:
End Sub
Private Sub cmdHelp_Click()
On Error GoTo CancelErr
BrowseDialog.FileName = txtHelp.Text
BrowseDialog.ShowOpen
txtHelp.Text = BrowseDialog.FileName
txtHelp.SetFocus
txtHelp.SelStart = 0
txtHelp.SelLength = Len(txtHelp.Text)
CancelErr:
End Sub
Private Sub cmdInternet_Click()
On Error GoTo CancelErr
BrowseDialog.FileName = txtInternet.Text
BrowseDialog.ShowOpen
txtInternet.Text = BrowseDialog.FileName
txtInternet.SetFocus
txtInternet.SelStart = 0
txtInternet.SelLength = Len(txtInternet.Text)
CancelErr:
End Sub
Private Sub cmdOK_Click()
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Winamp Support", CStr(chkWinamp.Value)
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "WMP Support", CStr(chkWMP.Value)
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "CDPlayer Support", CStr(chkCDPlayer.Value)
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Display Volume", CStr(chkDisplayVolume.Value)
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Volume Display Color", CStr(VolPic.BackColor)
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Display Winamp Song Title", CStr(chkWADisp.Value)
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Display Winamp Song Title Hotkey", CStr(cboWAKeyBind.ListIndex)
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Winamp Song Title Display Color", CStr(WATitlePic.BackColor)
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Help Button", txtHelp.Text
If txtHelp.Text = "" Then SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Help Button", ""
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Internet Button", txtInternet.Text
If txtInternet.Text = "" Then SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Internet Button", ""
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Email Button", txtEmail.Text
If txtEmail.Text = "" Then SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Email Button", ""
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Shortcut Button", txtShortcut.Text
If txtShortcut.Text = "" Then SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Shortcut Button", ""
SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Sleep Button", txtSleep.Text
If txtSleep.Text = "" Then SaveRegString HKEY_LOCAL_MACHINE, RegAppRoot, "Sleep Button", ""
If chkStartup.Value = 1 Then
SaveRegString HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run\", "Gateway Multi-function Keyboard Utility", """" + LCase(App.Path + IIf(Right(App.Path, 1) <> "\", "\", "")) + "Keyboard Utility.exe"""
Else
DeleteValue HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run\", "Gateway Multi-function Keyboard Utility"
End If
Unload Me
End Sub
Private Sub cmdShortcut_Click()
On Error GoTo CancelErr
BrowseDialog.FileName = txtShortcut.Text
BrowseDialog.ShowOpen
txtShortcut.Text = BrowseDialog.FileName
txtShortcut.SetFocus
txtShortcut.SelStart = 0
txtShortcut.SelLength = Len(txtShortcut.Text)
CancelErr:
End Sub
Private Sub cmdSleep_Click()
On Error GoTo CancelErr
BrowseDialog.FileName = txtSleep.Text
BrowseDialog.ShowOpen
txtSleep.Text = BrowseDialog.FileName
txtSleep.SetFocus
txtSleep.SelStart = 0
txtSleep.SelLength = Len(txtSleep.Text)
CancelErr:
End Sub
Private Sub Form_Load()
On Error Resume Next
Dim lRegData As Long
Dim bRegErr As Boolean
BrowseDialog.Flags = cdlOFNOverwritePrompt + cdlOFNLongNames + cdlOFNHideReadOnly
ColorDialog.Flags = cdlCCRGBInit + cdlCCFullOpen
CButton cmdHelp
CButton cmdInternet
CButton cmdEmail
CButton cmdShortcut
CButton cmdSleep
SetTabIndex 0
lRegData = Val(GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "Winamp Support", bRegErr))
If (lRegData <> 0 And lRegData <> 1) Or bRegErr Then lRegData = 1
chkWinamp.Value = lRegData
lRegData = Val(GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "WMP Support", bRegErr))
If (lRegData <> 0 And lRegData <> 1) Or bRegErr Then lRegData = 1
chkWMP.Value = lRegData
lRegData = Val(GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "CDPlayer Support", bRegErr))
If (lRegData <> 0 And lRegData <> 1) Or bRegErr Then lRegData = 1
chkCDPlayer.Value = lRegData
lRegData = Val(GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "Display Volume", bRegErr))
If (lRegData <> 0 And lRegData <> 1) Or bRegErr Then lRegData = 1
chkDisplayVolume.Value = lRegData
lRegData = Val(GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "Volume Display Color", bRegErr))
If bRegErr Then lRegData = &HC00000
VolPic.BackColor = lRegData
lRegData = Val(GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "Display Winamp Song Title", bRegErr))
If (lRegData <> 0 And lRegData <> 1) Or bRegErr Then lRegData = 0
chkWADisp.Value = lRegData
lRegData = Val(GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "Display Winamp Song Title Hotkey", bRegErr))
If (lRegData < 0 Or lRegData > 4) Or bRegErr Then lRegData = 0
cboWAKeyBind.ListIndex = lRegData
lRegData = Val(GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "Winamp Song Title Display Color", bRegErr))
If bRegErr Then lRegData = &HC00000
WATitlePic.BackColor = lRegData
txtHelp.Text = GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "Help Button")
txtInternet.Text = GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "Internet Button")
txtEmail.Text = GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "Email Button")
txtShortcut.Text = GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "Shortcut Button")
txtSleep.Text = GetRegString(HKEY_LOCAL_MACHINE, RegAppRoot, "Sleep Button")
SubClassTabstripWnd MainTab
End Sub
Private Sub Form_Unload(Cancel As Integer)
UnSubClassTabstripWnd MainTab
End
End Sub
Private Sub MainTab_Click()
SetTabIndex MainTab.SelectedItem.Index - 1
End Sub
Private Sub txtInterval_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then Exit Sub
KeyAscii = 0
End Sub
Private Sub txtInterval_LostFocus()
txtInterval.Text = Val(txtInterval.Text)
End Sub
Private Sub VolPic_Click()
On Error GoTo CancelErr
ColorDialog.Color = VolPic.BackColor
ColorDialog.ShowColor
VolPic.BackColor = ColorDialog.Color
CancelErr:
End Sub
Private Sub VolPic_GotFocus()
VolPic_Click
End Sub
Private Sub WATitlePic_Click()
On Error GoTo CancelErr
ColorDialog.Color = WATitlePic.BackColor
ColorDialog.ShowColor
WATitlePic.BackColor = ColorDialog.Color
CancelErr:
End Sub
Private Sub WATitlePic_GotFocus()
WATitlePic_Click
End Sub