home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD8725882000.psc / frmMain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-08-01  |  20.3 KB  |  627 lines

  1. VERSION 5.00
  2. Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  5. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
  6. Object = "{00028CDA-0000-0000-0000-000000000046}#6.0#0"; "TDBG6.OCX"
  7. Begin VB.Form frmMain 
  8.    Caption         =   "EZMailer"
  9.    ClientHeight    =   5385
  10.    ClientLeft      =   60
  11.    ClientTop       =   630
  12.    ClientWidth     =   9030
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   359
  15.    ScaleMode       =   3  'Pixel
  16.    ScaleWidth      =   602
  17.    WindowState     =   2  'Maximized
  18.    Begin VB.Data Data1 
  19.       Caption         =   "Data1"
  20.       Connect         =   "Access"
  21.       DatabaseName    =   "F:\Code\EZMailer\mail.mdb"
  22.       DefaultCursorType=   0  'DefaultCursor
  23.       DefaultType     =   2  'UseODBC
  24.       Exclusive       =   0   'False
  25.       Height          =   300
  26.       Left            =   4560
  27.       Options         =   0
  28.       ReadOnly        =   0   'False
  29.       RecordsetType   =   1  'Dynaset
  30.       RecordSource    =   "Mail"
  31.       Top             =   2040
  32.       Visible         =   0   'False
  33.       Width           =   2820
  34.    End
  35.    Begin MSWinsockLib.Winsock Winsock1 
  36.       Left            =   465
  37.       Top             =   4140
  38.       _ExtentX        =   741
  39.       _ExtentY        =   741
  40.       _Version        =   393216
  41.    End
  42.    Begin MSComctlLib.ProgressBar ProgressBar1 
  43.       Height          =   285
  44.       Left            =   7155
  45.       TabIndex        =   7
  46.       Top             =   5070
  47.       Width           =   1575
  48.       _ExtentX        =   2778
  49.       _ExtentY        =   503
  50.       _Version        =   393216
  51.       Appearance      =   0
  52.    End
  53.    Begin VB.Timer tmrSize 
  54.       Enabled         =   0   'False
  55.       Interval        =   20
  56.       Left            =   2085
  57.       Top             =   3840
  58.    End
  59.    Begin VB.Timer tmrClock 
  60.       Interval        =   1000
  61.       Left            =   2970
  62.       Top             =   3900
  63.    End
  64.    Begin MSComDlg.CommonDialog CommonDialog1 
  65.       Left            =   1455
  66.       Top             =   3795
  67.       _ExtentX        =   847
  68.       _ExtentY        =   847
  69.       _Version        =   393216
  70.    End
  71.    Begin VB.PictureBox pic 
  72.       BackColor       =   &H00C00000&
  73.       Height          =   2430
  74.       Index           =   2
  75.       Left            =   2580
  76.       ScaleHeight     =   158
  77.       ScaleMode       =   3  'Pixel
  78.       ScaleWidth      =   302
  79.       TabIndex        =   5
  80.       TabStop         =   0   'False
  81.       Top             =   2460
  82.       Width           =   4590
  83.       Begin RichTextLib.RichTextBox txtMail 
  84.          Height          =   1740
  85.          Left            =   360
  86.          TabIndex        =   2
  87.          Top             =   480
  88.          Width           =   3075
  89.          _ExtentX        =   5424
  90.          _ExtentY        =   3069
  91.          _Version        =   393217
  92.          ReadOnly        =   -1  'True
  93.          ScrollBars      =   2
  94.          TextRTF         =   $"frmMain.frx":0000
  95.       End
  96.    End
  97.    Begin VB.PictureBox pic 
  98.       BackColor       =   &H0000C000&
  99.       Height          =   1290
  100.       Index           =   1
  101.       Left            =   1800
  102.       ScaleHeight     =   82
  103.       ScaleMode       =   3  'Pixel
  104.       ScaleWidth      =   477
  105.       TabIndex        =   4
  106.       TabStop         =   0   'False
  107.       Top             =   720
  108.       Width           =   7215
  109.       Begin TrueDBGrid60.TDBGrid tdbMail 
  110.          Bindings        =   "frmMain.frx":00C9
  111.          DragIcon        =   "frmMain.frx":00DD
  112.          Height          =   1215
  113.          Left            =   0
  114.          OleObjectBlob   =   "frmMain.frx":051F
  115.          TabIndex        =   1
  116.          Top             =   15
  117.          Width           =   7215
  118.       End
  119.    End
  120.    Begin VB.PictureBox pic 
  121.       BackColor       =   &H000000FF&
  122.       Height          =   1860
  123.       Index           =   0
  124.       Left            =   120
  125.       ScaleHeight     =   120
  126.       ScaleMode       =   3  'Pixel
  127.       ScaleWidth      =   97
  128.       TabIndex        =   0
  129.       TabStop         =   0   'False
  130.       Top             =   720
  131.       Width           =   1515
  132.       Begin VB.ListBox lstFoldersNames 
  133.          Height          =   540
  134.          IntegralHeight  =   0   'False
  135.          Left            =   -90
  136.          TabIndex        =   9
  137.          Top             =   1290
  138.          Visible         =   0   'False
  139.          Width           =   2100
  140.       End
  141.       Begin VB.ListBox lstFoldersData 
  142.          Height          =   540
  143.          IntegralHeight  =   0   'False
  144.          Left            =   15
  145.          TabIndex        =   8
  146.          Top             =   720
  147.          Visible         =   0   'False
  148.          Width           =   2100
  149.       End
  150.       Begin VB.ListBox lstFolders 
  151.          Height          =   540
  152.          IntegralHeight  =   0   'False
  153.          Left            =   0
  154.          TabIndex        =   6
  155.          Top             =   0
  156.          Width           =   2100
  157.       End
  158.    End
  159.    Begin MSComctlLib.StatusBar StatusBar1 
  160.       Align           =   2  'Align Bottom
  161.       Height          =   375
  162.       Left            =   0
  163.       TabIndex        =   3
  164.       Top             =   5010
  165.       Width           =   9030
  166.       _ExtentX        =   15928
  167.       _ExtentY        =   661
  168.       _Version        =   393216
  169.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  170.          NumPanels       =   3
  171.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  172.             Object.Width           =   2646
  173.             MinWidth        =   2646
  174.          EndProperty
  175.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  176.             AutoSize        =   1
  177.             Object.Width           =   9816
  178.          EndProperty
  179.          BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  180.             Object.Width           =   2910
  181.             MinWidth        =   2910
  182.          EndProperty
  183.       EndProperty
  184.    End
  185.    Begin MSWinsockLib.Winsock Winsock2 
  186.       Left            =   1305
  187.       Top             =   4470
  188.       _ExtentX        =   741
  189.       _ExtentY        =   741
  190.       _Version        =   393216
  191.    End
  192.    Begin VB.Menu mnuFile 
  193.       Caption         =   "&File"
  194.       Begin VB.Menu mnuFileNew 
  195.          Caption         =   "&New"
  196.          Shortcut        =   ^N
  197.       End
  198.       Begin VB.Menu mnuFileReply 
  199.          Caption         =   "&Reply"
  200.          Shortcut        =   ^R
  201.       End
  202.       Begin VB.Menu mnuForward 
  203.          Caption         =   "&Forward"
  204.          Shortcut        =   ^F
  205.       End
  206.       Begin VB.Menu mnuFileDelete 
  207.          Caption         =   "&Delete"
  208.          Shortcut        =   {DEL}
  209.       End
  210.       Begin VB.Menu mnuSep6 
  211.          Caption         =   "-"
  212.       End
  213.       Begin VB.Menu mnuOptionsGetMail 
  214.          Caption         =   "&Get Mail"
  215.          Shortcut        =   ^G
  216.       End
  217.       Begin VB.Menu mnuOptionsSendMail 
  218.          Caption         =   "&Send Mail"
  219.          Shortcut        =   ^S
  220.       End
  221.       Begin VB.Menu mnuSep2 
  222.          Caption         =   "-"
  223.       End
  224.       Begin VB.Menu mnuFileSave 
  225.          Caption         =   "Save A&ttachments"
  226.          Shortcut        =   ^T
  227.       End
  228.       Begin VB.Menu mnuSep5 
  229.          Caption         =   "-"
  230.       End
  231.       Begin VB.Menu mnuFileExit 
  232.          Caption         =   "E&xit"
  233.          Shortcut        =   ^Q
  234.       End
  235.    End
  236.    Begin VB.Menu mnuOptions 
  237.       Caption         =   "&Options"
  238.       Begin VB.Menu mnuOptionsAccount 
  239.          Caption         =   "Edit Account &Info"
  240.          Shortcut        =   ^I
  241.       End
  242.       Begin VB.Menu mnuFileRouting 
  243.          Caption         =   "Edit R&ules"
  244.          Shortcut        =   ^U
  245.       End
  246.       Begin VB.Menu mnuAddressBook 
  247.          Caption         =   "Edit Address &Book"
  248.          Shortcut        =   ^B
  249.       End
  250.       Begin VB.Menu mnuFileShortcut 
  251.          Caption         =   "Show S&hortcuts"
  252.          Shortcut        =   ^H
  253.       End
  254.       Begin VB.Menu mnuProgrammer 
  255.          Caption         =   "&Programmer"
  256.          Visible         =   0   'False
  257.       End
  258.    End
  259. Attribute VB_Name = "frmMain"
  260. Attribute VB_GlobalNameSpace = False
  261. Attribute VB_Creatable = False
  262. Attribute VB_PredeclaredId = True
  263. Attribute VB_Exposed = False
  264. Option Explicit
  265. Const CurrentModule As String = "frmMain"
  266. Private Sizing As String
  267. Private Const Margin As Long = 2
  268. Private mX As Long
  269. Private mY As Long
  270. Private Const GWL_STYLE = -16&
  271. Private Const TVM_SETBKCOLOR = 4381&
  272. Private Const TVM_GETBKCOLOR = 4383&
  273. Private Const TVS_HASLINES = 2&
  274. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
  275. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
  276. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  277. Private Startup As Boolean
  278. Private Sub Form_Load()
  279.     On Error GoTo Err_Init
  280.     Dim i As Long
  281.     'Set the initial parameters
  282.     Status 2, "Welcome to EZMailer!"
  283.     Status 3, "User: " & User.Name
  284.     ProgressBar1.Visible = False
  285.     frmMain.pic(0).MousePointer = vbArrow
  286.     frmMain.pic(1).MousePointer = vbArrow
  287.     frmMain.pic(2).MousePointer = vbArrow
  288.     frmMain.StatusBar1.MousePointer = vbArrow
  289.     'Set the colors
  290.     lstFolders.AddItem "Inbox"
  291.     lstFolders.AddItem "Outbox"
  292.     lstFolders.AddItem "Sent Items"
  293.     lstFolders.BackColor = Settings.Color(1)
  294.     tdbMail.BackColor = Settings.Color(2)
  295.     tdbMail.DeadAreaBackColor = Settings.Color(2)
  296.     txtMail.BackColor = Settings.Color(3)
  297.     'Load the folders and messages
  298.     DB.LoadFolders
  299.     'Navigate to the correct folder
  300.     frmMain.lstFolders.ListIndex = 0
  301.     DB.LoadMessages
  302.     'Apply the filtering rules
  303.     DB.LoadRules
  304.     Show
  305.     lstFolders.SetFocus
  306.     Exit Sub
  307. Err_Init:
  308.     HandleError CurrentModule, "Form_Load", Err.Number, Err.Description
  309. End Sub
  310. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  311.     On Error GoTo Err_Init
  312.     If X < pic(1).Left Then
  313.         Sizing = "v"
  314.         tmrSize.Enabled = True
  315.     ElseIf Y < StatusBar1.Top Then
  316.         Sizing = "h"
  317.         tmrSize.Enabled = True
  318.     End If
  319.     Exit Sub
  320. Err_Init:
  321.     HandleError CurrentModule, "Form_MouseDown", Err.Number, Err.Description
  322. End Sub
  323. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  324.     On Error GoTo Err_Init
  325.     If Sizing = "" Then
  326.         If X < pic(1).Left Then
  327.             frmMain.MousePointer = vbSizeWE
  328.         ElseIf Y < StatusBar1.Top Then
  329.             frmMain.MousePointer = vbSizeNS
  330.         Else
  331.             frmMain.MousePointer = vbArrow
  332.         End If
  333.     End If
  334.     mX = X
  335.     mY = Y
  336.     Exit Sub
  337. Err_Init:
  338.     HandleError CurrentModule, "Form_MouseMove", Err.Number, Err.Description
  339. End Sub
  340. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  341.     On Error GoTo Err_Init
  342.     Sizing = ""
  343.     Exit Sub
  344. Err_Init:
  345.     HandleError CurrentModule, "Form_MouseUp", Err.Number, Err.Description
  346. End Sub
  347. Private Sub mnuAddressBook_Click()
  348.     On Error GoTo Err_Init
  349.     frmAddresses.Show vbModal
  350.     Exit Sub
  351. Err_Init:
  352.     HandleError CurrentModule, "mnuAddressBook_Click", Err.Number, Err.Description
  353. End Sub
  354. '--------------------------------------------------------
  355. 'Menu routines
  356. '--------------------------------------------------------
  357. Private Sub mnuFileExit_Click()
  358.     On Error GoTo Err_Init
  359.     ShutDown
  360.     Exit Sub
  361. Err_Init:
  362.     HandleError CurrentModule, "mnuFileExit_Click", Err.Number, Err.Description
  363. End Sub
  364. '--------------------------------------------------------
  365. 'Form sizing routines
  366. '--------------------------------------------------------
  367. Private Sub Form_Resize()
  368.     On Error Resume Next
  369.     Dim w As Long, h As Long
  370.     If ScaleWidth < 100 Then Width = 100 * Screen.TwipsPerPixelX
  371.     If ScaleHeight < 100 Then Height = 100 * Screen.TwipsPerPixelY
  372.     w = ScaleWidth
  373.     h = ScaleHeight - StatusBar1.Height '- Toolbar1.Height
  374.     'Resize the parent controls.
  375.     pic(0).Move 0, 0, (w * Settings.VerticalDivider) - Margin, h
  376.     pic(1).Move pic(0).Width + Margin, pic(0).Top, w - pic(0).Width - Margin, h * Settings.HorizontalDivider - Margin
  377.     pic(2).Move pic(1).Left, pic(1).Height + pic(1).Top + Margin, pic(1).Width, h - pic(1).Height - Margin
  378.     'Move the progress bar control
  379.     ProgressBar1.Move w - ProgressBar1.Width - 20, pic(2).Top + pic(2).Height + 4
  380. End Sub
  381. Private Sub mnuFileNew_Click()
  382.     On Error GoTo Err_Init
  383.     frmMail.Show
  384.     Exit Sub
  385. Err_Init:
  386.     HandleError CurrentModule, "mnuFileNew_Click", Err.Number, Err.Description
  387. End Sub
  388. Private Sub mnuFileReply_Click()
  389.     On Error GoTo Err_Init
  390.     DB.Reply
  391.     Exit Sub
  392. Err_Init:
  393.     HandleError CurrentModule, "mnuFileReply_Click", Err.Number, Err.Description
  394. End Sub
  395. Private Sub mnuFileRouting_Click()
  396.     On Error GoTo Err_Init
  397.     frmRules.Show vbModal
  398.     Exit Sub
  399. Err_Init:
  400.     HandleError CurrentModule, "mnuFileRouting_Click", Err.Number, Err.Description
  401. End Sub
  402. Private Sub mnuFileSave_Click()
  403.     On Error GoTo Err_Init
  404.     DB.SaveAttachments
  405.     Exit Sub
  406. Err_Init:
  407.     HandleError CurrentModule, "mnuFileSave_Click", Err.Number, Err.Description
  408. End Sub
  409. Private Sub mnuFileShortcut_Click()
  410.     On Error GoTo Err_Init
  411.     MsgBox "Shortcuts:" & vbCrLf & _
  412.      vbCrLf & _
  413.     "<ENTER> - Reply to current message" & vbCrLf & _
  414.     "<DEL> - Delete current message" & vbCrLf & _
  415.     "<ALT-CLICK> - Change color of current area" & vbCrLf & _
  416.     "<CTRL-CLICK> - Display message + headers with default text processor" & vbCrLf & _
  417.     "<CTRL-G> - Get Mail" & vbCrLf & _
  418.     "<CTRL-S> - Send Mail" & vbCrLf & _
  419.     "<CTRL-P> - Preferences" & vbCrLf & _
  420.     "<CTRL-T> - Save Attachments" & vbCrLf & _
  421.     "<CTRL-H> - Display Shortcuts" & vbCrLf & _
  422.     "<CTRL-Q> - Quit"
  423.     Exit Sub
  424. Err_Init:
  425.     HandleError CurrentModule, "mnuFileShortcut_Click", Err.Number, Err.Description
  426. End Sub
  427. Private Sub mnuForward_Click()
  428.     On Error GoTo Err_Init
  429.     DB.Forward
  430.     Exit Sub
  431. Err_Init:
  432.     HandleError CurrentModule, "mnuForward_Click", Err.Number, Err.Description
  433. End Sub
  434. Private Sub mnuOptionsAccount_Click()
  435.     On Error GoTo Err_Init
  436.     frmUser.Show vbModal
  437.     DB.EditUser
  438.     Status 3, "User: " & User.Name
  439.     Exit Sub
  440. Err_Init:
  441.     HandleError CurrentModule, "mnuOptionsAccount_Click", Err.Number, Err.Description
  442. End Sub
  443. Private Sub mnuOptionsGetMail_Click()
  444.     On Error GoTo Err_Init
  445.     If Receiving = True Then
  446.         Exit Sub
  447.     End If
  448.     Receiving = True
  449.     Screen.MousePointer = vbHourglass
  450.     frmMain.Enabled = False
  451.     CN.GetMail
  452.     DB.ApplyRules
  453.     Receiving = False
  454.     frmMain.Enabled = True
  455.     Screen.MousePointer = vbDefault
  456.     Exit Sub
  457. Err_Init:
  458.     HandleError CurrentModule, "mnuOptionsGetMail_Click", Err.Number, Err.Description
  459. End Sub
  460. Private Sub mnuOptionsSendMail_Click()
  461.     On Error GoTo Err_Init
  462.     If Receiving = True Then
  463.         Exit Sub
  464.     End If
  465.     Receiving = True
  466.     Screen.MousePointer = vbHourglass
  467.     frmMain.Enabled = False
  468.     DB.SendMail
  469.     Receiving = False
  470.     frmMain.Enabled = True
  471.     Screen.MousePointer = vbDefault
  472.     Exit Sub
  473. Err_Init:
  474.     HandleError CurrentModule, "mnuOptionsSendMail_Click", Err.Number, Err.Description
  475. End Sub
  476. Private Sub mnuProgrammer_Click()
  477.     On Error GoTo Err_Init
  478.     DB.Programmer
  479.     Exit Sub
  480. Err_Init:
  481.     HandleError CurrentModule, "mnuProgrammer_Click", Err.Number, Err.Description
  482. End Sub
  483. Private Sub pic_Resize(Index As Integer)
  484.     On Error GoTo Err_Init
  485.     If Index = 0 Then
  486.         lstFolders.Move -2, -2, pic(0).Width, pic(0).Height
  487.     ElseIf Index = 1 Then
  488.         tdbMail.Move -2, -2, pic(1).Width, pic(1).Height
  489.     ElseIf Index = 2 Then
  490.         txtMail.Move -4, -4, pic(2).Width + Margin + 1, pic(2).Height + Margin '- 15
  491.     End If
  492.     Exit Sub
  493. Err_Init:
  494.     HandleError CurrentModule, "pic_Resize", Err.Number, Err.Description
  495. End Sub
  496. Private Sub tdbMail_KeyUp(KeyCode As Integer, Shift As Integer)
  497.     On Error GoTo Err_Init
  498.     If KeyCode = 13 Then
  499.         DB.Reply
  500.     ElseIf KeyCode = vbKeyDelete Then
  501.         DB.DeleteMessage
  502.         Status 2, "Message deleted."
  503.     End If
  504.     Exit Sub
  505. Err_Init:
  506.     HandleError CurrentModule, "tdbMail_KeyUp", Err.Number, Err.Description
  507. End Sub
  508. Private Sub tmrClock_Timer()
  509.     On Error GoTo Err_Init
  510.     Status 1, Format(Now, "MM/DD/YY HH:MM:SS")
  511.     Exit Sub
  512. Err_Init:
  513.     HandleError CurrentModule, "tmrClock_Timer", Err.Number, Err.Description
  514. End Sub
  515. Private Sub tmrSize_Timer()
  516.     On Error GoTo Err_Init
  517.     If Sizing > "" Then
  518.         If Sizing = "v" Then
  519.             'move ns
  520.             Settings.VerticalDivider = mX / ScaleWidth
  521.         Else
  522.             'move ew
  523.             Settings.HorizontalDivider = mY / ScaleHeight
  524.         End If
  525.         Form_Resize
  526.     Else
  527.         tmrSize.Enabled = False
  528.     End If
  529.     Exit Sub
  530. Err_Init:
  531.     HandleError CurrentModule, "tmrSize_Timer", Err.Number, Err.Description
  532. End Sub
  533. '--------------------------------------------------------
  534. 'Color setting routines
  535. '--------------------------------------------------------
  536. Private Sub tdbMail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  537.     On Error GoTo Err_Init
  538.    Dim c As Long
  539.    Dim ShiftDown, AltDown, CtrlDown
  540.    ShiftDown = (Shift And vbShiftMask) > 0
  541.    AltDown = (Shift And vbAltMask) > 0
  542.    CtrlDown = (Shift And vbCtrlMask) > 0
  543.        
  544.     If AltDown = True And X > 270 Then
  545.         c = GetColor
  546.         If c >= 0 Then
  547.             Settings.Color(2) = c
  548.             tdbMail.BackColor = c
  549.             tdbMail.DeadAreaBackColor = c
  550.         End If
  551.     End If
  552.     Exit Sub
  553. Err_Init:
  554.     HandleError CurrentModule, "tdbMail_MouseDown", Err.Number, Err.Description
  555. End Sub
  556. Private Sub lstFolders_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  557.     On Error GoTo Err_Init
  558.     Dim c As Long
  559.     Dim ShiftDown, AltDown, CtrlDown
  560.     ShiftDown = (Shift And vbShiftMask) > 0
  561.     AltDown = (Shift And vbAltMask) > 0
  562.     CtrlDown = (Shift And vbCtrlMask) > 0
  563.     If AltDown = True Then
  564.         c = GetColor
  565.         If c >= 0 Then
  566.             Settings.Color(1) = c
  567.             lstFolders.BackColor = c
  568.         End If
  569.     End If
  570.     Exit Sub
  571. Err_Init:
  572.     HandleError CurrentModule, "lstFolders_MouseDown", Err.Number, Err.Description
  573. End Sub
  574. Private Sub txtMail_KeyUp(KeyCode As Integer, Shift As Integer)
  575.     On Error GoTo Err_Init
  576.     If KeyCode = 13 Then DB.Reply
  577.     Exit Sub
  578. Err_Init:
  579.     HandleError CurrentModule, "txtMail_KeyUp", Err.Number, Err.Description
  580. End Sub
  581. Private Sub txtMail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  582.     On Error GoTo Err_Init
  583.     Dim c As Long
  584.     Dim ShiftDown, AltDown, CtrlDown
  585.     ShiftDown = (Shift And vbShiftMask) > 0
  586.     AltDown = (Shift And vbAltMask) > 0
  587.     CtrlDown = (Shift And vbCtrlMask) > 0
  588.     If AltDown = True Then
  589.         c = GetColor
  590.         If c >= 0 Then
  591.             Settings.Color(3) = c
  592.             txtMail.BackColor = c
  593.         End If
  594.     End If
  595.     Exit Sub
  596. Err_Init:
  597.     HandleError CurrentModule, "txtMail_MouseDown", Err.Number, Err.Description
  598. End Sub
  599. Private Function GetColor() As Long
  600.     On Error GoTo Err_Init
  601.     With CommonDialog1
  602.         .CancelError = True
  603.         .ShowColor
  604.         GetColor = .Color
  605.     End With
  606.     Exit Function
  607. Err_Init:
  608.     If Err.Number = 32755 Then
  609.         'user cancelled
  610.     Else
  611.         MsgBox Err.Number & " - " & Err.Description
  612.     End If
  613.     GetColor = -1
  614. End Function
  615. Private Sub txtMail_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  616.     On Error GoTo Err_Init
  617.     Dim CtrlDown As Boolean
  618.     CtrlDown = (Shift And vbCtrlMask) > 0
  619.     If CtrlDown Then
  620.         'save as a text
  621.         DB.ExportMail
  622.     End If
  623.     Exit Sub
  624. Err_Init:
  625.     HandleError CurrentModule, "txtMail_MouseUp", Err.Number, Err.Description
  626. End Sub
  627.