Subversion Repositories projects.vncstarter

Rev

Blame | Last modification | View Log

VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmMainWindow 
   Caption         =   "VNC Viewer Starter"
   ClientHeight    =   3195
   ClientLeft      =   5115
   ClientTop       =   4500
   ClientWidth     =   4650
   Icon            =   "frmMainWindow.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   213
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   310
   Begin MSComctlLib.ListView ListView1 
      Height          =   1350
      Left            =   0
      TabIndex        =   5
      Top             =   465
      Width           =   1395
      _ExtentX        =   2461
      _ExtentY        =   2381
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   2
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "Comments"
         Object.Width           =   5292
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "IP-address"
         Object.Width           =   2778
      EndProperty
   End
   Begin VNCstarter.jjShadeBox jjShadeBox1 
      Align           =   1  'Align Top
      Height          =   465
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   4650
      _ExtentX        =   8202
      _ExtentY        =   820
      ColorA          =   12632256
      ColorB          =   12632256
      BorderColor     =   -2147483632
      MakeRegionLines =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Begin VNCstarter.jjButton jjButton1 
         Height          =   375
         Index           =   6
         Left            =   2610
         TabIndex        =   8
         Top             =   45
         Width           =   375
         _ExtentX        =   661
         _ExtentY        =   661
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         jjButtonStyle   =   2
         FocusRectangle  =   0   'False
         IconDefault     =   "frmMainWindow.frx":0442
         Tooltip         =   "Quit"
      End
      Begin VNCstarter.jjButton jjButton1 
         Height          =   375
         Index           =   5
         Left            =   2205
         TabIndex        =   7
         Top             =   45
         Width           =   375
         _ExtentX        =   661
         _ExtentY        =   661
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         jjButtonStyle   =   2
         FocusRectangle  =   0   'False
         IconDefault     =   "frmMainWindow.frx":059C
         Tooltip         =   "About"
      End
      Begin VNCstarter.jjButton jjButton1 
         Height          =   375
         Index           =   4
         Left            =   1755
         TabIndex        =   6
         Top             =   45
         Width           =   375
         _ExtentX        =   661
         _ExtentY        =   661
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         jjButtonStyle   =   2
         FocusRectangle  =   0   'False
         IconDefault     =   "frmMainWindow.frx":06F6
         Tooltip         =   "Configure VNC Viewer"
      End
      Begin VNCstarter.jjButton jjButton1 
         Height          =   375
         Index           =   3
         Left            =   1305
         TabIndex        =   4
         Top             =   45
         Width           =   375
         _ExtentX        =   661
         _ExtentY        =   661
         Enabled         =   0   'False
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         jjButtonStyle   =   2
         FocusRectangle  =   0   'False
         IconDefault     =   "frmMainWindow.frx":0850
         Tooltip         =   "Click to delete the selected connection"
      End
      Begin VNCstarter.jjButton jjButton1 
         Height          =   375
         Index           =   2
         Left            =   900
         TabIndex        =   3
         Top             =   45
         Width           =   375
         _ExtentX        =   661
         _ExtentY        =   661
         Enabled         =   0   'False
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         jjButtonStyle   =   2
         FocusRectangle  =   0   'False
         IconDefault     =   "frmMainWindow.frx":09AA
         Tooltip         =   "Click to edit the selected connection"
      End
      Begin VNCstarter.jjButton jjButton1 
         Height          =   375
         Index           =   1
         Left            =   495
         TabIndex        =   2
         Top             =   45
         Width           =   375
         _ExtentX        =   661
         _ExtentY        =   661
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         jjButtonStyle   =   2
         FocusRectangle  =   0   'False
         IconDefault     =   "frmMainWindow.frx":0B04
         Tooltip         =   "Click to add a connection"
      End
      Begin VNCstarter.jjButton jjButton1 
         Height          =   375
         Index           =   0
         Left            =   45
         TabIndex        =   1
         Top             =   45
         Width           =   375
         _ExtentX        =   661
         _ExtentY        =   661
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         jjButtonStyle   =   2
         FocusRectangle  =   0   'False
         IconDefault     =   "frmMainWindow.frx":0C5E
         Tooltip         =   "Click to start the selected connection"
      End
      Begin VB.Line Line3 
         BorderColor     =   &H8000000C&
         X1              =   2160
         X2              =   2160
         Y1              =   45
         Y2              =   420
      End
      Begin VB.Line Line2 
         BorderColor     =   &H8000000C&
         X1              =   1710
         X2              =   1710
         Y1              =   45
         Y2              =   420
      End
      Begin VB.Line Line1 
         BorderColor     =   &H8000000C&
         X1              =   450
         X2              =   450
         Y1              =   45
         Y2              =   420
      End
   End
End
Attribute VB_Name = "frmMainWindow"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Form_Load()
    jjShadeBox1.ColorA = &H8000000F
    jjShadeBox1.ColorB = &H8000000F
    Call LesFavoritter
End Sub


Private Sub Form_Resize()
Dim I As Integer

    I = frmMainWindow.WindowState
    If I <> 1 Then
    ListView1.Width = frmMainWindow.ScaleWidth
    ListView1.Height = Me.ScaleHeight - 31
    End If
End Sub


Private Sub jjButton1_Click(Index As Integer)
On Error GoTo PROC_ERR
    Select Case Index
    
        Case 0
            Shell App.Path & "\vncviewer.exe " & ListView1.SelectedItem.SubItems(1), vbNormalFocus
            'Shell "explorer.exe", vbNormalFocus
        Case 1
            gNyAdresse = True
            frmAddEdit.Show vbModal
        Case 2
            gNyAdresse = False
            frmAddEdit.Show vbModal
        Case 3
            Dim f As Integer
            Dim ret As Integer
    
            ret = MsgBox("Are you sure you want to remove the addresse?", vbQuestion + vbYesNo + vbDefaultButton2)
            If ret = vbNo Then Exit Sub
    
            For f = ListView1.ListItems.Count To 1 Step -1
                If ListView1.ListItems(f).Selected = True Then ListView1.ListItems.Remove (f)
            Next f
    
            jjButton1(2).Enabled = False
            jjButton1(3).Enabled = False
            
            Call LagreFavoritter
        Case 4
            Shell App.Path & "\vncviewer.exe", vbNormalFocus
        Case 5
            frmAbout.Show vbModal
        Case 6
            End
            
        Case Else
            Exit Sub
    
    End Select
    
PROC_ERR:
    If Err.Number = 53 Then MsgBox "Could not open the VNC viewer program.", vbCritical
    Resume Next
End Sub


Private Sub ListView1_DblClick()
On Error GoTo PROC_ERR
    Shell App.Path & "\vncviewer.exe " & ListView1.SelectedItem.SubItems(1), vbNormalFocus
    
PROC_ERR:
    If Err.Number = 53 Then MsgBox "Could not open the VNC viewer program.", vbCritical
    Resume Next
End Sub

Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
    If ListView1.ListItems.Count > 0 Then
        jjButton1(2).Enabled = True
        jjButton1(3).Enabled = True
    End If
End Sub


Private Sub ListView1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyDelete Then jjButton1_Click (3)
End Sub