home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Telelist
- BackColor = &H00C0C000&
- BorderStyle = 3 'Fixed Double
- Caption = "ADIALER"
- ClientHeight = 4005
- ClientLeft = 3120
- ClientTop = 2325
- ClientWidth = 5055
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00C0C000&
- Height = 4695
- Icon = TELELIST.FRX:0000
- Left = 3060
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 4005
- ScaleWidth = 5055
- Top = 1695
- Width = 5175
- Begin CommandButton QuitBut
- Caption = "Quit"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 405
- Left = 3375
- TabIndex = 7
- Top = 3510
- Width = 930
- End
- Begin CommandButton DelNameBut
- Caption = "Delete Name"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 450
- Left = 1395
- TabIndex = 6
- Top = 3375
- Width = 1455
- End
- Begin CommandButton ReDialBut
- Caption = "ReDial"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 465
- Left = 135
- TabIndex = 12
- Top = 3375
- Width = 1140
- End
- Begin CommandButton TimeBut
- BackColor = &H00808000&
- Caption = "Current Time"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 420
- Left = 3105
- TabIndex = 8
- Top = 3015
- Width = 1725
- End
- Begin CommandButton AddNameBut
- Caption = "Add Name"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 450
- Left = 1395
- TabIndex = 5
- Top = 2835
- Width = 1425
- End
- Begin CommandButton DialBut
- BackColor = &H00FFFFFF&
- Caption = "Dial"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 450
- Left = 135
- TabIndex = 4
- Top = 2835
- Width = 1155
- End
- Begin Frame Frame1
- BackColor = &H00E0FFFF&
- Height = 915
- Left = 3060
- TabIndex = 9
- Top = 2070
- Width = 1905
- Begin CheckBox PrefixCBox
- BackColor = &H00E0FFFF&
- Caption = "Use Prefix"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FF0000&
- Height = 330
- Left = 315
- TabIndex = 3
- Top = 495
- Width = 1275
- End
- Begin TextBox PrefixTxtBox
- BackColor = &H00FFFFFF&
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00808080&
- Height = 360
- Left = 1035
- TabIndex = 2
- Top = 135
- Width = 690
- End
- Begin Label Label2
- BackColor = &H00E0FFFF&
- Caption = "Prefix :"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FF0000&
- Height = 285
- Left = 180
- TabIndex = 10
- Top = 180
- Width = 690
- End
- End
- Begin Frame Frame2
- BackColor = &H00E0FFFF&
- Caption = "Enter Number to Call"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H000000FF&
- Height = 690
- Left = 90
- TabIndex = 11
- Top = 2070
- Width = 2985
- Begin TextBox EnterNumTxtBox
- Height = 330
- Left = 180
- TabIndex = 1
- Top = 270
- Width = 2445
- End
- End
- Begin ListBox TeleListBox
- BackColor = &H00E0FFFF&
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 1950
- Left = 90
- Sorted = -1 'True
- TabIndex = 0
- Top = 135
- Width = 4875
- End
- Begin Menu ConfigMen
- Caption = "Configure"
- Begin Menu ComPortMen
- Caption = "Com Port"
- Begin Menu Com1Men
- Caption = "Com 1"
- End
- Begin Menu Com2Men
- Caption = "Com 2"
- End
- Begin Menu Com3Men
- Caption = "Com 3"
- End
- Begin Menu Com4Men
- Caption = "Com 4"
- End
- End
- End
- Dim ComMenChk As Integer
- Sub AddNameBut_Click ()
- NameIn.Show
- End Sub
- Sub Check1_Click ()
- 'To avoid dialog box on startup check for ComNo$ which will not be prensent at startup
- If Left$(ComNo$, 3) = "Com" Then
- If MsgBox("Make this setting the default?", 292) = 7 Then
- Exit Sub
- End If
- End If
- 'Write Prefix data to ADIALER.INI to make it default
- If PrefixCBox.Value = 1 Then
- lpstring$ = "On"
- ElseIf PrefixCBox.Value = 0 Then
- lpstring$ = "Off"
- End If
- lpAppName$ = "Prefix"
- lpFileName$ = "ADIALER.INI"
- lpKeyName$ = "On/Off"
- WritePreIndex% = WritePrivateProfileString(lpAppName$, lpKeyName$, lpstring$, lpFileName$)
- End Sub
- Sub Com1Men_Click ()
- 'Set the check on menus
- ComNo$ = "Com1"
- Com1Men.Checked = -1
- Com2Men.Checked = 0
- Com3Men.Checked = 0
- Com4Men.Checked = 0
- 'Set ComPort setting in ADIALER.INI file with Sub Function
- SetComVar = SetComPort(ComNo$)
- End Sub
- Sub Com2Men_Click ()
- ComNo$ = "Com2"
- Com1Men.Checked = 0
- Com2Men.Checked = -1
- Com3Men.Checked = 0
- Com4Men.Checked = 0
- 'Set ComPort setting in ADIALER.INI file with Sub Function
- SetComVar = SetComPort(ComNo$)
- End Sub
- Sub Com3Men_Click ()
- ComNo$ = "Com3"
- Com1Men.Checked = 0
- Com2Men.Checked = 0
- Com3Men.Checked = -1
- Com4Men.Checked = 0
- ComMenChk% = 3
- 'Set ComPort setting in ADIALER.INI file with Sub Function
- SetComVar = SetComPort(ComNo$)
- End Sub
- Sub Com4Men_Click ()
- ComNo$ = "Com4"
- Com1Men.Checked = 0
- Com2Men.Checked = 0
- Com3Men.Checked = 0
- Com4Men.Checked = -1
- ComMenChk% = 4
- 'Set ComPort setting in ADIALER.INI file with Sub Function
- SetComVar = SetComPort(ComNo$)
- End Sub
- Sub Command1_Click ()
- CR$ = Chr$(13) + Chr$(10)
- ComNo$ = "Com2"
- OpenCom% = OpenComm(ComNo$, 128, 64)
- If OpenCom% < 0 Then
- MsgBox "Couldn't open Com Port" + CR$ + "Check configuration!!"
- Exit Sub
- End If
- DialString$ = "ATDT" + "723-7429" + CR$
- ModemWrite% = WriteComm(OpenCom%, DialString$, 20)
- 'Pause loop
- For I = 1 To 100
- For I2 = 1 To 1000
- Next I2
- Next I
- MsgBox "Pick up the phone and press Enter"
- 'Turn off modem
- Break$ = "+++~~~ATH" + CR$
- ModemOff% = WriteComm(OpenCom%, Break$, 20)
- If CloseComm(1) < 0 Then
- MsgBox "Com port not closed"
- End If
- End Sub
- Sub DelNameBut_Click ()
- 'Make sure the file is supposed to be deleted
- If MsgBox("Are you sure you want to delete this entry", 36) = 7 Then
- Exit Sub
- End If
- 'First delete the old ADIALER.INI file with Sub Procedure from ADIALER.BAS
- DelNamIni
- 'Next delete item in listBox
- DelIndex% = TeleListBox.ListIndex
- TeleListBox.RemoveItem DelIndex%
- TeleListBox.Refresh
- 'Next update the list in the ADIALER.INI file with a Sub Procedure
- UpdateNamIni
- End Sub
- Sub DialBut_Click ()
- 'Check to make sure there is a name and number
- If EnterNumTxtBox.Text = "" Then
- If TeleListBox.Text = "" Then
- MsgBox "No number specified"
- End If
- End If
- 'Determine source of phone number
- If EnterNumTxtBox.Text <> "" Then
- PhoneNum$ = EnterNumTxtBox.Text
- EnterNumTxtBox.Text = "" 'Clears number from entry box
- Else
- PhoneNum$ = TeleListBox.Text
- End If
- 'Dial the phone number using a sub procedure in ADIALER.INI
- Dial
- End Sub
- Sub DialBut2_Click ()
- CR$ = Chr$(13) + Chr$(10)
- 'Check that a name and number have been selected
- If TeleListBox.Text = "" Then
- If EnterNumTxtBox.Text = "" Then
- MsgBox "No Name specified!"
- Exit Sub
- End If
- End If
- PhoneNum$ = TeleListBox.Text
- If EnterNumTxtBox.Text <> "" Then
- PhoneNum$ = EnterNumTxtBox.Text
- EnterNumTxtBox.Text = ""
- End If
- 'Dial phone by call Dial sub procedure in ADIALER.BAS
- Dial
- End Sub
- Sub Form_Load ()
- 'Center the form on loading
- Left = (Screen.Width - Width) / 2
- Top = (Screen.Height - Height) / 2
- CR$ = Chr$(13) + Chr$(10)
- Load NameIn 'Loads input dialog box
- 'Set up the Prefix On/Off option
- 'First check for ADIALER.INI file using the FileCheck value
- lpApplication$ = "FileCheck"
- lpKeyName$ = "CheckString"
- Dim CheckIniStr As String * 5 'make fixed length because of DLL return
- lpDefault$ = "No"
- nSize% = 5
- lpFileName$ = "ADIALER.INI"
- CheckVar% = GetPrivateProfileString(lpApplication$, lpKeyName$, lpDefault$, CheckIniStr$, nSize%, lpFileName$)
- If Left$(CheckIniStr$, 3) <> "Yes" Then
- MsgRet% = MsgBox("Could not find ADIALER.INI file" + CR$ + "It will be created in Windows directory!" + CR$ + "You will need to reconfigure.")
- lpstring$ = "Yes"
- WriteVar% = WritePrivateProfileString(lpApplication$, lpKeyName$, lpstring$, lpFileName$)
- End If
- 'Get prefix
- lpApplication$ = "Prefix"
- lpKeyName$ = "On/Off"
- Dim PrefixOnOff As String * 4 'make fixed length because of DLL return
- lpDefault$ = "Off"
- nSize% = 4
- 'Gets Prefix On or Off from ADIALER.INI and checks the menu selection
- GetPrefixVar% = GetPrivateProfileString(lpApplication$, lpKeyName$, lpDefault$, PrefixOnOff$, nSize%, lpFileName$)
- If Left$(PrefixOnOff$, 3) = "Off" Then
- PrefixCBox.Value = 0
- Else
- PrefixCBox.Value = 1
- End If
- 'Set up the Prefix textbox from ADIALER.INI
- lpApplication$ = "Prefix"
- lpKeyName$ = "Prefix String"
- Dim PrefixStr As String * 3 'make fixed length because of DLL return
- lpDefault$ = ""
- nSize% = 3
- 'Gets Prefix string from ADIALER.INI and checks the menu selection
- GetPrefixStrVar% = GetPrivateProfileString(lpApplication$, lpKeyName$, lpDefault$, PrefixStr$, nSize%, lpFileName$)
- PrefixTxtBox.Text = PrefixStr$
- 'Set up the ComPort from ADIALER.INI file
- lpApplication$ = "ComPort"
- lpKeyName$ = "ComNo"
- lpDefault$ = "Com2"
- nSize% = 5
- lpFileName$ = "ADIALER.INI"
- 'Gets Com Number from ADIALER.INI and checks the menu selection
- GetComPortVar% = GetPrivateProfileString(lpApplication$, lpKeyName$, lpDefault$, ComNo$, nSize%, lpFileName$)
- If ComNo$ = "Com1" Then
- Com1Men.Checked = -1
- ElseIf ComNo$ = "Com2" Then
- Com2Men.Checked = -1
- ElseIf ComNo$ = "Com3" Then
- Com3Men.Checked = -1
- ElseIf ComNo$ = "Com4" Then
- Com4Men.Checked = -1
- End If
- 'Fill the TeleListBox
- 'List Box loading loop
- lpApplication$ = "Names and Numbers"
- lpDefault$ = "Empty"
- Dim LoadStr As String * 50
- nSize% = 60
- Do
- I = I + 1
- lpKeyName$ = "Name" + Str$(I)
- GetStringVar% = GetPrivateProfileString(lpApplication$, lpKeyName$, lpDefault$, LoadStr$, nSize%, lpFileName$)
- 'Stop loop if reach end of data
- If Len(RTrim$(LoadStr$)) < 3 Then
- Exit Sub
- ElseIf Left$(LoadStr$, 5) = "Empty" Then
- Exit Sub
- End If
- TeleListBox.AddItem RTrim$(LoadStr$)
- LoadStr$ = ""
- Loop
- End Sub
- Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Button = 2 Then MouseBut% = 2
- End Sub
- Sub PrefixCBox_Click ()
- 'To avoid dialog box on startup check for ComNo$ which will not be prensent at startup
- If Left$(ComNo$, 3) = "Com" Then
- If MsgBox("Make this setting the default?", 292) = 7 Then
- Exit Sub
- End If
- End If
- 'Write Prefix data to ADIALER.INI to make it default
- If PrefixCBox.Value = 1 Then
- lpstring$ = "On"
- ElseIf PrefixCBox.Value = 0 Then
- lpstring$ = "Off"
- End If
- lpAppName$ = "Prefix"
- lpFileName$ = "ADIALER.INI"
- lpKeyName$ = "On/Off"
- WritePreIndex% = WritePrivateProfileString(lpAppName$, lpKeyName$, lpstring$, lpFileName$)
- End Sub
- Sub PrefixTxtBox_Change ()
- 'Write Prefix string to ADIALER.INI to make it default
- lpAppName$ = "Prefix"
- lpFileName$ = "ADIALER.INI"
- lpKeyName$ = "Prefix String"
- lpstring$ = PrefixTxtBox.Text
- WritePreIndex% = WritePrivateProfileString(lpAppName$, lpKeyName$, lpstring$, lpFileName$)
- End Sub
- Sub QuitBut_Click ()
- End
- End Sub
- Sub ReDialBut_Click ()
- Dial
- End Sub
- Sub TeleListBox_DblClick ()
- DialBut.Value = -1
- End Sub
- Sub Text1_Change ()
- 'Write Prefix string to ADIALER.INI to make it default
- lpAppName$ = "Prefix"
- lpFileName$ = "ADIALER.INI"
- lpKeyName$ = "Prefix String"
- lpstring$ = PrefixTxtBox.Text
- WritePreIndex% = WritePrivateProfileString(lpAppName$, lpKeyName$, lpstring$, lpFileName$)
- End Sub
- Sub TimeBox_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- TimeBut.Print Format$(Now, "h:mm am/pm")
- End Sub
- Sub TimeBut_Click ()
- TimeBut.Caption = Format$(Now, "h:mm am/pm")
- 'Delay loop for one second
- Start! = Timer
- Do Until Finish! > Start! + 1
- Finish! = Timer
- Loop
- TimeBut.Caption = "Current Time"
- End Sub
-