home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Binary_Fil2075297132007.psc / FileEditHelp.frm < prev    next >
Text File  |  2007-07-05  |  6KB  |  176 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form FileEditHelp 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "File Editor Help"
  6.    ClientHeight    =   3135
  7.    ClientLeft      =   45
  8.    ClientTop       =   435
  9.    ClientWidth     =   7755
  10.    Icon            =   "FileEditHelp.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   3135
  15.    ScaleWidth      =   7755
  16.    ShowInTaskbar   =   0   'False
  17.    StartUpPosition =   3  'Windows Default
  18.    Begin MSComctlLib.ImageList ImageList1 
  19.       Left            =   1470
  20.       Top             =   3150
  21.       _ExtentX        =   1005
  22.       _ExtentY        =   1005
  23.       BackColor       =   -2147483643
  24.       ImageWidth      =   24
  25.       ImageHeight     =   24
  26.       MaskColor       =   12632256
  27.       _Version        =   393216
  28.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  29.          NumListImages   =   2
  30.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  31.             Picture         =   "FileEditHelp.frx":076A
  32.             Key             =   ""
  33.          EndProperty
  34.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  35.             Picture         =   "FileEditHelp.frx":0EE4
  36.             Key             =   ""
  37.          EndProperty
  38.       EndProperty
  39.    End
  40.    Begin VB.Frame Frame2 
  41.       Caption         =   "Description"
  42.       Height          =   2955
  43.       Left            =   3465
  44.       TabIndex        =   1
  45.       Top             =   105
  46.       Width           =   4215
  47.       Begin VB.TextBox Text1 
  48.          BeginProperty Font 
  49.             Name            =   "Courier New"
  50.             Size            =   8.25
  51.             Charset         =   0
  52.             Weight          =   400
  53.             Underline       =   0   'False
  54.             Italic          =   0   'False
  55.             Strikethrough   =   0   'False
  56.          EndProperty
  57.          Height          =   2640
  58.          Left            =   105
  59.          Locked          =   -1  'True
  60.          MultiLine       =   -1  'True
  61.          ScrollBars      =   2  'Vertical
  62.          TabIndex        =   2
  63.          TabStop         =   0   'False
  64.          Top             =   210
  65.          Width           =   4005
  66.       End
  67.    End
  68.    Begin VB.Frame Frame1 
  69.       Caption         =   "Contents"
  70.       Height          =   2955
  71.       Left            =   105
  72.       TabIndex        =   0
  73.       Top             =   105
  74.       Width           =   3270
  75.       Begin MSComctlLib.TreeView TreeView1 
  76.          Height          =   2640
  77.          Left            =   105
  78.          TabIndex        =   3
  79.          Top             =   210
  80.          Width           =   3060
  81.          _ExtentX        =   5398
  82.          _ExtentY        =   4657
  83.          _Version        =   393217
  84.          Indentation     =   706
  85.          LabelEdit       =   1
  86.          Style           =   5
  87.          ImageList       =   "ImageList1"
  88.          Appearance      =   1
  89.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  90.             Name            =   "Arial"
  91.             Size            =   9
  92.             Charset         =   0
  93.             Weight          =   400
  94.             Underline       =   0   'False
  95.             Italic          =   0   'False
  96.             Strikethrough   =   0   'False
  97.          EndProperty
  98.       End
  99.    End
  100. End
  101. Attribute VB_Name = "FileEditHelp"
  102. Attribute VB_GlobalNameSpace = False
  103. Attribute VB_Creatable = False
  104. Attribute VB_PredeclaredId = True
  105. Attribute VB_Exposed = False
  106. Option Explicit
  107. '----------------------------------------------------------\
  108. 'Author: Richard E. Gagnon.                                |
  109. 'URL:    http://members.cox.net/reg501/                    |
  110. 'Email:  reg501@cox.net                                    |
  111. 'Copyright ⌐ 2007 Richard E. Gagnon. All Rights Reserved.  |
  112. '----------------------------------------------------------/
  113.  
  114. Private HelpSpace() As Byte 'Open File Array
  115. Private FSO As New FileSystemObject
  116. Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  117.  
  118. Private Sub Form_Load()
  119. Dim FEH As Long
  120. Dim Node1 As Node, Node2 As Node
  121. Dim Fnum As Integer
  122. Dim HelpFileName As String
  123. Dim sText As String
  124. Dim FL As Long, I As Long, J As Long
  125. Dim SC As Byte, FC As Byte 'Content Beginning and End Identifiers
  126. Dim SS As Byte, FS As Byte 'Subject Beginning and End Identifiers
  127. Dim ST As Byte, FT As Byte 'Text Beginning and End Identifier
  128. Dim FZ As Byte
  129. Dim S1 As Long
  130. Fnum = FreeFile
  131. HelpFileName = App.Path & "\TextHelp.mhf"
  132. Open HelpFileName For Binary Access Read As Fnum
  133. FL = FSO.GetFile(HelpFileName).Size
  134. ReDim HelpSpace(1 To FL)
  135. Get Fnum, , HelpSpace
  136. Close Fnum
  137. TreeView1.Nodes.Clear
  138. FZ = 241 'Start position of Identifiers
  139. SC = HelpSpace(FZ + 0): FC = HelpSpace(FZ + 1)
  140. SS = HelpSpace(FZ + 2): FS = HelpSpace(FZ + 3)
  141. ST = HelpSpace(FZ + 4): FT = HelpSpace(FZ + 5)
  142. For I = FZ + 48 To FL
  143.     Select Case HelpSpace(I)
  144.         Case SC: S1 = I + 1
  145.         Case FC
  146.             sText = ""
  147.             For J = S1 To I - 1: sText = sText & Chr(HelpSpace(J)): Next J
  148.             Set Node1 = TreeView1.Nodes.Add(, , , sText, 1, 1)
  149.         Case SS: S1 = I + 1
  150.         Case FS
  151.             sText = ""
  152.             For J = S1 To I - 1: sText = sText & Chr(HelpSpace(J)): Next J
  153.             Set Node2 = TreeView1.Nodes.Add(Node1.Index, tvwChild, , sText, 2, 2)
  154.         Case ST: S1 = I + 1
  155.         Case FT: Node2.Tag = Str(S1) & "," & Str(I - 1)
  156.     End Select
  157. Next I
  158. FEH = SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, 2 Or 1)
  159. End Sub
  160.  
  161. Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
  162. If Node.Tag <> "" Then
  163.     Dim I As Long
  164.     Dim mTag() As String
  165.     Text1.Text = ""
  166.     mTag = Split(Node.Tag, ",")
  167.     For I = Val(mTag(0)) To Val(mTag(1))
  168.         Text1.SelText = Chr(HelpSpace(I))
  169.     Next I
  170. Else
  171.     Text1.Text = ""
  172. End If
  173. End Sub
  174.  
  175.  
  176.