home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1999 April / CD_Shareware_Magazine_31.iso / Free / Prg / ShortPath.exe / Form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1998-07-07  |  2.7 KB  |  94 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Convert a Long Path Name to a Short Path Name"
  5.    ClientHeight    =   3690
  6.    ClientLeft      =   4305
  7.    ClientTop       =   2190
  8.    ClientWidth     =   5160
  9.    LinkTopic       =   "Form1"
  10.    LockControls    =   -1  'True
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3690
  14.    ScaleWidth      =   5160
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.DirListBox Dir1 
  17.       Height          =   1440
  18.       Left            =   120
  19.       TabIndex        =   4
  20.       Top             =   480
  21.       Width           =   4935
  22.    End
  23.    Begin VB.CommandButton cmdQuit 
  24.       Caption         =   "&Quit"
  25.       Height          =   375
  26.       Left            =   2040
  27.       TabIndex        =   0
  28.       Top             =   3240
  29.       Width           =   975
  30.    End
  31.    Begin VB.Label Label3 
  32.       Caption         =   "Click a folder to see the long and short path names."
  33.       Height          =   255
  34.       Left            =   120
  35.       TabIndex        =   6
  36.       Top             =   240
  37.       Width           =   3855
  38.    End
  39.    Begin VB.Label lblLong 
  40.       BackColor       =   &H00FFFFFF&
  41.       BorderStyle     =   1  'Fixed Single
  42.       Height          =   255
  43.       Left            =   120
  44.       TabIndex        =   5
  45.       Top             =   2280
  46.       Width           =   4935
  47.    End
  48.    Begin VB.Label lblShort 
  49.       BackColor       =   &H00FFFFFF&
  50.       BorderStyle     =   1  'Fixed Single
  51.       Height          =   255
  52.       Left            =   120
  53.       TabIndex        =   3
  54.       Top             =   2880
  55.       Width           =   4935
  56.    End
  57.    Begin VB.Label Label2 
  58.       Caption         =   "Short Path:"
  59.       Height          =   255
  60.       Left            =   120
  61.       TabIndex        =   2
  62.       Top             =   2640
  63.       Width           =   855
  64.    End
  65.    Begin VB.Label Label1 
  66.       Caption         =   "Long Path:"
  67.       Height          =   255
  68.       Left            =   120
  69.       TabIndex        =   1
  70.       Top             =   2040
  71.       Width           =   975
  72.    End
  73. Attribute VB_Name = "Form1"
  74. Attribute VB_GlobalNameSpace = False
  75. Attribute VB_Creatable = False
  76. Attribute VB_PredeclaredId = True
  77. Attribute VB_Exposed = False
  78. Option Explicit
  79. Private Sub cmdQuit_Click()
  80. Unload Me
  81. End Sub
  82. Private Sub Dir1_Click()
  83. Dim sLongPath  As String
  84. Dim sShortPath As String
  85. Dim lPathLen   As Long
  86. Dim lLen       As Long
  87. Const MAX_PATH = 260
  88. lblLong = Dir1.List(Dir1.ListIndex)
  89. sShortPath = Space$(MAX_PATH)
  90. lLen = Len(sShortPath)
  91. lPathLen = GetShortPathName(lblLong.Caption, sShortPath, lLen)
  92. lblShort.Caption = Left$(sShortPath, lPathLen)
  93. End Sub
  94.