home *** CD-ROM | disk | FTP | other *** search
/ Troubleshooting Netware Systems / CSTRIAL0196.BIN / attach / msj / v10n10 / vb40.exe / WCIMR.EXE / WCIMREAD.FRM < prev    next >
Text File  |  1995-10-01  |  31KB  |  945 lines

  1. VERSION 4.00
  2. Begin VB.Form MainFrm 
  3.    Caption         =   "WinCIM Message Reader"
  4.    ClientHeight    =   5895
  5.    ClientLeft      =   420
  6.    ClientTop       =   780
  7.    ClientWidth     =   8910
  8.    Height          =   6630
  9.    Icon            =   "WCIMRead.frx":0000
  10.    Left            =   360
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   5895
  13.    ScaleWidth      =   8910
  14.    Top             =   105
  15.    Width           =   9030
  16.    Begin VB.PictureBox picTabs 
  17.       Appearance      =   0  'Flat
  18.       BackColor       =   &H00C0C0C0&
  19.       BorderStyle     =   0  'None
  20.       ForeColor       =   &H80000008&
  21.       Height          =   2415
  22.       Index           =   1
  23.       Left            =   480
  24.       ScaleHeight     =   2415
  25.       ScaleWidth      =   7935
  26.       TabIndex        =   5
  27.       Top             =   3000
  28.       Width           =   7935
  29.       Begin VB.CommandButton btnClearSearch 
  30.          Caption         =   "&Clear Search"
  31.          Height          =   375
  32.          Left            =   6000
  33.          TabIndex        =   9
  34.          Top             =   720
  35.          Width           =   1335
  36.       End
  37.       Begin VB.CommandButton btnStopSearch 
  38.          Caption         =   "Sto&p"
  39.          Enabled         =   0   'False
  40.          Height          =   375
  41.          Left            =   6000
  42.          TabIndex        =   8
  43.          Top             =   1200
  44.          Width           =   1335
  45.       End
  46.       Begin VB.CommandButton btnFindNow 
  47.          Caption         =   "F&ind Now"
  48.          Height          =   375
  49.          Left            =   6000
  50.          TabIndex        =   7
  51.          Top             =   240
  52.          Width           =   1335
  53.       End
  54.       Begin TabDlg.SSTab tabSearch 
  55.          Height          =   2415
  56.          Left            =   0
  57.          TabIndex        =   6
  58.          TabStop         =   0   'False
  59.          Top             =   0
  60.          Width           =   5775
  61.          _Version        =   65536
  62.          _ExtentX        =   10186
  63.          _ExtentY        =   4260
  64.          _StockProps     =   15
  65.          Caption         =   "User ID"
  66.          BeginProperty Font {FB8F0823-0164-101B-84ED-08002B2EC713} 
  67.             name            =   "Arial"
  68.             charset         =   0
  69.             weight          =   400
  70.             size            =   8.25
  71.             underline       =   0   'False
  72.             italic          =   0   'False
  73.             strikethrough   =   0   'False
  74.          EndProperty
  75.          TabsPerRow      =   3
  76.          Tab             =   0
  77.          TabOrientation  =   3
  78.          Tabs            =   3
  79.          Style           =   1
  80.          TabMaxWidth     =   0
  81.          TabHeight       =   529
  82.          TabCaption(0)   =   "User ID"
  83.          Tab(0).ControlCount=   1
  84.          Tab(0).ControlEnabled=   -1  'True
  85.          Tab(0).Control(0)=   "Frame1"
  86.          TabCaption(1)   =   "Date"
  87.          Tab(1).ControlCount=   1
  88.          Tab(1).ControlEnabled=   0   'False
  89.          Tab(1).Control(0)=   "Frame3"
  90.          TabCaption(2)   =   "Text"
  91.          Tab(2).ControlCount=   1
  92.          Tab(2).ControlEnabled=   0   'False
  93.          Tab(2).Control(0)=   "Frame2"
  94.          Begin VB.Frame Frame2 
  95.             Appearance      =   0  'Flat
  96.             BackColor       =   &H00C0C0C0&
  97.             ForeColor       =   &H00C0C0C0&
  98.             Height          =   2175
  99.             Left            =   -74880
  100.             TabIndex        =   31
  101.             Top             =   120
  102.             Width           =   5175
  103.             Begin VB.TextBox edSearch 
  104.                Height          =   285
  105.                Left            =   1320
  106.                TabIndex        =   35
  107.                Top             =   360
  108.                Width           =   3375
  109.             End
  110.             Begin VB.CheckBox Check1 
  111.                Caption         =   "Case Sensitive"
  112.                Height          =   255
  113.                Left            =   1320
  114.                TabIndex        =   34
  115.                Top             =   720
  116.                Width           =   1695
  117.             End
  118.             Begin VB.OptionButton Option3 
  119.                Caption         =   "Subject Only"
  120.                Height          =   255
  121.                Index           =   0
  122.                Left            =   1320
  123.                TabIndex        =   33
  124.                Top             =   1440
  125.                Width           =   1335
  126.             End
  127.             Begin VB.OptionButton Option3 
  128.                Caption         =   "Message Text"
  129.                Height          =   255
  130.                Index           =   1
  131.                Left            =   1320
  132.                TabIndex        =   32
  133.                Top             =   1200
  134.                Value           =   -1  'True
  135.                Width           =   1335
  136.             End
  137.             Begin VB.Label Label3 
  138.                Caption         =   "Search For:"
  139.                Height          =   255
  140.                Left            =   240
  141.                TabIndex        =   36
  142.                Top             =   360
  143.                Width           =   855
  144.             End
  145.          End
  146.          Begin VB.Frame Frame3 
  147.             Appearance      =   0  'Flat
  148.             BackColor       =   &H00C0C0C0&
  149.             Enabled         =   0   'False
  150.             ForeColor       =   &H80000008&
  151.             Height          =   2175
  152.             Left            =   -74880
  153.             TabIndex        =   18
  154.             Top             =   120
  155.             Width           =   5175
  156.             Begin VB.TextBox Text4 
  157.                Height          =   285
  158.                Left            =   2640
  159.                TabIndex        =   26
  160.                Top             =   600
  161.                Width           =   735
  162.             End
  163.             Begin VB.OptionButton optDate 
  164.                Caption         =   "After:"
  165.                Height          =   255
  166.                Index           =   1
  167.                Left            =   1560
  168.                TabIndex        =   25
  169.                Top             =   600
  170.                Width           =   735
  171.             End
  172.             Begin VB.OptionButton optDate 
  173.                Caption         =   "Before:"
  174.                Height          =   255
  175.                Index           =   0
  176.                Left            =   1560
  177.                TabIndex        =   24
  178.                Top             =   240
  179.                Value           =   -1  'True
  180.                Width           =   855
  181.             End
  182.             Begin VB.OptionButton optDate 
  183.                Caption         =   "During the previous"
  184.                Height          =   255
  185.                Index           =   3
  186.                Left            =   360
  187.                TabIndex        =   23
  188.                Top             =   1440
  189.                Width           =   1695
  190.             End
  191.             Begin VB.OptionButton optDate 
  192.                Caption         =   "During the previous"
  193.                Height          =   255
  194.                Index           =   4
  195.                Left            =   360
  196.                TabIndex        =   22
  197.                Top             =   1080
  198.                Width           =   1695
  199.             End
  200.             Begin VB.TextBox Text7 
  201.                Height          =   285
  202.                Left            =   2160
  203.                TabIndex        =   21
  204.                Top             =   1080
  205.                Width           =   1095
  206.             End
  207.             Begin VB.TextBox Text8 
  208.                Height          =   285
  209.                Left            =   2160
  210.                TabIndex        =   20
  211.                Top             =   1440
  212.                Width           =   1095
  213.             End
  214.             Begin VB.TextBox Text9 
  215.                Height          =   285
  216.                Left            =   2640
  217.                TabIndex        =   19
  218.                Top             =   240
  219.                Width           =   735
  220.             End
  221.             Begin VB.Label lblDate2 
  222.                Caption         =   "days."
  223.                Height          =   255
  224.                Index           =   1
  225.                Left            =   3360
  226.                TabIndex        =   30
  227.                Top             =   1440
  228.                Width           =   615
  229.             End
  230.             Begin VB.Label lblDate2 
  231.                Caption         =   "months."
  232.                Height          =   255
  233.                Index           =   0
  234.                Left            =   3360
  235.                TabIndex        =   29
  236.                Top             =   1080
  237.                Width           =   615
  238.             End
  239.             Begin Spin.SpinButton SpinButton1 
  240.                Height          =   255
  241.                Left            =   3480
  242.                TabIndex        =   28
  243.                Top             =   240
  244.                Width           =   135
  245.                _Version        =   65536
  246.                _ExtentX        =   238
  247.                _ExtentY        =   450
  248.                _StockProps     =   73
  249.             End
  250.             Begin Spin.SpinButton SpinButton2 
  251.                Height          =   255
  252.                Left            =   3480
  253.                TabIndex        =   27
  254.                Top             =   600
  255.                Width           =   135
  256.                _Version        =   65536
  257.                _ExtentX        =   238
  258.                _ExtentY        =   450
  259.                _StockProps     =   73
  260.             End
  261.          End
  262.          Begin VB.Frame Frame1 
  263.             Appearance      =   0  'Flat
  264.             BackColor       =   &H00C0C0C0&
  265.             ForeColor       =   &H80000008&
  266.             Height          =   2175
  267.             Left            =   120
  268.             TabIndex        =   10
  269.             Top             =   120
  270.             Width           =   5175
  271.             Begin VB.PictureBox Picture1 
  272.                Appearance      =   0  'Flat
  273.                BackColor       =   &H00C0C0C0&
  274.                BorderStyle     =   0  'None
  275.                ForeColor       =   &H80000008&
  276.                Height          =   735
  277.                Left            =   3360
  278.                ScaleHeight     =   735
  279.                ScaleWidth      =   1455
  280.                TabIndex        =   39
  281.                Top             =   240
  282.                Width           =   1455
  283.                Begin VB.OptionButton Option2 
  284.                   Height          =   195
  285.                   Index           =   1
  286.                   Left            =   0
  287.                   TabIndex        =   41
  288.                   Top             =   360
  289.                   Width           =   375
  290.                End
  291.                Begin VB.OptionButton Option2 
  292.                   Height          =   195
  293.                   Index           =   0
  294.                   Left            =   0
  295.                   TabIndex        =   40
  296.                   Top             =   0
  297.                   Value           =   -1  'True
  298.                   Width           =   375
  299.                End
  300.             End
  301.             Begin VB.TextBox EdtSrchName 
  302.                Height          =   285
  303.                Left            =   1320
  304.                TabIndex        =   15
  305.                Top             =   240
  306.                Width           =   1935
  307.             End
  308.             Begin VB.TextBox EdtSrchUID 
  309.                Height          =   285
  310.                Left            =   1320
  311.                TabIndex        =   14
  312.                Top             =   600
  313.                Width           =   1935
  314.             End
  315.             Begin VB.OptionButton Option1 
  316.                Caption         =   "Either"
  317.                Height          =   255
  318.                Index           =   2
  319.                Left            =   1200
  320.                TabIndex        =   13
  321.                Top             =   1440
  322.                Value           =   -1  'True
  323.                Width           =   1695
  324.             End
  325.             Begin VB.OptionButton Option1 
  326.                Caption         =   "Sent To"
  327.                Height          =   255
  328.                Index           =   1
  329.                Left            =   1200
  330.                TabIndex        =   12
  331.                Top             =   1200
  332.                Width           =   1695
  333.             End
  334.             Begin VB.OptionButton Option1 
  335.                Caption         =   "Sent By"
  336.                Height          =   255
  337.                Index           =   0
  338.                Left            =   1200
  339.                TabIndex        =   11
  340.                Top             =   960
  341.                Width           =   1695
  342.             End
  343.             Begin VB.Label Label4 
  344.                Caption         =   "Name:"
  345.                Height          =   255
  346.                Left            =   480
  347.                TabIndex        =   17
  348.                Top             =   240
  349.                Width           =   735
  350.             End
  351.             Begin VB.Label Label5 
  352.                Caption         =   "User ID:"
  353.                Height          =   255
  354.                Left            =   480
  355.                TabIndex        =   16
  356.                Top             =   600
  357.                Width           =   735
  358.             End
  359.          End
  360.       End
  361.    End
  362.    Begin VB.PictureBox picTabs 
  363.       Appearance      =   0  'Flat
  364.       BackColor       =   &H00C0C0C0&
  365.       BorderStyle     =   0  'None
  366.       ForeColor       =   &H80000008&
  367.       Height          =   2175
  368.       Index           =   0
  369.       Left            =   240
  370.       ScaleHeight     =   2175
  371.       ScaleWidth      =   8535
  372.       TabIndex        =   3
  373.       Top             =   3000
  374.       Width           =   8535
  375.       Begin VB.TextBox EdtMsgText 
  376.          Height          =   2175
  377.          Left            =   0
  378.          MultiLine       =   -1  'True
  379.          ScrollBars      =   2  'Vertical
  380.          TabIndex        =   4
  381.          Top             =   0
  382.          Width           =   8095
  383.       End
  384.    End
  385.    Begin MSMAPI.MAPIMessages MAPIMessages1 
  386.       Left            =   8520
  387.       Top             =   5040
  388.       _Version        =   65536
  389.       _ExtentX        =   741
  390.       _ExtentY        =   741
  391.       _StockProps     =   0
  392.    End
  393.    Begin MSMAPI.MAPISession MAPISession1 
  394.       Left            =   8520
  395.       Top             =   4800
  396.       _Version        =   65536
  397.       _ExtentX        =   741
  398.       _ExtentY        =   741
  399.       _StockProps     =   0
  400.    End
  401.    Begin ComctlLib.ProgressBar ProgBar 
  402.       Height          =   255
  403.       Left            =   3360
  404.       TabIndex        =   38
  405.       Top             =   2400
  406.       Width           =   5415
  407.       _Version        =   65536
  408.       _ExtentX        =   9551
  409.       _ExtentY        =   450
  410.       _StockProps     =   73
  411.    End
  412.    Begin ComctlLib.ListView lvwThreads 
  413.       Height          =   2295
  414.       Left            =   3360
  415.       TabIndex        =   37
  416.       Top             =   120
  417.       Width           =   5415
  418.       _Version        =   65536
  419.       _ExtentX        =   9551
  420.       _ExtentY        =   4048
  421.       _StockProps     =   77
  422.       BackColor       =   16777215
  423.       BorderStyle     =   1
  424.       Arrange         =   3
  425.       HideSelection   =   0   'False
  426.       Icons           =   "imlFolders"
  427.       LabelEdit       =   1
  428.       MultiSelect     =   -1  'True
  429.       SmallIcons      =   "imlFolders"
  430.       Sorted          =   -1  'True
  431.       SortKey         =   1
  432.       View            =   3
  433.       NumItems        =   5
  434.       i1              =   "WCIMRead.frx":030A
  435.       i2              =   "WCIMRead.frx":03BE
  436.       i3              =   "WCIMRead.frx":0493
  437.       i4              =   "WCIMRead.frx":0568
  438.       i5              =   "WCIMRead.frx":0645
  439.    End
  440.    Begin ComctlLib.TabStrip tabMain 
  441.       Height          =   3015
  442.       Left            =   120
  443.       TabIndex        =   2
  444.       Top             =   2640
  445.       Width           =   8775
  446.       _Version        =   65536
  447.       _ExtentX        =   15478
  448.       _ExtentY        =   5318
  449.       _StockProps     =   68
  450.       ImageList       =   ""
  451.       ShowTips        =   -1  'True
  452.       NumTabs         =   2
  453.       i1              =   "WCIMRead.frx":0716
  454.       i2              =   "WCIMRead.frx":0847
  455.    End
  456.    Begin ComctlLib.TreeView tvwFolders 
  457.       Height          =   2295
  458.       Left            =   120
  459.       TabIndex        =   1
  460.       Top             =   120
  461.       Width           =   3255
  462.       _Version        =   65536
  463.       _ExtentX        =   5741
  464.       _ExtentY        =   4048
  465.       _StockProps     =   68
  466.       BorderStyle     =   1
  467.       ImageList       =   "imlFolders"
  468.       Indentation     =   30
  469.       LineStyle       =   1
  470.       PathSeparator   =   "\"
  471.       Sorted          =   -1  'True
  472.       Style           =   7
  473.    End
  474.    Begin ComctlLib.StatusBar StatBar 
  475.       Align           =   2  'Align Bottom
  476.       Height          =   255
  477.       Left            =   0
  478.       TabIndex        =   0
  479.       Top             =   5640
  480.       Width           =   8910
  481.       _Version        =   65536
  482.       _ExtentX        =   15716
  483.       _ExtentY        =   450
  484.       _StockProps     =   68
  485.       AlignSet        =   -1  'True
  486.       SimpleText      =   ""
  487.       i1              =   "WCIMRead.frx":0978
  488.    End
  489.    Begin ComctlLib.ImageList imlFolders 
  490.       Left            =   8040
  491.       Top             =   5160
  492.       _Version        =   65536
  493.       _ExtentX        =   1296
  494.       _ExtentY        =   873
  495.       _StockProps     =   1
  496.       ImageWidth      =   18
  497.       ImageHeight     =   18
  498.       NumImages       =   8
  499.       i1              =   "WCIMRead.frx":0A45
  500.       i2              =   "WCIMRead.frx":10A4
  501.       i3              =   "WCIMRead.frx":1703
  502.       i4              =   "WCIMRead.frx":1D62
  503.       i5              =   "WCIMRead.frx":23C1
  504.       i6              =   "WCIMRead.frx":2A20
  505.       i7              =   "WCIMRead.frx":2ADF
  506.       i8              =   "WCIMRead.frx":2B9E
  507.    End
  508.    Begin MSComDlg.CommonDialog ComDlg 
  509.       Left            =   7680
  510.       Top             =   5160
  511.       _Version        =   65536
  512.       _ExtentX        =   847
  513.       _ExtentY        =   847
  514.       _StockProps     =   0
  515.       DialogTitle     =   "Save Thread As..."
  516.    End
  517.    Begin VB.Menu Mnu_File 
  518.       Caption         =   "File"
  519.       Begin VB.Menu Mnu_SaveToFile 
  520.          Caption         =   "&Save To File..."
  521.       End
  522.       Begin VB.Menu Mnu_SaveAllThreads 
  523.          Caption         =   "Save &All Threads..."
  524.       End
  525.       Begin VB.Menu Mnu_Print 
  526.          Caption         =   "&Print..."
  527.          Enabled         =   0   'False
  528.       End
  529.       Begin VB.Menu Mnu_Options 
  530.          Caption         =   "&Options..."
  531.       End
  532.       Begin VB.Menu Mnu_FwdMAPI 
  533.          Caption         =   "&Forward MAPI message"
  534.       End
  535.       Begin VB.Menu Mnu_Sep0 
  536.          Caption         =   "-"
  537.       End
  538.       Begin VB.Menu Mnu_FileExit 
  539.          Caption         =   "E&xit"
  540.       End
  541.    End
  542.    Begin VB.Menu Mnu_Folders 
  543.       Caption         =   "Folders"
  544.       Begin VB.Menu Mnu_Expand 
  545.          Caption         =   "&Expand folder tree"
  546.       End
  547.       Begin VB.Menu Btn_Collapse 
  548.          Caption         =   "&Collapse folder tree"
  549.       End
  550.       Begin VB.Menu Mnu_RefreshFld 
  551.          Caption         =   "&Refresh folder tree"
  552.       End
  553.    End
  554.    Begin VB.Menu Mnu_Threads 
  555.       Caption         =   "Threads"
  556.       Begin VB.Menu Mnu_ViewCurr 
  557.          Caption         =   "View &Current"
  558.       End
  559.       Begin VB.Menu Mnu_ViewNext 
  560.          Caption         =   "View &Next"
  561.       End
  562.       Begin VB.Menu Mnu_ViewPrev 
  563.          Caption         =   "View &Previous"
  564.       End
  565.       Begin VB.Menu Mnu_Sep1 
  566.          Caption         =   "-"
  567.       End
  568.       Begin VB.Menu Mnu_BeginSearch 
  569.          Caption         =   "Begin Search"
  570.       End
  571.       Begin VB.Menu Mnu_StopSearch 
  572.          Caption         =   "Stop Search"
  573.       End
  574.       Begin VB.Menu Mnu_ClearSearch 
  575.          Caption         =   "Clear Search"
  576.       End
  577.       Begin VB.Menu Mnu_Sep2 
  578.          Caption         =   "-"
  579.       End
  580.       Begin VB.Menu Mnu_SortTitle 
  581.          Caption         =   "Sort by &Title"
  582.       End
  583.       Begin VB.Menu Mnu_SortDateDown 
  584.          Caption         =   "Sort by &Date (Newest First)"
  585.       End
  586.       Begin VB.Menu Mnu_SortDateUp 
  587.          Caption         =   "Sort by Date (&Oldest First)"
  588.       End
  589.       Begin VB.Menu Mnu_SortType 
  590.          Caption         =   "Sort by T&ype"
  591.       End
  592.    End
  593. End
  594. Attribute VB_Name = "MainFrm"
  595. Attribute VB_Creatable = False
  596. Attribute VB_Exposed = False
  597.  
  598. Private Sub btnClearSearch_Click()
  599. ' When clicked, this button returns all threads to the thread list
  600.     ResetThreadList
  601. End Sub
  602.  
  603. Private Sub btnFindNow_Click()
  604.     btnStopSearch.Enabled = True
  605.     btnFindNow.Enabled = False
  606.     gStopSearch = 0
  607.     
  608.     Select Case tabSearch.Tab
  609.     Case 0  ' UserID search
  610.         a$ = FindByUID()
  611.     Case 1  ' Date search
  612.         a$ = FindByDate()
  613.     Case 2  ' Text search
  614.         a$ = FindStringInFolder(edSearch.TEXT)
  615.     End Select
  616.         
  617.     btnFindNow.Enabled = True
  618.     btnStopSearch.Enabled = False
  619. End Sub
  620.  
  621. Private Sub btnStopSearch_Click()
  622.     gStopSearch = 1
  623. End Sub
  624.  
  625. Private Sub Form_Load()
  626.  
  627. ' When the form first loads, we should immediately fill
  628. ' up the folders list based on the CABINET.DAT file.
  629. '
  630. ' The base node is key="kyCIS"
  631. '
  632. ' Other nodes have
  633. ' key = "k000" (000 = folder num, the index into the gFolderList array)
  634. ' tag = "FOLDERxx.xxx" (8.3 dir name)
  635.  
  636.     Dim F As Folder
  637.     Dim topNode As Node
  638.     Dim X As Node
  639.  
  640.     'Get the WinCim path. If non-existent, create it
  641.     ' in the registry!
  642.     
  643.     WCimDir = GetWCIMPathReg()
  644.     
  645.     If (Len(WCimDir) = 0) Then
  646.         FrmOptions.Show 1
  647.     End If
  648.     
  649.     WCimBase = GetWCIMPathReg()
  650.  
  651.     If (Len(WCimBase) = 0) Then
  652.         End
  653.     End If
  654.         
  655.     WCimDir = WCimBase & "\FCABINET"
  656.     
  657. ' Turn off the picTabs!
  658.     picTabs(0).Visible = True
  659.     picTabs(1).Visible = False
  660.     
  661.     gNumFolders = 0
  662.     ReDim Preserve gFolderList(20)
  663.     
  664.     ' Get file name.
  665.  
  666.     FName$ = WCimDir & "\CABINET\CABINET.DAT"
  667.     FNum = FreeFile()
  668.     
  669.     ' Add the root node to the folder list
  670.  
  671.     Set topNode = tvwFolders.Nodes.Add(, , "kyCIS", "CompuServe", picFolder, picFolder)
  672.     topNode.Tag = "kyCIS"
  673.     topNode.Sorted = True
  674.  
  675.     ' Open the CABINET.DAT file
  676.     Open FName$ For Binary Access Read Lock Read As #FNum
  677.     
  678.     FStart = 21
  679.     Do While Not EOF(FNum)
  680.         gNumFolders = gNumFolders + 1
  681.         
  682.         If (gNumFolders > UBound(gFolderList)) Then
  683.             ReDim Preserve gFolderList(10 + UBound(gFolderList))
  684.         End If
  685.         
  686.         Get #FNum, FStart, gFolderList(gNumFolders)
  687.  
  688.         ' Trim the folder name and path - make path 8.3
  689.         
  690.         gFolderList(gNumFolders).FName = ZTrim(gFolderList(gNumFolders).FName)
  691.         gFolderList(gNumFolders).FPath = ZTrim(gFolderList(gNumFolders).FPath)
  692.  
  693.         If Len(Trim(gFolderList(gNumFolders).FName)) = 0 Then Exit Do
  694.         
  695.         ' Don't convert "GENERAL", the all-purpose folder, to 8.3
  696.         
  697.         If (StrComp(gFolderList(gNumFolders).FPath, "GENERAL    ") <> 0) Then
  698.             Eight = Left$(gFolderList(gNumFolders).FPath, 8)
  699.             Three = Right$(gFolderList(gNumFolders).FPath, 3)
  700.             FoldName = Eight & "." & Three
  701.         Else
  702.             FoldName = "GENERAL"
  703.         End If
  704.  
  705.         NodeKey = "k" & Format(gNumFolders, "0")
  706.         'Set x = tvwFolders.Nodes.Add("kyCIS", 4, gFolderList(gNumFolders).FName, 1, picFolder, picFolder, 1, NodeKey, , FoldName)
  707.         Set X = tvwFolders.Nodes.Add("kyCIS", tvwChild, NodeKey, gFolderList(gNumFolders).FName, picFolder, picFolder)
  708.         X.Tag = FoldName
  709.         X.Sorted = True
  710.         FStart = FStart + 30
  711.     Loop
  712.     
  713.     Close #FNum
  714.  
  715.     ' Now add in-basket and out-basket, and you're done.
  716.         ReDim Preserve gFolderList(2 + UBound(gFolderList))
  717.  
  718.         gNumFolders = gNumFolders + 1
  719.         gFolderList(gNumFolders).FName = "In Basket"
  720.         gFolderList(gNumFolders).FPath = "BASKET.IN"
  721.  
  722.         NodeKey = "k" & Format(gNumFolders, "0")
  723.         Set X = tvwFolders.Nodes.Add("kyCIS", tvwChild, NodeKey, gFolderList(gNumFolders).FName, picFolder, picFolder)
  724.         X.Tag = "BASKET.IN"
  725.         X.Sorted = True
  726.  
  727.         gNumFolders = gNumFolders + 1
  728.         gFolderList(gNumFolders).FName = "Out Basket"
  729.         gFolderList(gNumFolders).FPath = "BASKET.OUT"
  730.  
  731.         NodeKey = "k" & Format(gNumFolders, "0")
  732.         Set X = tvwFolders.Nodes.Add("kyCIS", tvwChild, NodeKey, gFolderList(gNumFolders).FName, picFolder, picFolder)
  733.         X.Tag = "BASKET.OUT"
  734.         X.Sorted = True
  735.     
  736.     ' You have to set Sorted=True AFTER all children are added!
  737.     topNode.Sorted = True
  738.  
  739. End Sub
  740.  
  741. Private Sub lvwThreads_ColumnClick(ByVal ColumnHeader As ColumnHeader)
  742.     ' When a ColumnHeader object is clicked, the ListView control is
  743.     ' sorted by the subitems of that column.
  744.  
  745.     ' Set the SortKey to the Index of the ColumnHeader - 1
  746.     lvwThreads.SortKey = ColumnHeader.Index - 1
  747.     ' Set Sorted to True to sort the list.
  748.     lvwThreads.Sorted = True
  749. End Sub
  750.  
  751. Private Sub Mnu_FileExit_Click()
  752. ' End the program
  753. End
  754. End Sub
  755.  
  756. Private Sub Mnu_Options_Click()
  757.     FrmOptions.Show 1
  758. End Sub
  759.  
  760. Private Sub Mnu_RefreshFld_Click()
  761.     tvwFolders.Refresh
  762. End Sub
  763.  
  764. Private Sub Mnu_SaveAllThreads_Click()
  765.  
  766. ' Save ALL threads in this folder to file, given their appropriate names
  767.  
  768.     Dim ThrdMsg As ForumThdMsg
  769.     Dim FNum As Integer
  770.     Dim ThdNum As Integer
  771.     
  772.     ProgBar.MIN = 0
  773.     ProgBar.MAX = gNumThreads
  774.     
  775.     ' Get the current folder
  776.     sss = gCurFolder.FPath
  777.     sss = gCurFolder.FName
  778.     
  779.     For ThdNum = 1 To gNumThreads
  780.         ProgBar.Value = ThdNum
  781.         DoEvents
  782.         
  783.         Select Case msgtype(ThdNum)   'gThreadList(ThdNum).ComHdr.RecType
  784.         Case MT_UNDEF
  785.             Strg$ = ProcessUndef(ThdNum)
  786.         Case MT_EMAIL
  787.             Strg$ = ProcessEMail(ThdNum)
  788.         Case MT_FORMSG
  789.             Strg$ = ProcessMsg(ThdNum)
  790.         Case MT_FORTHD
  791.             Strg$ = ProcessThread(ThdNum)
  792.         Case MT_IPLEX
  793.             Strg$ = ProcessIPlex(ThdNum)
  794.         Case MT_DISP
  795.             Strg$ = ProcessDisp(ThdNum)
  796.         Case MT_ENS
  797.             Strg$ = ProcessNews(ThdNum)
  798.         End Select
  799.             
  800.         ' Now save Strg$ to the filename for thread ThdNum
  801.         ' Replace every possible bad char with LFN-friendly
  802.         ' ones
  803.         
  804.         Entry$ = gThreadList(ThdNum).ComPStr.Subject.SData
  805.         Entry$ = StrReplace(Entry$, """", "'")
  806.         Entry$ = StrReplace(Entry$, "/", "-")
  807.         Entry$ = StrReplace(Entry$, "\", "-")
  808.         Entry$ = StrReplace(Entry$, "?", " ")
  809.         Entry$ = StrReplace(Entry$, ".", "-")
  810.         Entry$ = StrReplace(Entry$, "*", "-")
  811.         Entry$ = StrReplace(Entry$, ":", "-")
  812.         Entry$ = StrReplace(Entry$, ">", "-")
  813.         Entry$ = StrReplace(Entry$, "<", "-")
  814.         Entry$ = StrReplace(Entry$, "|", "-")
  815.         
  816.         FNum = FreeFile
  817.     
  818.         Open Entry$ For Binary Access Write As #FNum
  819.         Put #FNum, , Strg$
  820.         Close #FNum
  821.         
  822.     Next ThdNum
  823. End Sub
  824.  
  825. Private Sub Mnu_SaveToFile_Click()
  826.  
  827. ' When a user chooses to save to a file, we should determine what
  828. ' they want saved - the current thread, or message. We should then
  829. ' make an appropriate long file name, bring up the save box, and
  830. ' dump the right text to it.
  831.  
  832.     Set sel = lvwThreads.SelectedItem
  833.     Entry$ = sel
  834.     Entry$ = StrReplace(Entry$, """", "'")
  835.  
  836.     ComDlg.filename = Entry$
  837.     ComDlg.Action = 2
  838.     
  839.     FNum = FreeFile
  840.     
  841.     Open ComDlg.filename For Binary Access Write As #FNum
  842.     Put #FNum, , EdtMsgText.TEXT
  843.     Close #FNum
  844. End Sub
  845.  
  846. Private Sub Mnu_SortDateDown_Click()
  847.     lvwThreads.SortKey = 1
  848.     lvwThreads.SortOrder = lvwDescending
  849.     lvwThreads.Sorted = True
  850. End Sub
  851.  
  852. Private Sub Mnu_SortDateUp_Click()
  853.     lvwThreads.SortKey = 1
  854.     lvwThreads.SortOrder = lvwAscending
  855.     lvwThreads.Sorted = True
  856. End Sub
  857.  
  858. Private Sub Mnu_SortTitle_Click()
  859.     lvwThreads.SortKey = 0
  860.     lvwThreads.Sorted = True
  861. End Sub
  862.  
  863. Private Sub Mnu_SortType_Click()
  864.     lvwThreads.SortKey = 2
  865.     lvwThreads.Sorted = True
  866. End Sub
  867.  
  868. Private Sub tabMain_Click()
  869.     Dim a As Integer
  870.  
  871.     a = tabMain.SelectedItem.Index
  872.  
  873.     If picTabs(a - 1).Visible = False Then
  874.         For N = 1 To tabMain.Tabs.count
  875.             picTabs(N - 1).Visible = False
  876.         Next N
  877.         
  878.         picTabs(a - 1).Visible = True
  879.     End If
  880. End Sub
  881. Private Sub tvwFolders_DblClick()
  882.  
  883. ' When the folders tree is double clicked, it should
  884. ' fill the threads list in with the folder's contents
  885.  
  886.     Set sel = tvwFolders.SelectedItem
  887.     FillThreadList (sel.Tag)  ' sel.Tag is the folder dir name
  888. '    lvwThreads.Selected = lvwThreads.ListItems.Items(1)
  889. End Sub
  890.  
  891. Private Sub lvwThreads_DblClick()
  892.  
  893. ' When a node in the threads list is double-clicked,
  894. ' it should fill the View edit in with the appropriate
  895. ' text - either the full thread or individual message
  896. ' text.
  897.  
  898.     Dim ThdNum As Integer
  899.     Dim Strg$
  900.     Dim sel As Variant
  901.     
  902.     On Error Resume Next
  903.     Set sel = lvwThreads.SelectedItem
  904.     Entry$ = sel
  905.  
  906.     ' if you've dblclicked without selection
  907.     If Err.Number <> 0 Then Exit Sub
  908.  
  909.     ' This always displays the first message with the
  910.     ' particular name. Change to sel.Index or something?
  911.  
  912.     ThdNum = sel.SubItems(4)
  913. '    ThdNum = FindThread(Entry$) ' Mid$(Entry$, 5, Len(Entry$) - 4))
  914.  
  915.     If ThdNum = 0 Then Exit Sub
  916.     
  917.     EdtMsgText.TEXT = ""
  918.     DoEvents
  919.     
  920.     Select Case msgtype(ThdNum)   'gThreadList(ThdNum).ComHdr.RecType
  921.     Case MT_UNDEF
  922.         Strg$ = ProcessUndef(ThdNum)
  923.     Case MT_EMAIL
  924.         Strg$ = ProcessEMail(ThdNum)
  925.     Case MT_FORMSG
  926.         Strg$ = ProcessMsg(ThdNum)
  927.     Case MT_FORTHD
  928.         Strg$ = ProcessThread(ThdNum)
  929.     Case MT_IPLEX
  930.         Strg$ = ProcessIPlex(ThdNum)
  931.     Case MT_DISP
  932.         Strg$ = ProcessDisp(ThdNum)
  933.     Case MT_ENS
  934.         Strg$ = ProcessNews(ThdNum)
  935.     Case Else
  936.         Exit Sub
  937.     End Select
  938.     
  939.     EdtMsgText.TEXT = Strg$
  940. End Sub
  941.  
  942. Private Sub tvwFolders_Expand(ByVal Node As Node)
  943.     Node.Sorted = True
  944. End Sub
  945.