VERSION 5.00 Begin VB.Form nMailSettingForm BorderStyle = 3 '固定ダイアログ Caption = "mail checker setting" ClientHeight = 4635 ClientLeft = 45 ClientTop = 330 ClientWidth = 6165 BeginProperty Font Name = "MS ゴシック" Size = 12 Charset = 128 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Icon = "nMailSettingForm.frx":0000 LinkTopic = "Form1" LockControls = -1 'True MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 4635 ScaleWidth = 6165 ShowInTaskbar = 0 'False StartUpPosition = 2 '画面の中央 Begin VB.CommandButton cmdCancel Caption = "キャンセル" Height = 495 Left = 3360 TabIndex = 13 Top = 3960 Width = 2415 End Begin VB.CommandButton cmdWriteSetting Caption = "レジストリに書込み" Height = 495 Left = 360 TabIndex = 12 Top = 3960 Width = 2415 End Begin VB.TextBox txtPassword Height = 375 IMEMode = 3 'オフ固定 Left = 1680 PasswordChar = "*" TabIndex = 11 Top = 3300 Width = 4335 End Begin VB.TextBox txtUserID Height = 375 IMEMode = 3 'オフ固定 Left = 1680 TabIndex = 9 Top = 2820 Width = 4335 End Begin VB.TextBox txtMailServer Height = 375 IMEMode = 3 'オフ固定 Left = 1680 TabIndex = 7 Top = 2340 Width = 4335 End Begin VB.ComboBox cboCheckInterval Height = 360 IMEMode = 3 'オフ固定 ItemData = "nMailSettingForm.frx":000C Left = 1680 List = "nMailSettingForm.frx":0028 Style = 2 'ドロップダウン リスト TabIndex = 5 Top = 1860 Width = 1335 End Begin VB.Frame fraMailerSelect Caption = "起動メーラー" Height = 1575 Left = 120 TabIndex = 0 Top = 120 Width = 5895 Begin VB.TextBox txtMailShellExe Height = 375 Left = 480 TabIndex = 3 Text = "%ProgramFiles%\Outlook Express\msimn.exe" Top = 1000 Width = 5175 End Begin VB.OptionButton optAntiMs Caption = "正常に動く自分のメーラー" Height = 255 Left = 240 TabIndex = 2 Top = 720 Width = 5415 End Begin VB.OptionButton optNonAntiMs Caption = "仕方なくMS標準設定のメーラー" Height = 255 Left = 240 TabIndex = 1 Top = 360 Value = -1 'True Width = 5415 End End Begin VB.Label lblPassword AutoSize = -1 'True BackStyle = 0 '透明 Caption = "パスワード" Height = 240 Left = 360 TabIndex = 10 Top = 3360 Width = 1200 End Begin VB.Label lblUserID AutoSize = -1 'True BackStyle = 0 '透明 Caption = "ユーザID" Height = 240 Left = 360 TabIndex = 8 Top = 2880 Width = 1200 End Begin VB.Label lblMailServer AutoSize = -1 'True BackStyle = 0 '透明 Caption = "メールサーバ" Height = 240 Left = 120 TabIndex = 6 Top = 2400 Width = 1440 End Begin VB.Label lblCheckInterval AutoSize = -1 'True BackStyle = 0 '透明 Caption = "チェック間隔" Height = 240 Left = 120 TabIndex = 4 Top = 1920 Width = 1440 End End Attribute VB_Name = "nMailSettingForm" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Sub cmdCancel_Click() '設定終了 Unload Me End Sub Private Sub cmdWriteSetting_Click() Dim WshShell As Object Dim strSelectMailer As String Dim strNormalMailer As String Dim strRegisterWiteDate As String '正しく設定が行われていない場合 If Trim(txtUserID.Text) = "" Or _ Trim(txtMailServer.Text) = "" Or _ (optNonAntiMs.Value <> True And Trim(txtMailShellExe.Text) = "") Then MsgBox "正しく設定がされていません、設定し直してください", vbExclamation, "環境設定" Exit Sub End If '書込み時間の決定 strRegisterWiteDate = Now '済し崩しの場合 If optNonAntiMs.Value = True Then '標準メーラー gtypUser.MailerFlg = 0 '標準メーラー名をレジストリより抽出 strSelectMailer = RegisterNormalStringRead(HKEY_LOCAL_MACHINE, _ "SOFTWARE\Clients\Mail\") '標準メーラー起動パスを取得 gtypUser.NormalMailerPath = RegisterNormalStringRead(HKEY_LOCAL_MACHINE, _ "SOFTWARE\Clients\Mail\" & _ strSelectMailer & _ "\shell\open\command\") 'パスをコンバート gtypUser.NormalMailerPath = PathConvertEnviron(gtypUser.NormalMailerPath) Else '独自のメーラー gtypUser.MailerFlg = 1000 'メーラーパス設定 gtypUser.MailerPath = txtMailShellExe.Text 'パスをコンバート gtypUser.MailerPath = PathConvertEnviron(gtypUser.MailerPath) End If 'チェック間隔設定 gtypUser.MailCheckInterval = cboCheckInterval.ListIndex 'メールチェックインターバルを設定 Select Case gtypUser.MailCheckInterval Case 0 ' 2秒 nMailCheckerForm.tmrMailCheck.Interval = 2000 Case 1 ' 5秒 nMailCheckerForm.tmrMailCheck.Interval = 5000 Case 2 '10秒 nMailCheckerForm.tmrMailCheck.Interval = 10000 Case 3 '15秒 nMailCheckerForm.tmrMailCheck.Interval = 15000 Case 4 '20秒 nMailCheckerForm.tmrMailCheck.Interval = 20000 Case 5 '30秒 nMailCheckerForm.tmrMailCheck.Interval = 30000 Case 6 '45秒 nMailCheckerForm.tmrMailCheck.Interval = 45000 Case Else '60秒 nMailCheckerForm.tmrMailCheck.Interval = 60000 End Select 'サーバアドレス設定 gtypUser.ServerAddress = txtMailServer.Text 'ユーザID設定 gtypUser.UserID = txtUserID.Text 'パスワード設定 gtypUser.Password = txtPassword.Text '書込み時間設定 gtypUser.LastUpdate = strRegisterWiteDate 'レジストリに書込 Call RegisterEdit(2000, REG_DIR_NAME, App.EXEName) 'メールチェック開始 nMailCheckerForm.tmrMailCheck.Enabled = True '設定終了 Unload Me End Sub Private Sub Form_Load() '済し崩しの場合 If gtypUser.MailerFlg = 0 Then '標準メーラー optNonAntiMs.Value = True Else '独自メーラー optAntiMs.Value = True End If 'メーラーパス設定 txtMailShellExe.Text = gtypUser.MailerPath 'チェック間隔設定 cboCheckInterval.ListIndex = gtypUser.MailCheckInterval 'サーバアドレス設定 txtMailServer.Text = gtypUser.ServerAddress 'ユーザID設定 txtUserID.Text = gtypUser.UserID 'パスワード設定 txtPassword.Text = gtypUser.Password End Sub