home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 4_2005-2006.ISO / data / Zips / Communicat2010057312006.psc / ADialer.fld < prev    next >
Text File  |  1998-09-25  |  31KB  |  925 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
  3. Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
  4. Begin VB.Form frmCall 
  5.    BorderStyle     =   3  'Fixed Dialog
  6.    Caption         =   "Communicator"
  7.    ClientHeight    =   4035
  8.    ClientLeft      =   3030
  9.    ClientTop       =   1200
  10.    ClientWidth     =   3075
  11.    Icon            =   "ADialer.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4035
  16.    ScaleWidth      =   3075
  17.    ShowInTaskbar   =   0   'False
  18.    Begin VB.CommandButton cmdBack 
  19.       BackColor       =   &H00008000&
  20.       Caption         =   "&<<"
  21.       Height          =   330
  22.       Left            =   105
  23.       Style           =   1  'Graphical
  24.       TabIndex        =   19
  25.       Top             =   2520
  26.       Width           =   1065
  27.    End
  28.    Begin MSCommLib.MSComm MSComm1 
  29.       Left            =   2310
  30.       Top             =   3150
  31.       _ExtentX        =   1005
  32.       _ExtentY        =   1005
  33.       _Version        =   327680
  34.       CommPort        =   4
  35.       DTREnable       =   -1  'True
  36.       InputMode       =   1
  37.    End
  38.    Begin VB.CommandButton cmdConnect 
  39.       BackColor       =   &H00FF8080&
  40.       Caption         =   "&Connect"
  41.       BeginProperty Font 
  42.          Name            =   "MS Sans Serif"
  43.          Size            =   8.25
  44.          Charset         =   0
  45.          Weight          =   700
  46.          Underline       =   0   'False
  47.          Italic          =   0   'False
  48.          Strikethrough   =   0   'False
  49.       EndProperty
  50.       Height          =   435
  51.       Left            =   105
  52.       Style           =   1  'Graphical
  53.       TabIndex        =   17
  54.       Top             =   1365
  55.       Width           =   1065
  56.    End
  57.    Begin ComctlLib.StatusBar StatusBar1 
  58.       Align           =   2  'Align Bottom
  59.       Height          =   435
  60.       Left            =   0
  61.       TabIndex        =   16
  62.       Top             =   3600
  63.       Width           =   3075
  64.       _ExtentX        =   5424
  65.       _ExtentY        =   767
  66.       SimpleText      =   ""
  67.       _Version        =   327682
  68.       BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
  69.          NumPanels       =   1
  70.          BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  71.             Object.Width           =   5715
  72.             MinWidth        =   5715
  73.             Picture         =   "ADialer.frx":0442
  74.             Text            =   "Asim Creations"
  75.             TextSave        =   "Asim Creations"
  76.             Object.Tag             =   ""
  77.          EndProperty
  78.       EndProperty
  79.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  80.          Name            =   "Lucida Calligraphy"
  81.          Size            =   9.75
  82.          Charset         =   0
  83.          Weight          =   700
  84.          Underline       =   0   'False
  85.          Italic          =   0   'False
  86.          Strikethrough   =   0   'False
  87.       EndProperty
  88.    End
  89.    Begin VB.CommandButton cmd0 
  90.       BackColor       =   &H00004080&
  91.       Caption         =   "0"
  92.       BeginProperty Font 
  93.          Name            =   "MS Sans Serif"
  94.          Size            =   13.5
  95.          Charset         =   0
  96.          Weight          =   700
  97.          Underline       =   0   'False
  98.          Italic          =   0   'False
  99.          Strikethrough   =   0   'False
  100.       EndProperty
  101.       Height          =   540
  102.       Index           =   0
  103.       Left            =   1365
  104.       Style           =   1  'Graphical
  105.       TabIndex        =   15
  106.       Top             =   2940
  107.       Width           =   1590
  108.    End
  109.    Begin VB.CommandButton cmdExit 
  110.       BackColor       =   &H000000FF&
  111.       Caption         =   "E&xit"
  112.       BeginProperty Font 
  113.          Name            =   "MS Sans Serif"
  114.          Size            =   8.25
  115.          Charset         =   0
  116.          Weight          =   700
  117.          Underline       =   0   'False
  118.          Italic          =   0   'False
  119.          Strikethrough   =   0   'False
  120.       EndProperty
  121.       Height          =   540
  122.       Left            =   105
  123.       Style           =   1  'Graphical
  124.       TabIndex        =   12
  125.       Top             =   2940
  126.       Width           =   1065
  127.    End
  128.    Begin VB.CommandButton cmdAddress 
  129.       BackColor       =   &H00008000&
  130.       Caption         =   "&Address Book"
  131.       BeginProperty Font 
  132.          Name            =   "MS Sans Serif"
  133.          Size            =   8.25
  134.          Charset         =   0
  135.          Weight          =   700
  136.          Underline       =   0   'False
  137.          Italic          =   0   'False
  138.          Strikethrough   =   0   'False
  139.       EndProperty
  140.       Height          =   540
  141.       Left            =   105
  142.       Style           =   1  'Graphical
  143.       TabIndex        =   11
  144.       Top             =   1890
  145.       Width           =   1065
  146.    End
  147.    Begin VB.CommandButton cmd3 
  148.       BackColor       =   &H00004080&
  149.       Caption         =   "3"
  150.       BeginProperty Font 
  151.          Name            =   "MS Sans Serif"
  152.          Size            =   13.5
  153.          Charset         =   0
  154.          Weight          =   700
  155.          Underline       =   0   'False
  156.          Italic          =   0   'False
  157.          Strikethrough   =   0   'False
  158.       EndProperty
  159.       Height          =   540
  160.       Index           =   3
  161.       Left            =   2415
  162.       Style           =   1  'Graphical
  163.       TabIndex        =   10
  164.       Top             =   2415
  165.       Width           =   540
  166.    End
  167.    Begin VB.CommandButton cmd2 
  168.       BackColor       =   &H00004080&
  169.       Caption         =   "2"
  170.       BeginProperty Font 
  171.          Name            =   "MS Sans Serif"
  172.          Size            =   13.5
  173.          Charset         =   0
  174.          Weight          =   700
  175.          Underline       =   0   'False
  176.          Italic          =   0   'False
  177.          Strikethrough   =   0   'False
  178.       EndProperty
  179.       Height          =   540
  180.       Index           =   2
  181.       Left            =   1890
  182.       Style           =   1  'Graphical
  183.       TabIndex        =   9
  184.       Top             =   2415
  185.       Width           =   540
  186.    End
  187.    Begin VB.CommandButton cmd1 
  188.       BackColor       =   &H00004080&
  189.       Caption         =   "1"
  190.       BeginProperty Font 
  191.          Name            =   "MS Sans Serif"
  192.          Size            =   13.5
  193.          Charset         =   0
  194.          Weight          =   700
  195.          Underline       =   0   'False
  196.          Italic          =   0   'False
  197.          Strikethrough   =   0   'False
  198.       EndProperty
  199.       Height          =   540
  200.       Index           =   1
  201.       Left            =   1365
  202.       Style           =   1  'Graphical
  203.       TabIndex        =   8
  204.       Top             =   2415
  205.       Width           =   540
  206.    End
  207.    Begin VB.CommandButton cmd6 
  208.       BackColor       =   &H00004080&
  209.       Caption         =   "6"
  210.       BeginProperty Font 
  211.          Name            =   "MS Sans Serif"
  212.          Size            =   13.5
  213.          Charset         =   0
  214.          Weight          =   700
  215.          Underline       =   0   'False
  216.          Italic          =   0   'False
  217.          Strikethrough   =   0   'False
  218.       EndProperty
  219.       Height          =   540
  220.       Index           =   6
  221.       Left            =   2415
  222.       Style           =   1  'Graphical
  223.       TabIndex        =   7
  224.       Top             =   1890
  225.       Width           =   540
  226.    End
  227.    Begin VB.CommandButton cmd5 
  228.       BackColor       =   &H00004080&
  229.       Caption         =   "5"
  230.       BeginProperty Font 
  231.          Name            =   "MS Sans Serif"
  232.          Size            =   13.5
  233.          Charset         =   0
  234.          Weight          =   700
  235.          Underline       =   0   'False
  236.          Italic          =   0   'False
  237.          Strikethrough   =   0   'False
  238.       EndProperty
  239.       Height          =   540
  240.       Index           =   5
  241.       Left            =   1890
  242.       Style           =   1  'Graphical
  243.       TabIndex        =   6
  244.       Top             =   1890
  245.       Width           =   540
  246.    End
  247.    Begin VB.CommandButton cmd4 
  248.       BackColor       =   &H00004080&
  249.       Caption         =   "4"
  250.       BeginProperty Font 
  251.          Name            =   "MS Sans Serif"
  252.          Size            =   13.5
  253.          Charset         =   0
  254.          Weight          =   700
  255.          Underline       =   0   'False
  256.          Italic          =   0   'False
  257.          Strikethrough   =   0   'False
  258.       EndProperty
  259.       Height          =   540
  260.       Index           =   4
  261.       Left            =   1365
  262.       Style           =   1  'Graphical
  263.       TabIndex        =   5
  264.       Top             =   1890
  265.       Width           =   540
  266.    End
  267.    Begin VB.CommandButton cmd9 
  268.       BackColor       =   &H00004080&
  269.       Caption         =   "9"
  270.       BeginProperty Font 
  271.          Name            =   "MS Sans Serif"
  272.          Size            =   13.5
  273.          Charset         =   0
  274.          Weight          =   700
  275.          Underline       =   0   'False
  276.          Italic          =   0   'False
  277.          Strikethrough   =   0   'False
  278.       EndProperty
  279.       Height          =   540
  280.       Index           =   9
  281.       Left            =   2415
  282.       Style           =   1  'Graphical
  283.       TabIndex        =   4
  284.       Top             =   1365
  285.       Width           =   540
  286.    End
  287.    Begin VB.CommandButton cmd8 
  288.       BackColor       =   &H00004080&
  289.       Caption         =   "8"
  290.       BeginProperty Font 
  291.          Name            =   "MS Sans Serif"
  292.          Size            =   13.5
  293.          Charset         =   0
  294.          Weight          =   700
  295.          Underline       =   0   'False
  296.          Italic          =   0   'False
  297.          Strikethrough   =   0   'False
  298.       EndProperty
  299.       Height          =   540
  300.       Index           =   8
  301.       Left            =   1890
  302.       Style           =   1  'Graphical
  303.       TabIndex        =   3
  304.       Top             =   1365
  305.       Width           =   540
  306.    End
  307.    Begin VB.CommandButton cmd7 
  308.       BackColor       =   &H00004080&
  309.       Caption         =   "7"
  310.       BeginProperty Font 
  311.          Name            =   "MS Sans Serif"
  312.          Size            =   13.5
  313.          Charset         =   0
  314.          Weight          =   700
  315.          Underline       =   0   'False
  316.          Italic          =   0   'False
  317.          Strikethrough   =   0   'False
  318.       EndProperty
  319.       Height          =   540
  320.       Index           =   7
  321.       Left            =   1365
  322.       Style           =   1  'Graphical
  323.       TabIndex        =   2
  324.       Top             =   1365
  325.       Width           =   540
  326.    End
  327.    Begin VB.TextBox txtPhone 
  328.       Height          =   330
  329.       Left            =   840
  330.       TabIndex        =   1
  331.       Top             =   840
  332.       Width           =   2115
  333.    End
  334.    Begin VB.TextBox txtName 
  335.       Height          =   330
  336.       Left            =   840
  337.       TabIndex        =   0
  338.       Top             =   420
  339.       Width           =   2115
  340.    End
  341.    Begin ComctlLib.ImageList ImageList1 
  342.       Left            =   210
  343.       Top             =   1050
  344.       _ExtentX        =   1005
  345.       _ExtentY        =   1005
  346.       BackColor       =   -2147483633
  347.       ImageWidth      =   32
  348.       ImageHeight     =   32
  349.       MaskColor       =   -2147483627
  350.       _Version        =   327682
  351.       BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
  352.          NumListImages   =   3
  353.          BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  354.             Picture         =   "ADialer.frx":075C
  355.             Key             =   ""
  356.          EndProperty
  357.          BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  358.             Picture         =   "ADialer.frx":0A76
  359.             Key             =   ""
  360.          EndProperty
  361.          BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  362.             Picture         =   "ADialer.frx":0D90
  363.             Key             =   ""
  364.          EndProperty
  365.       EndProperty
  366.    End
  367.    Begin VB.Label Label3 
  368.       Alignment       =   2  'Center
  369.       Caption         =   "Making a call ......."
  370.       BeginProperty Font 
  371.          Name            =   "Lucida Sans"
  372.          Size            =   12
  373.          Charset         =   0
  374.          Weight          =   700
  375.          Underline       =   0   'False
  376.          Italic          =   -1  'True
  377.          Strikethrough   =   0   'False
  378.       EndProperty
  379.       Height          =   330
  380.       Left            =   315
  381.       TabIndex        =   18
  382.       Top             =   0
  383.       Width           =   2640
  384.    End
  385.    Begin VB.Label Label2 
  386.       Caption         =   "PHONE :"
  387.       Height          =   225
  388.       Left            =   105
  389.       TabIndex        =   14
  390.       Top             =   840
  391.       Width           =   750
  392.    End
  393.    Begin VB.Label Label1 
  394.       Caption         =   "NAME :"
  395.       Height          =   225
  396.       Left            =   105
  397.       TabIndex        =   13
  398.       Top             =   420
  399.       Width           =   645
  400.    End
  401. End
  402. Attribute VB_Name = "frmCall"
  403. Attribute VB_GlobalNameSpace = False
  404. Attribute VB_Creatable = False
  405. Attribute VB_PredeclaredId = True
  406. Attribute VB_Exposed = False
  407. '******************************************************************************
  408.  
  409. 'This form is used to dial the Phone Number. It has a very special
  410. 'graphical display of differents events happening durring dialing.
  411. 'It also has a LED simulated Musical numeric keypad and address
  412. 'book to store,retrive and delete the stored data. Moreover, it has a
  413. 'search engine too.
  414.  
  415. '******************************************************************************
  416. Dim dummy
  417. Dim fromModem$
  418. Public FlagBack As Boolean
  419. Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
  420. Const SND_ASYNC = &H1         '  play asynchronously
  421. Dim Snd As Integer
  422. Private Sub cmd0_Click(Index As Integer)
  423. txtPhone.text = txtPhone.text + "0"
  424. 'API is used for playing of sound asynchronously i.e. without
  425. 'halting any task. Computer plays the sound in background.
  426. Snd = sndPlaySound("pluck_a.wav", SND_ASYNC)
  427.  
  428. End Sub
  429.  
  430. Private Sub cmd0_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  431. 'The following procedure is used to make the LED like display.
  432. If cmd0(0).BackColor = &H4080& Then
  433. cmd0(0).BackColor = vbGreen
  434.    If cmd0(0).BackColor = vbGreen Then
  435.    cmd1(1).BackColor = &H4080&      'This constant is the code for dark brown color
  436.    cmd2(2).BackColor = &H4080&
  437.    cmd3(3).BackColor = &H4080&
  438.    cmd4(4).BackColor = &H4080&
  439.    cmd5(5).BackColor = &H4080&
  440.    cmd6(6).BackColor = &H4080&
  441.    cmd7(7).BackColor = &H4080&
  442.    cmd8(8).BackColor = &H4080&
  443.    cmd9(9).BackColor = &H4080&
  444.    End If
  445. End If
  446. End Sub
  447.  
  448. Private Sub cmd1_Click(Index As Integer)
  449. txtPhone.text = txtPhone.text + "1"
  450. 'for each clicking of button the sound is played. The file is located
  451. 'in current directory.
  452. Snd = sndPlaySound("pluck_a.wav", SND_ASYNC)
  453.  
  454. End Sub
  455.  
  456. Private Sub cmd1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  457. 'The following procedure is used to make the LED like display.
  458. If cmd1(1).BackColor = &H4080& Then
  459. cmd1(1).BackColor = vbGreen
  460.    If cmd1(1).BackColor = vbGreen Then
  461.    cmd0(0).BackColor = &H4080&
  462.    cmd2(2).BackColor = &H4080&
  463.    cmd3(3).BackColor = &H4080&
  464.    cmd4(4).BackColor = &H4080&
  465.    cmd5(5).BackColor = &H4080&
  466.    cmd6(6).BackColor = &H4080&
  467.    cmd7(7).BackColor = &H4080&
  468.    cmd8(8).BackColor = &H4080&
  469.    cmd9(9).BackColor = &H4080&
  470.    End If
  471. End If
  472. End Sub
  473.  
  474. Private Sub cmd2_Click(Index As Integer)
  475. txtPhone.text = txtPhone.text + "2"
  476.    Snd = sndPlaySound("pluck_a.wav", SND_ASYNC)
  477.  
  478. End Sub
  479.  
  480. Private Sub cmd2_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  481. 'The following procedure is used to make the LED like display.
  482. If cmd2(2).BackColor = &H4080& Then
  483. cmd2(2).BackColor = vbGreen
  484.    If cmd2(2).BackColor = vbGreen Then
  485.    cmd1(1).BackColor = &H4080&
  486.    cmd0(0).BackColor = &H4080&
  487.    cmd3(3).BackColor = &H4080&
  488.    cmd4(4).BackColor = &H4080&
  489.    cmd5(5).BackColor = &H4080&
  490.    cmd6(6).BackColor = &H4080&
  491.    cmd7(7).BackColor = &H4080&
  492.    cmd8(8).BackColor = &H4080&
  493.    cmd9(9).BackColor = &H4080&
  494.    End If
  495. End If
  496. End Sub
  497.  
  498. Private Sub cmd3_Click(Index As Integer)
  499. txtPhone.text = txtPhone.text + "3"
  500.    Snd = sndPlaySound("pluck_a.wav", SND_ASYNC)
  501.  
  502. End Sub
  503.  
  504. Private Sub cmd3_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  505. If cmd3(3).BackColor = &H4080& Then
  506. cmd3(3).BackColor = vbGreen
  507.    If cmd3(3).BackColor = vbGreen Then
  508.    cmd1(1).BackColor = &H4080&
  509.    cmd2(2).BackColor = &H4080&
  510.    cmd0(0).BackColor = &H4080&
  511.    cmd4(4).BackColor = &H4080&
  512.    cmd5(5).BackColor = &H4080&
  513.    cmd6(6).BackColor = &H4080&
  514.    cmd7(7).BackColor = &H4080&
  515.    cmd8(8).BackColor = &H4080&
  516.    cmd9(9).BackColor = &H4080&
  517.    End If
  518. End If
  519. End Sub
  520.  
  521. Private Sub cmd4_Click(Index As Integer)
  522. txtPhone.text = txtPhone.text + "4"
  523.    Snd = sndPlaySound("pluck_a.wav", SND_ASYNC)
  524.  
  525. End Sub
  526.  
  527. Private Sub cmd4_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  528. If cmd4(4).BackColor = &H4080& Then
  529. cmd4(4).BackColor = vbGreen
  530.    If cmd4(4).BackColor = vbGreen Then
  531.    cmd1(1).BackColor = &H4080&
  532.    cmd2(2).BackColor = &H4080&
  533.    cmd3(3).BackColor = &H4080&
  534.    cmd0(0).BackColor = &H4080&
  535.    cmd5(5).BackColor = &H4080&
  536.    cmd6(6).BackColor = &H4080&
  537.    cmd7(7).BackColor = &H4080&
  538.    cmd8(8).BackColor = &H4080&
  539.    cmd9(9).BackColor = &H4080&
  540.    End If
  541. End If
  542. End Sub
  543.  
  544. Private Sub cmd5_Click(Index As Integer)
  545. txtPhone.text = txtPhone.text + "5"
  546.    Snd = sndPlaySound("pluck_a.wav", SND_ASYNC)
  547.  
  548. End Sub
  549.  
  550. Private Sub cmd5_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  551. If cmd5(5).BackColor = &H4080& Then
  552. cmd5(5).BackColor = vbGreen
  553.    If cmd5(5).BackColor = vbGreen Then
  554.    cmd1(1).BackColor = &H4080&
  555.    cmd2(2).BackColor = &H4080&
  556.    cmd3(3).BackColor = &H4080&
  557.    cmd4(4).BackColor = &H4080&
  558.    cmd0(0).BackColor = &H4080&
  559.    cmd6(6).BackColor = &H4080&
  560.    cmd7(7).BackColor = &H4080&
  561.    cmd8(8).BackColor = &H4080&
  562.    cmd9(9).BackColor = &H4080&
  563.    End If
  564. End If
  565. End Sub
  566.  
  567. Private Sub cmd6_Click(Index As Integer)
  568. txtPhone.text = txtPhone.text + "6"
  569.    Snd = sndPlaySound("pluck_a.wav", SND_ASYNC)
  570.  
  571. End Sub
  572.  
  573. Private Sub cmd6_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  574. If cmd6(6).BackColor = &H4080& Then
  575. cmd6(6).BackColor = vbGreen
  576.    If cmd6(6).BackColor = vbGreen Then
  577.    cmd1(1).BackColor = &H4080&
  578.    cmd2(2).BackColor = &H4080&
  579.    cmd3(3).BackColor = &H4080&
  580.    cmd4(4).BackColor = &H4080&
  581.    cmd5(5).BackColor = &H4080&
  582.    cmd0(0).BackColor = &H4080&
  583.    cmd7(7).BackColor = &H4080&
  584.    cmd8(8).BackColor = &H4080&
  585.    cmd9(9).BackColor = &H4080&
  586.    End If
  587. End If
  588. End Sub
  589.  
  590. Private Sub cmd7_Click(Index As Integer)
  591. txtPhone.text = txtPhone.text + "7"
  592.    Snd = sndPlaySound("pluck_a.wav", SND_ASYNC)
  593. End Sub
  594.  
  595. Private Sub cmd7_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  596. If cmd7(7).BackColor = &H4080& Then
  597. cmd7(7).BackColor = vbGreen
  598.    If cmd7(7).BackColor = vbGreen Then
  599.    cmd1(1).BackColor = &H4080&
  600.    cmd2(2).BackColor = &H4080&
  601.    cmd3(3).BackColor = &H4080&
  602.    cmd4(4).BackColor = &H4080&
  603.    cmd5(5).BackColor = &H4080&
  604.    cmd6(6).BackColor = &H4080&
  605.    cmd0(0).BackColor = &H4080&
  606.    cmd8(8).BackColor = &H4080&
  607.    cmd9(9).BackColor = &H4080&
  608.    End If
  609. End If
  610. End Sub
  611.  
  612. Private Sub cmd8_Click(Index As Integer)
  613. txtPhone.text = txtPhone.text + "8"
  614.    Snd = sndPlaySound("pluck_a.wav", SND_ASYNC)
  615.  
  616. End Sub
  617.  
  618. Private Sub cmd8_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  619. If cmd8(8).BackColor = &H4080& Then
  620. cmd8(8).BackColor = vbGreen
  621.    If cmd8(8).BackColor = vbGreen Then
  622.    cmd1(1).BackColor = &H4080&
  623.    cmd2(2).BackColor = &H4080&
  624.    cmd3(3).BackColor = &H4080&
  625.    cmd4(4).BackColor = &H4080&
  626.    cmd5(5).BackColor = &H4080&
  627.    cmd6(6).BackColor = &H4080&
  628.    cmd7(7).BackColor = &H4080&
  629.    cmd0(0).BackColor = &H4080&
  630.    cmd9(9).BackColor = &H4080&
  631.    End If
  632. End If
  633. End Sub
  634.  
  635. Private Sub cmd9_Click(Index As Integer)
  636. txtPhone.text = txtPhone.text + "9"
  637.    Snd = sndPlaySound("pluck_a.wav", SND_ASYNC)
  638.  
  639. End Sub
  640.  
  641. Private Sub cmd9_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  642. If cmd9(9).BackColor = &H4080& Then
  643. cmd9(9).BackColor = vbGreen
  644.    If cmd9(9).BackColor = vbGreen Then
  645.    cmd1(1).BackColor = &H4080&
  646.    cmd2(2).BackColor = &H4080&
  647.    cmd3(3).BackColor = &H4080&
  648.    cmd4(4).BackColor = &H4080&
  649.    cmd5(5).BackColor = &H4080&
  650.    cmd6(6).BackColor = &H4080&
  651.    cmd7(7).BackColor = &H4080&
  652.    cmd8(8).BackColor = &H4080&
  653.    cmd0(0).BackColor = &H4080&
  654.    End If
  655. End If
  656. End Sub
  657.  
  658.  
  659.  
  660. Private Sub cmdAddress_Click()
  661. 'To make frmCall invisible, when Address Book button is clicked.
  662. 'Also making frmAddressB visible or loading.
  663. If frmAddressB.Visible = False Then
  664. frmAddressB.Visible = True
  665. frmCall.Visible = False
  666. Else
  667. Load frmAddressB
  668. frmAddressB.Show
  669. End If
  670. End Sub
  671.  
  672. Private Sub cmdBack_Click()
  673. FlagBack = True
  674. Unload frmAddressB
  675. Unload Me
  676. End Sub
  677.  
  678. Private Sub cmdConnect_Click()
  679. 'Check so that the user will not enter invalid number.
  680. If Val(txtPhone.text) = 0 Then
  681. MsgBox "Enter Valid Number", vbOKOnly, "Asim Creations"
  682. txtPhone.text = ""
  683. Exit Sub
  684. End If
  685. 'Check so that the user will not enter invalid name.
  686. If Val(txtName.text) <> 0 Then
  687. MsgBox "Enter Valid Name", vbOKOnly, "Asim Creations"
  688. txtName.text = ""
  689. Exit Sub
  690. End If
  691. 'Check so that the name or phone field empty
  692. If txtName.text = "" Or txtPhone.text = "" Then
  693. MsgBox "Name Field Empty Or Phone Field Empty", vbInformation, "Asim Creations"
  694.     Else
  695. 'If the caption of cmdConnect is disconnect ATH command is executed and the If loop
  696. 'terminates.
  697.     If CmdConnect.Caption = "&Disconnect" Then
  698.     CmdConnect.Caption = "Connect"
  699.     StatusBar1.Panels(1).Picture = ImageList1.ListImages(1).Picture
  700.     MSComm1.Output = "ATH" + vbCr
  701.             Do
  702.             dummy = DoEvents()
  703.             If MSComm1.PortOpen = True Then
  704.             fromModem$ = fromModem$ + MSComm1.Input
  705.                 If InStr(fromModem$, "OK") Then           'Checking whether the reply from
  706.                 Exit Do                                                'contains the string OK.
  707.                 End If
  708.             End If
  709.         Loop
  710.         StatusBar1.Panels(1).text = "Disconnected ......."
  711.     MSComm1.PortOpen = False
  712. 'On the otherhand if the caption of cmdConnect button is Connect (Default) then the
  713. 'following procedure will execute.
  714.         Else
  715.         'Checking either what type of setting are used in frmConfigure
  716.         CmdConnect.Caption = "&Disconnect"
  717.         PhoneNo$ = txtPhone.text
  718.         MSComm1.CommPort = CInt(frmConfig.cboCommPort.text)
  719.         If frmConfig.cboParity.text = "None" Then
  720.         MSComm1.Settings = "115200,N,8,1"
  721.         End If
  722.         If frmConfig.cboParity.text = "Odd" Then
  723.         MSComm1.Settings = "115200,O,8,1"
  724.         End If
  725.         If frmConfig.cboParity.text = "Even" Then
  726.         MSComm1.Settings = "115200,E,8,1"
  727.         End If
  728.         If frmConfig.cboParity.text = "Mark" Then
  729.         MSComm1.Settings = "115200,M,8,1"
  730.         End If
  731.         If frmConfig.cboParity.text = "Space" Then
  732.         MSComm1.Settings = "115200,S,8,1"
  733.         End If
  734.         On Error GoTo PortError
  735.         MSComm1.PortOpen = True
  736.         MSComm1.Output = "&C1&D2S7=75" + vbCr
  737.            MSComm1.Output = "AT" + vbCr    'Activating and default setting of
  738.         Do                                                    'modem.
  739.             dummy = DoEvents()
  740.             If MSComm1.PortOpen = True Then
  741.             fromModem$ = fromModem$ + MSComm1.Input
  742.                 If InStr(fromModem$, "OK") Then           'Checking whether the reply from
  743.                 Exit Do                                                'contains the string OK.
  744.                 End If
  745.             End If
  746.         Loop
  747.         MSComm1.OutBufferCount = 0
  748.         MSComm1.InBufferCount = 0
  749.         MSComm1.Output = "AT&F" + vbCr    'Activating and default setting of
  750.         Do                                                    'modem.
  751.             dummy = DoEvents()
  752.             If MSComm1.PortOpen = True Then
  753.             fromModem$ = fromModem$ + MSComm1.Input
  754.                 If InStr(fromModem$, "OK") Then           'Checking whether the reply from
  755.                 Exit Do                                                'contains the string OK.
  756.                 End If
  757.             End If
  758.         Loop
  759.         StatusBar1.Panels(1).text = fromModem$          'Updating of status bar text
  760.         'updating of status bar image
  761.         StatusBar1.Panels(1).Picture = ImageList1.ListImages(1).Picture
  762.         'Activating the modem in To Call mode.
  763.         MSComm1.Output = "AT#CLS=8#VRN=0#VLS=6" + vbCr
  764.         fromModem$ = ""
  765.         Do                                                                'Loop is used to update the string
  766.             dummy = DoEvents()                                  'fromModem which contains the reply
  767.             If MSComm1.PortOpen = True Then             'of modem.
  768.             fromModem$ = fromModem$ + MSComm1.Input
  769.                 If InStr(fromModem$, "OK") Then
  770.                 Exit Do
  771.                 End If
  772.             End If
  773.         Loop
  774.        StatusBar1.Panels(1).text = "OK"                      'Updating of status bar
  775.             If frmConfig.optPulse.Value = True Then
  776.             MSComm1.Output = "ATDP" + PhoneNo$ + vbCr
  777.             Else
  778.                 MSComm1.Output = "ATDT" + PhoneNo$ + vbCr
  779.             End If
  780.        StatusBar1.Panels(1).text = "Dialing =" + PhoneNo$
  781.        'For updating of status bar image ImageList control has used.
  782.        StatusBar1.Panels(1).Picture = ImageList1.ListImages(3).Picture
  783.        fromModem$ = ""
  784.        Do
  785.             dummy = DoEvents()
  786.             If MSComm1.PortOpen = True Then
  787.             fromModem$ = fromModem$ + MSComm1.Input
  788.                 If InStr(fromModem$, "VCON") Then
  789.                 Exit Do
  790.                 End If
  791.             End If
  792.        Loop
  793.       StatusBar1.Panels(1).text = "Pick up HeadSet "
  794.       StatusBar1.Panels(1).Picture = ImageList1.ListImages(2).Picture
  795.       End If
  796. End If
  797. Exit Sub
  798.  
  799. PortError:
  800.    MsgBox "Invalid Port Number: " + vbCr + " Change Configuration setting", vbOKOnly, "Asim Error Detectiver "
  801.       cmdBack_Click
  802. Exit Sub
  803.  
  804. End Sub
  805.  
  806. Private Sub cmdExit_Click()
  807. End
  808. End Sub
  809.  
  810. Private Sub Form_Load()
  811. Load frmAddressB
  812. 'Updating of properties as mentioned by user in frmConfiguration.
  813. frmAddressB.Visible = False
  814. MSComm1.InputLen = 0
  815. MSComm1.RThreshold = CInt(frmConfig.txtRThreshold.text)
  816. MSComm1.SThreshold = CInt(frmConfig.txtSThreshold.text)
  817. MSComm1.InputMode = comInputModeText
  818. MSComm1.Handshaking = Val(frmConfig.cboHandshaking.text)
  819. MSComm1.InBufferCount = 0
  820. MSComm1.OutBufferCount = 0
  821. End Sub
  822.  
  823. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  824. If (cmd0(0).BackColor = vbGreen Or _
  825. cmd1(1).BackColor = vbGreen Or _
  826. cmd2(2).BackColor = vbGreen Or _
  827. cmd3(3).BackColor = vbGreen Or _
  828. cmd4(4).BackColor = vbGreen) Or _
  829. (cmd5(5).BackColor = vbGreen Or _
  830. cmd6(6).BackColor = vbGreen Or _
  831. cmd7(7).BackColor = vbGreen Or _
  832. cmd8(8).BackColor = vbGreen Or _
  833. cmd9(9).BackColor = vbGreen) Then
  834. cmd0(0).BackColor = &H4080&
  835. cmd1(1).BackColor = &H4080&
  836. cmd2(2).BackColor = &H4080&
  837. cmd3(3).BackColor = &H4080&
  838. cmd4(4).BackColor = &H4080&
  839. cmd5(5).BackColor = &H4080&
  840. cmd6(6).BackColor = &H4080&
  841. cmd7(7).BackColor = &H4080&
  842. cmd8(8).BackColor = &H4080&
  843. cmd9(9).BackColor = &H4080&
  844. End If
  845. End Sub
  846.  
  847. Private Sub mnuCom_Click()
  848.  
  849. End Sub
  850.  
  851. Private Sub mnuConfig_Click()
  852.  
  853. End Sub
  854.  
  855. Private Sub Form_Unload(Cancel As Integer)
  856. If FlagBack = True Then
  857. Load frmMain
  858. frmMain.Show
  859. FlagBack = False
  860. ElseIf frmCall.MSComm1.PortOpen = True Then
  861.   With frmCall
  862.         .MSComm1.Output = "ATH" + vbCr
  863.         .MSComm1.PortOpen = False
  864. End With
  865. Load frmMain
  866. frmMain.Show
  867. Else
  868. End
  869. End If
  870. End Sub
  871.  
  872. Private Sub MSComm1_OnComm()
  873. ' Common error are trapped in this procedure.
  874. If MSComm1.CommEvent = comEventBreak Then
  875. MsgBox "A Break signal was received", vbCritical, "Asim Creations"
  876.     'When frmterminal is visible then its status bar is updated.
  877.     If frmTerminal.Visible = True Then
  878.     frmTerminal.StatusBar1.SimpleText = "A Break signal was received"
  879.     End If
  880. End If
  881. If MSComm1.CommEvent = comEventCTSTO Then
  882. MsgBox "Clear  To Send Timeout", vbExclamation, "Asim Creations"
  883.     If frmTerminal.Visible = True Then
  884.     frmTerminal.StatusBar1.SimpleText = "Clear  To Send Timeout"
  885.     End If
  886. End If
  887. If MSComm1.CommEvent = comEventDSRTO Then
  888. MsgBox "Data Set Ready Timeout", vbExclamation, "Asim Creations"
  889.     If frmTerminal.Visible = True Then
  890.     frmTerminal.StatusBar1.SimpleText = "Data Set Ready Timeout"
  891.     End If
  892. End If
  893. If MSComm1.CommEvent = comEventFrame Then
  894. MsgBox "Framing Error", vbCritical, "Asim Creations"
  895.     If frmTerminal.Visible = True Then
  896.     frmTerminal.StatusBar1.SimpleText = "Framing Error"
  897.     End If
  898. End If
  899. If MSComm1.CommEvent = comEventOverrun Then
  900. MsgBox "Port Overrun :" + vbCr + "Use Handshaking in Config", vbCritical, "Asim Creations"
  901.     If frmTerminal.Visible = True Then
  902.     frmTerminal.StatusBar1.SimpleText = "Port Overrun"
  903.     End If
  904. End If
  905. 'This error is generated when the connection to remote party drops.
  906. If MSComm1.CommEvent = comEventCDTO Then
  907. MsgBox "Carrier Detect Timeout", vbCritical, "Asim Creations"
  908.     'if frmterminal is visible then Status bar text is updated
  909.     If frmTerminal.Visible = True Then
  910.     frmTerminal.StatusBar1.SimpleText = "Carrier Detect Timeout"
  911.     End If
  912. End If
  913. If MSComm1.CommEvent = comEventDCB Then
  914. MsgBox "Unexpected error retrieving Device Control Block for the port", vbCritical, "Asim Creations"
  915. End If
  916. '****************************************************************************************
  917. 'The following if loop is used when using Terminal. The following statement displays whatever
  918. 'in the receive or input buffer in txtTerminal.
  919. If frmTerminal.Visible = True And MSComm1.PortOpen = True Then
  920.  frmTerminal.txtTerminal.SelText = MSComm1.Input
  921. End If
  922. '*****************************************************************************************
  923. End Sub
  924.  
  925.