home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / sendun1a / frmdata.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-10-22  |  40.5 KB  |  1,142 lines

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
  4. Begin VB.Form frmData 
  5.    BackColor       =   &H00C0C0C0&
  6.    Caption         =   "Dev Mailer"
  7.    ClientHeight    =   5895
  8.    ClientLeft      =   60
  9.    ClientTop       =   345
  10.    ClientWidth     =   10275
  11.    FillColor       =   &H00C0C0C0&
  12.    ForeColor       =   &H00C0C0C0&
  13.    Icon            =   "frmData.frx":0000
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    MouseIcon       =   "frmData.frx":27A2
  17.    ScaleHeight     =   5895
  18.    ScaleWidth      =   10275
  19.    StartUpPosition =   2  'CenterScreen
  20.    Begin VB.PictureBox picLogo 
  21.       AutoRedraw      =   -1  'True
  22.       BackColor       =   &H00000000&
  23.       BorderStyle     =   0  'None
  24.       BeginProperty Font 
  25.          Name            =   "Arial"
  26.          Size            =   9.75
  27.          Charset         =   0
  28.          Weight          =   700
  29.          Underline       =   0   'False
  30.          Italic          =   0   'False
  31.          Strikethrough   =   0   'False
  32.       EndProperty
  33.       ForeColor       =   &H80000005&
  34.       Height          =   9375
  35.       Left            =   0
  36.       ScaleHeight     =   9375
  37.       ScaleWidth      =   255
  38.       TabIndex        =   30
  39.       TabStop         =   0   'False
  40.       Top             =   0
  41.       Width           =   255
  42.    End
  43.    Begin TabDlg.SSTab ssData 
  44.       Height          =   5850
  45.       Left            =   255
  46.       TabIndex        =   31
  47.       Top             =   30
  48.       Width           =   9960
  49.       _ExtentX        =   17568
  50.       _ExtentY        =   10319
  51.       _Version        =   327681
  52.       Style           =   1
  53.       Tabs            =   2
  54.       TabsPerRow      =   2
  55.       TabHeight       =   520
  56.       BackColor       =   12632256
  57.       TabCaption(0)   =   "&Redacci
  58.       TabPicture(0)   =   "frmData.frx":2AAC
  59.       Tab(0).ControlEnabled=   -1  'True
  60.       Tab(0).Control(0)=   "Label5"
  61.       Tab(0).Control(0).Enabled=   0   'False
  62.       Tab(0).Control(1)=   "Label2"
  63.       Tab(0).Control(1).Enabled=   0   'False
  64.       Tab(0).Control(2)=   "Label4"
  65.       Tab(0).Control(2).Enabled=   0   'False
  66.       Tab(0).Control(3)=   "Label1"
  67.       Tab(0).Control(3).Enabled=   0   'False
  68.       Tab(0).Control(4)=   "Process"
  69.       Tab(0).Control(4).Enabled=   0   'False
  70.       Tab(0).Control(5)=   "pix"
  71.       Tab(0).Control(5).Enabled=   0   'False
  72.       Tab(0).Control(6)=   "cmdAddAttach"
  73.       Tab(0).Control(6).Enabled=   0   'False
  74.       Tab(0).Control(7)=   "cmdDelAttach"
  75.       Tab(0).Control(7).Enabled=   0   'False
  76.       Tab(0).Control(8)=   "DataArrival"
  77.       Tab(0).Control(8).Enabled=   0   'False
  78.       Tab(0).Control(9)=   "Command4"
  79.       Tab(0).Control(9).Enabled=   0   'False
  80.       Tab(0).Control(10)=   "Command3"
  81.       Tab(0).Control(10).Enabled=   0   'False
  82.       Tab(0).Control(11)=   "tmr"
  83.       Tab(0).Control(11).Enabled=   0   'False
  84.       Tab(0).Control(12)=   "Frame1"
  85.       Tab(0).Control(12).Enabled=   0   'False
  86.       Tab(0).Control(13)=   "btnFecha"
  87.       Tab(0).Control(13).Enabled=   0   'False
  88.       Tab(0).Control(14)=   "Text4"
  89.       Tab(0).Control(14).Enabled=   0   'False
  90.       Tab(0).Control(15)=   "Text2"
  91.       Tab(0).Control(15).Enabled=   0   'False
  92.       Tab(0).Control(16)=   "Command2"
  93.       Tab(0).Control(16).Enabled=   0   'False
  94.       Tab(0).Control(17)=   "Command1"
  95.       Tab(0).Control(17).Enabled=   0   'False
  96.       Tab(0).Control(18)=   "Text1"
  97.       Tab(0).Control(18).Enabled=   0   'False
  98.       Tab(0).Control(19)=   "lstAttachment"
  99.       Tab(0).Control(19).Enabled=   0   'False
  100.       Tab(0).ControlCount=   20
  101.       TabCaption(1)   =   "&Configuraci
  102.       TabPicture(1)   =   "frmData.frx":2AC8
  103.       Tab(1).ControlEnabled=   0   'False
  104.       Tab(1).Control(0)=   "cmdApply"
  105.       Tab(1).Control(0).Enabled=   0   'False
  106.       Tab(1).Control(1)=   "Frame2"
  107.       Tab(1).Control(1).Enabled=   0   'False
  108.       Tab(1).Control(2)=   "Frame3"
  109.       Tab(1).Control(2).Enabled=   0   'False
  110.       Tab(1).Control(3)=   "cmdDelReg"
  111.       Tab(1).Control(3).Enabled=   0   'False
  112.       Tab(1).Control(4)=   "Command5"
  113.       Tab(1).Control(4).Enabled=   0   'False
  114.       Tab(1).ControlCount=   5
  115.       Begin VB.CommandButton Command5 
  116.          BackColor       =   &H00808080&
  117.          Caption         =   "&Salir"
  118.          Height          =   375
  119.          Left            =   -73140
  120.          TabIndex        =   29
  121.          Top             =   5310
  122.          Width           =   1215
  123.       End
  124.       Begin VB.CommandButton cmdDelReg 
  125.          Appearance      =   0  'Flat
  126.          Height          =   345
  127.          Left            =   -73590
  128.          Picture         =   "frmData.frx":2AE4
  129.          Style           =   1  'Graphical
  130.          TabIndex        =   28
  131.          ToolTipText     =   "Cancelar Operaci
  132.          Top             =   5340
  133.          Width           =   345
  134.       End
  135.       Begin VB.Frame Frame3 
  136.          Caption         =   "Informaci
  137. n del usuario"
  138.          Height          =   795
  139.          Left            =   -74910
  140.          TabIndex        =   26
  141.          Top             =   1650
  142.          Width           =   5205
  143.          Begin VB.TextBox txtMailSend 
  144.             Height          =   315
  145.             IMEMode         =   3  'DISABLE
  146.             Left            =   2040
  147.             TabIndex        =   32
  148.             Top             =   300
  149.             Width           =   2625
  150.          End
  151.          Begin VB.Label Label10 
  152.             AutoSize        =   -1  'True
  153.             Caption         =   "&Direcci
  154. n de Correo:"
  155.             Height          =   195
  156.             Left            =   210
  157.             TabIndex        =   33
  158.             Top             =   360
  159.             Width           =   1455
  160.          End
  161.       End
  162.       Begin VB.Frame Frame2 
  163.          Caption         =   "Informaci
  164. n del Servidor"
  165.          Height          =   1125
  166.          Left            =   -74910
  167.          TabIndex        =   21
  168.          Top             =   450
  169.          Width           =   5205
  170.          Begin VB.TextBox txtSMTP 
  171.             Height          =   315
  172.             IMEMode         =   3  'DISABLE
  173.             Left            =   1980
  174.             MaxLength       =   20
  175.             TabIndex        =   23
  176.             Top             =   270
  177.             Width           =   3015
  178.          End
  179.          Begin VB.TextBox txtSMTPport 
  180.             Height          =   315
  181.             IMEMode         =   3  'DISABLE
  182.             Left            =   1980
  183.             MaxLength       =   20
  184.             TabIndex        =   25
  185.             Text            =   "25"
  186.             Top             =   660
  187.             Width           =   1125
  188.          End
  189.          Begin VB.Label Label7 
  190.             AutoSize        =   -1  'True
  191.             Caption         =   "&Puerto de Salida:"
  192.             Height          =   195
  193.             Left            =   150
  194.             TabIndex        =   24
  195.             Top             =   720
  196.             Width           =   1215
  197.          End
  198.          Begin VB.Label Label3 
  199.             AutoSize        =   -1  'True
  200.             Caption         =   "Correo saliente (SMTP):"
  201.             Height          =   195
  202.             Left            =   120
  203.             TabIndex        =   22
  204.             Top             =   330
  205.             Width           =   1680
  206.          End
  207.       End
  208.       Begin VB.CommandButton cmdApply 
  209.          BackColor       =   &H00808080&
  210.          Caption         =   "&Aplicar"
  211.          Height          =   375
  212.          Left            =   -74880
  213.          TabIndex        =   27
  214.          Top             =   5310
  215.          Width           =   1215
  216.       End
  217.       Begin ComctlLib.ListView lstAttachment 
  218.          Height          =   2235
  219.          Left            =   4710
  220.          TabIndex        =   12
  221.          Top             =   1470
  222.          Width           =   5175
  223.          _ExtentX        =   9128
  224.          _ExtentY        =   3942
  225.          View            =   3
  226.          LabelEdit       =   1
  227.          Sorted          =   -1  'True
  228.          MultiSelect     =   -1  'True
  229.          LabelWrap       =   -1  'True
  230.          HideSelection   =   -1  'True
  231.          _Version        =   327682
  232.          ForeColor       =   -2147483640
  233.          BackColor       =   -2147483643
  234.          BorderStyle     =   1
  235.          Appearance      =   1
  236.          NumItems        =   2
  237.          BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  238.             Key             =   ""
  239.             Object.Tag             =   ""
  240.             Text            =   "Archivo"
  241.             Object.Width           =   4410
  242.          EndProperty
  243.          BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  244.             SubItemIndex    =   1
  245.             Key             =   ""
  246.             Object.Tag             =   ""
  247.             Text            =   "Ubicaci
  248.             Object.Width           =   4410
  249.          EndProperty
  250.       End
  251.       Begin VB.TextBox Text1 
  252.          Height          =   315
  253.          Left            =   4710
  254.          MaxLength       =   100
  255.          TabIndex        =   6
  256.          Top             =   1050
  257.          Width           =   1185
  258.       End
  259.       Begin VB.CommandButton Command1 
  260.          BackColor       =   &H00808080&
  261.          Caption         =   "&Enviar "
  262.          Height          =   375
  263.          Left            =   4710
  264.          TabIndex        =   17
  265.          Top             =   5370
  266.          Width           =   1215
  267.       End
  268.       Begin VB.CommandButton Command2 
  269.          BackColor       =   &H00808080&
  270.          Caption         =   "&Salir"
  271.          Height          =   375
  272.          Left            =   8670
  273.          TabIndex        =   20
  274.          Top             =   5370
  275.          Width           =   1215
  276.       End
  277.       Begin VB.TextBox Text2 
  278.          Height          =   315
  279.          Left            =   6090
  280.          MaxLength       =   100
  281.          TabIndex        =   8
  282.          Top             =   1050
  283.          Width           =   1185
  284.       End
  285.       Begin VB.TextBox Text4 
  286.          Height          =   315
  287.          Left            =   7470
  288.          Locked          =   -1  'True
  289.          TabIndex        =   10
  290.          Top             =   1050
  291.          Width           =   1275
  292.       End
  293.       Begin VB.CommandButton btnFecha 
  294.          Appearance      =   0  'Flat
  295.          Height          =   315
  296.          Left            =   8790
  297.          Picture         =   "frmData.frx":2C2E
  298.          Style           =   1  'Graphical
  299.          TabIndex        =   11
  300.          ToolTipText     =   "Seleccionar Fecha"
  301.          Top             =   1050
  302.          Width           =   345
  303.       End
  304.       Begin VB.Frame Frame1 
  305.          BackColor       =   &H00C0C0C0&
  306.          Caption         =   "Informaci
  307.          ForeColor       =   &H00000000&
  308.          Height          =   4965
  309.          Left            =   60
  310.          TabIndex        =   0
  311.          Top             =   360
  312.          Width           =   4455
  313.          Begin VB.PictureBox Picture1 
  314.             Appearance      =   0  'Flat
  315.             AutoRedraw      =   -1  'True
  316.             AutoSize        =   -1  'True
  317.             BackColor       =   &H80000005&
  318.             BorderStyle     =   0  'None
  319.             FillStyle       =   0  'Solid
  320.             ForeColor       =   &H80000008&
  321.             Height          =   1110
  322.             Index           =   0
  323.             Left            =   1590
  324.             Picture         =   "frmData.frx":2DB8
  325.             ScaleHeight     =   1110
  326.             ScaleWidth      =   1140
  327.             TabIndex        =   3
  328.             ToolTipText     =   "Grifo (
  329. Belfegor)"
  330.             Top             =   1200
  331.             Width           =   1140
  332.          End
  333.          Begin VB.Label lblMailto 
  334.             Alignment       =   2  'Center
  335.             AutoSize        =   -1  'True
  336.             BackColor       =   &H00000000&
  337.             BackStyle       =   0  'Transparent
  338.             Caption         =   "support@yourmail.com"
  339.             BeginProperty Font 
  340.                Name            =   "MS Sans Serif"
  341.                Size            =   8.25
  342.                Charset         =   0
  343.                Weight          =   400
  344.                Underline       =   -1  'True
  345.                Italic          =   0   'False
  346.                Strikethrough   =   0   'False
  347.             EndProperty
  348.             ForeColor       =   &H00000000&
  349.             Height          =   195
  350.             Left            =   1365
  351.             TabIndex        =   2
  352.             Top             =   870
  353.             Width           =   1635
  354.          End
  355.          Begin VB.Label Label6 
  356.             Alignment       =   2  'Center
  357.             AutoSize        =   -1  'True
  358.             BackColor       =   &H00C0C0C0&
  359.             Caption         =   $"frmData.frx":3606
  360.             ForeColor       =   &H00000000&
  361.             Height          =   585
  362.             Left            =   240
  363.             TabIndex        =   1
  364.             Top             =   210
  365.             Width           =   4065
  366.             WordWrap        =   -1  'True
  367.          End
  368.       End
  369.       Begin VB.Timer tmr 
  370.          Interval        =   100
  371.          Left            =   6900
  372.          Top             =   5400
  373.       End
  374.       Begin VB.CommandButton Command3 
  375.          Appearance      =   0  'Flat
  376.          Height          =   345
  377.          Left            =   5970
  378.          Picture         =   "frmData.frx":36A0
  379.          Style           =   1  'Graphical
  380.          TabIndex        =   18
  381.          ToolTipText     =   "Copiar clave al portapapeles"
  382.          Top             =   5400
  383.          Width           =   345
  384.       End
  385.       Begin VB.CommandButton Command4 
  386.          Appearance      =   0  'Flat
  387.          Height          =   345
  388.          Left            =   6360
  389.          Picture         =   "frmData.frx":37EA
  390.          Style           =   1  'Graphical
  391.          TabIndex        =   19
  392.          ToolTipText     =   "Cancelar Operaci
  393.          Top             =   5400
  394.          Width           =   345
  395.       End
  396.       Begin VB.TextBox DataArrival 
  397.          BackColor       =   &H00C0C0C0&
  398.          ForeColor       =   &H00000000&
  399.          Height          =   765
  400.          Left            =   4710
  401.          Locked          =   -1  'True
  402.          MaxLength       =   1000
  403.          MultiLine       =   -1  'True
  404.          ScrollBars      =   2  'Vertical
  405.          TabIndex        =   15
  406.          TabStop         =   0   'False
  407.          Top             =   4260
  408.          Width           =   5175
  409.       End
  410.       Begin VB.CommandButton cmdDelAttach 
  411.          BackColor       =   &H00808080&
  412.          Caption         =   "&Eliminar Archivo"
  413.          Height          =   375
  414.          Left            =   8280
  415.          TabIndex        =   14
  416.          Top             =   3810
  417.          Width           =   1575
  418.       End
  419.       Begin VB.CommandButton cmdAddAttach 
  420.          BackColor       =   &H00808080&
  421.          Caption         =   "&Ingresar Archivo"
  422.          Height          =   375
  423.          Left            =   4710
  424.          TabIndex        =   13
  425.          Top             =   3810
  426.          Width           =   1485
  427.       End
  428.       Begin VB.PictureBox pix 
  429.          AutoRedraw      =   -1  'True
  430.          BackColor       =   &H00FFFFFF&
  431.          Height          =   315
  432.          Left            =   4710
  433.          ScaleHeight     =   255
  434.          ScaleWidth      =   5115
  435.          TabIndex        =   34
  436.          TabStop         =   0   'False
  437.          Top             =   5010
  438.          Visible         =   0   'False
  439.          Width           =   5175
  440.       End
  441.       Begin VB.Label Process 
  442.          BackColor       =   &H00C0C0C0&
  443.          BorderStyle     =   1  'Fixed Single
  444.          Height          =   255
  445.          Left            =   4710
  446.          TabIndex        =   16
  447.          Top             =   5070
  448.          Width           =   5175
  449.       End
  450.       Begin VB.Label Label1 
  451.          AutoSize        =   -1  'True
  452.          BackColor       =   &H00C0C0C0&
  453.          Caption         =   "Ingrese su Informaci
  454.          ForeColor       =   &H00000000&
  455.          Height          =   195
  456.          Left            =   4710
  457.          TabIndex        =   4
  458.          Top             =   450
  459.          Width           =   1650
  460.       End
  461.       Begin VB.Label Label4 
  462.          AutoSize        =   -1  'True
  463.          BackColor       =   &H00C0C0C0&
  464.          Caption         =   "Cliente:"
  465.          ForeColor       =   &H00000000&
  466.          Height          =   195
  467.          Left            =   4710
  468.          TabIndex        =   5
  469.          Top             =   780
  470.          Width           =   525
  471.       End
  472.       Begin VB.Label Label2 
  473.          AutoSize        =   -1  'True
  474.          BackColor       =   &H00C0C0C0&
  475.          Caption         =   "OC:"
  476.          ForeColor       =   &H00000000&
  477.          Height          =   195
  478.          Left            =   6090
  479.          TabIndex        =   7
  480.          Top             =   780
  481.          Width           =   270
  482.       End
  483.       Begin VB.Label Label5 
  484.          AutoSize        =   -1  'True
  485.          BackColor       =   &H00C0C0C0&
  486.          Caption         =   "Fecha Necesidad:"
  487.          ForeColor       =   &H00000000&
  488.          Height          =   195
  489.          Left            =   7470
  490.          TabIndex        =   9
  491.          Top             =   780
  492.          Width           =   1305
  493.       End
  494.    End
  495. Attribute VB_Name = "frmData"
  496. Attribute VB_GlobalNameSpace = False
  497. Attribute VB_Creatable = False
  498. Attribute VB_PredeclaredId = True
  499. Attribute VB_Exposed = False
  500. Option Explicit
  501. 'para env
  502. o de e-mail
  503. Dim CRLF        As String
  504. Dim CRLF_CRLF   As String
  505. Dim outBuffer   As String
  506. Dim stKEYDATA   As String
  507. Dim MAIL_DATA   As MIME_DATA
  508. Dim IsConfig    As Boolean
  509. Dim bTrans As Boolean
  510. Dim m_iStage As Integer
  511. Dim Sock As Integer
  512. Dim RC As Integer
  513. Dim Bytes As Integer
  514. Dim ResponseCode As Integer
  515. 'cursor animado
  516. Private hAniCursor As Long
  517. Private hBaseCursor As Long
  518. Private hResult As Long
  519. 'set de animaci
  520. Dim iPic As Byte
  521. Dim curSelect As StdPicture
  522. 'logo
  523. Dim cL As New cLogo
  524. Private Sub btnFecha_Click()
  525.     SysCal.Show vbModal
  526.     Set SysCal = Nothing
  527.     Text4.Text = stFecha
  528. End Sub
  529. Public Function LongDateA(ByVal stdata2 As String) As String
  530.     LongDateA = Right$(stdata2, 4) & Mid$(stdata2, 4, 2) & left$(stdata2, 2)
  531. End Function
  532. Private Sub cmdAddAttach_Click()
  533.     Dim sOpen       As SelectedFile
  534.     Dim Count       As Integer
  535.     Dim FileList    As String
  536.     Dim i           As Integer
  537.     Dim InList      As Boolean
  538.     On Error GoTo e_Trap
  539.     FileDialog.sFilter = "Excel (*.xls)" & Chr$(0) & "*.xls" & Chr$(0) & "All Files (*.*)" & Chr$(0) & "*.*"
  540.     FileDialog.flags = OFN_EXPLORER _
  541.                         Or OFN_LONGNAMES _
  542.                             Or OFN_CREATEPROMPT _
  543.                                 Or OFN_NODEREFERENCELINKS Or _
  544.                                     OFN_HIDEREADONLY Or _
  545.                                         OFN_ALLOWMULTISELECT
  546.     FileDialog.sDlgTitle = "Ingresar Attachment(s)"
  547.     FileDialog.sInitDir = App.Path
  548.     sOpen = ShowOpen(Me.hWnd)
  549.     If Err.number <> 32755 And sOpen.bCanceled = False Then
  550.         Dim itmX As ListItem
  551.         
  552.         For Count = 1 To sOpen.nFilesSelected
  553.             If lstAttachment.ListItems.Count = 0 Then
  554.                     Set itmX = lstAttachment.ListItems.Add(, , sOpen.sFiles(Count))
  555.                     itmX.Key = sOpen.sFiles(Count)
  556.                     itmX.SubItems(1) = sOpen.sLastDirectory
  557.                     
  558.                     Set itmX = Nothing
  559.             Else
  560.                 InList = False
  561.                 
  562.                 For i = 1 To lstAttachment.ListItems.Count
  563.                     If sOpen.sFiles(Count) = lstAttachment.ListItems.Item(i).Key Then
  564.                         InList = True
  565.                     End If
  566.                 Next i
  567.                 
  568.                 If Not InList = True Then
  569.                     Set itmX = lstAttachment.ListItems.Add(, , sOpen.sFiles(Count))
  570.                     itmX.Key = sOpen.sFiles(Count)
  571.                     itmX.SubItems(1) = sOpen.sLastDirectory
  572.                     
  573.                     Set itmX = Nothing
  574.                 End If
  575.             End If
  576.         Next Count
  577.         
  578.         FileDialog.sFile = ""
  579.     End If
  580.     Exit Sub
  581. e_Trap:
  582.     Exit Sub
  583.     Resume
  584. End Sub
  585. Private Sub cmdApply_Click()
  586.     If Len(Trim$(txtSMTP.Text)) = 0 Then
  587.         MsgBox "Ingrese el nombre del servidor de correo saliente", vbExclamation, Me.Caption
  588.         Exit Sub
  589.     End If
  590.     If Len(Trim$(txtSMTPport.Text)) = 0 Then
  591.         MsgBox "Ingrese el nombre puerto", vbExclamation, Me.Caption
  592.         Exit Sub
  593.     Else
  594.         If Not IsNumeric(txtSMTPport.Text) Then
  595.             MsgBox "El puerto debe ser num
  596. rico", vbExclamation, Me.Caption
  597.             Exit Sub
  598.         Else
  599.             If Val(txtSMTPport.Text) > 65535 Or Val(txtSMTPport.Text) < 0 Then
  600.                 MsgBox "El valor del puerto debe estra comprendido entre 1 y 65535 (default: 25)", vbExclamation, Me.Caption
  601.                 Exit Sub
  602.             End If
  603.         End If
  604.     End If
  605.     If Len(Trim$(txtMailSend.Text)) = 0 Then
  606.         MsgBox "Ingrese su direcci
  607. n de correo saliente", vbExclamation, Me.Caption
  608.         Exit Sub
  609.     End If
  610.     SaveData
  611.     ChargeData
  612. End Sub
  613. Private Sub cmdDelAttach_Click()
  614.     Dim i As Integer
  615.     For i = lstAttachment.ListItems.Count To 1 Step -1
  616.         If lstAttachment.ListItems.Item(i).Selected Then
  617.             lstAttachment.ListItems.Remove (i)
  618.         End If
  619.     Next i
  620. End Sub
  621. Private Sub SaveData()
  622.     SaveSetting App.EXEName, "mail", "status", "1"
  623.     SaveSetting App.EXEName, "mail", "server", txtSMTP.Text
  624.     SaveSetting App.EXEName, "mail", "port", txtSMTPport.Text
  625.     SaveSetting App.EXEName, "mail", "mail", txtMailSend.Text
  626. End Sub
  627. Private Sub ChargeData()
  628.     MAIL_DATA.SMTP_PORT = CLng(GetSetting(App.EXEName, "mail", "port", "25"))
  629.     txtSMTPport.Text = MAIL_DATA.SMTP_PORT
  630.     MAIL_DATA.SMTP_SERVER = GetSetting(App.EXEName, "mail", "server", "")
  631.     txtSMTP.Text = MAIL_DATA.SMTP_SERVER
  632.     MAIL_DATA.SMTP_MAILTO = GetSetting(App.EXEName, "config", "mailto", "")
  633.     MAIL_DATA.SMTP_MAIL = GetSetting(App.EXEName, "mail", "mail", "")
  634.     txtMailSend.Text = MAIL_DATA.SMTP_MAIL
  635.     IsConfig = True
  636. End Sub
  637. Private Sub cmdDelReg_Click()
  638.     DelData
  639.     txtSMTP.Text = ""
  640.     txtSMTPport.Text = "25"
  641.     txtMailSend.Text = ""
  642.         
  643. End Sub
  644. Private Sub Command1_Click()
  645.     Key = GetSetting(App.EXEName, "config", "des-56", "labchile")
  646.     If Len(Trim$(Text1.Text)) = 0 Then
  647.         MsgBox "Debe ingresar el c
  648. digo de cliente", vbExclamation, Me.Caption
  649.         Exit Sub
  650.     End If
  651.     If Len(Trim$(Text2.Text)) = 0 Then
  652.         MsgBox "Debe ingresar la orden de compra", vbExclamation, Me.Caption
  653.         Exit Sub
  654.     End If
  655.     stKEYDATA = "OC: " & Text1.Text & " " & Text2.Text & " " & LongDateA(Text4.Text) & " LABORATORIO CHILE S.A."
  656.     stKEYDATA = Encrypt(stKEYDATA)
  657.     stKEYDATA = B64(DES(stKEYDATA))
  658.     Call Initialize_WS_SOCK
  659. End Sub
  660. Private Sub Initialize_WS_SOCK()
  661.     Screen.MousePointer = vbHourglass
  662.     Dim StartupData As WSADataType
  663.     Dim SocketBuffer As sockaddr
  664.     Dim IpAddr As Long
  665.     'Inicializa Winsock
  666.     RC = WSAStartup(&H101, StartupData)
  667.     RC = WSAStartup(&H101, StartupData)
  668.     'Abrir un socket libre
  669.     'Se pueden abrir varias conexiones simult
  670.     Sock = socket(AF_INET, SOCK_STREAM, 0)
  671.     If Sock = SOCKET_ERROR Then
  672.         Process.Caption = "No se puede crear el socket, reint
  673. ntelo m
  674. s tarde."
  675.         Screen.MousePointer = vbDefault
  676.         Exit Sub
  677.     End If
  678.     'Ver si existe en HOST
  679.     If RC = SOCKET_ERROR Then Exit Sub
  680.         IpAddr = GetHostByNameAlias(MAIL_DATA.SMTP_SERVER)
  681.         If IpAddr = -1 Then
  682.         Process.Caption = "Host desconocido: " & MAIL_DATA.SMTP_SERVER
  683.         Screen.MousePointer = vbDefault
  684.         Exit Sub
  685.     End If
  686.     'esto es responsable de la conexi
  687.     SocketBuffer.sin_family = AF_INET
  688.     SocketBuffer.sin_port = htons(MAIL_DATA.SMTP_PORT)
  689.     SocketBuffer.sin_addr = IpAddr
  690.     SocketBuffer.sin_zero = String$(8, 0)
  691.     RC = connect(Sock, SocketBuffer, Len(SocketBuffer))
  692.     'Si un error ocurre, se cierra la conexi
  693.     'mandar mensaje a la ventana
  694.     If RC = SOCKET_ERROR Then
  695.         Process.Caption = "No se puede conectar a: " & MAIL_DATA.SMTP_SERVER & CRLF & _
  696.                             GetWSAErrorString(WSAGetLastError())
  697.         closesocket Sock
  698.         RC = WSACleanup()
  699.         Screen.MousePointer = vbDefault
  700.         Exit Sub
  701.     Else
  702.         Process.Caption = "Conectado a: " & MAIL_DATA.SMTP_SERVER
  703.     End If
  704.     bTrans = True
  705.     m_iStage = 0
  706.     DataArrival = ""
  707.     ResponseCode = 220
  708.     Arrival
  709.     Screen.MousePointer = vbDefault
  710. End Sub
  711. Private Sub Arrival()
  712.     Dim Start As Long
  713.     Dim tmr As Long
  714.     Dim MsgBuffer As String * 2048
  715.     If bTrans = True Then
  716.         On Error Resume Next
  717.         Start = timeGetTime
  718.         
  719.         Do
  720.              Bytes = recv(Sock, ByVal MsgBuffer, 2048, 0)
  721.              DoEvents
  722.              tmr = timeGetTime - Start
  723.         Loop Until Bytes > 0 Or tmr > 50000
  724.                 
  725.         If Bytes > 0 Then
  726.             DataArrival = DataArrival + _
  727.                             MsgBuffer + _
  728.                                 Chr$(13) + Chr$(10)
  729.                     
  730.             DataArrival.SelStart = Len(DataArrival)
  731.                      
  732.             If ResponseCode = left(MsgBuffer, 3) Then
  733.                 MsgBuffer = vbNullString
  734.                 m_iStage = m_iStage + 1
  735.                 Transmit m_iStage
  736.                 Bytes = 0
  737.                 Arrival
  738.             Else
  739.         
  740.                 closesocket (Sock)
  741.                 RC = WSACleanup()
  742.                 Sock = 0
  743.                 Process.Caption = "El servidor respondi
  744.  con un c
  745. digo no esperado!"
  746.                 bTrans = False
  747.                 Exit Sub
  748.             End If
  749.         ElseIf WSAGetLastError() <> WSAEWOULDBLOCK Then
  750.             closesocket (Sock)
  751.             RC = WSACleanup()
  752.             Sock = 0
  753.             bTrans = False
  754.             Exit Sub
  755.         Else
  756.             Process.Caption = "error de servicio SMTP, tiempo fuera..."
  757.             closesocket Sock
  758.             RC = WSACleanup()
  759.             Screen.MousePointer = vbDefault
  760.             Exit Sub
  761.         End If
  762.     End If
  763. End Sub
  764. 'para mandar MIME
  765. Private Sub SendMimeAttachement()
  766.     Dim l As Long, i As Long, FileIn As Long
  767.     Dim temp    As Variant
  768.     Dim Files   As Integer
  769.     'BASE64 *m
  770. s adelante incorporar una clase
  771.     Dim b As Integer
  772.     Dim Base64Tab As Variant
  773.     Dim bin(3) As Byte
  774.     Dim s As Variant
  775.     'Base64Tab=>tabla de tabulaci
  776.     Base64Tab = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/")
  777.     Process.Visible = False
  778.     'vemos cuantos archivos hay para mandar
  779.     For Files = 1 To lstAttachment.ListItems.Count
  780.         
  781.         Erase bin
  782.         l = 0: i = 0: FileIn = 0: b = 0:
  783.         temp = "": s = ""
  784.         
  785.         FileIn = FreeFile
  786.         'BASE64 necesita binary
  787.         Open lstAttachment.ListItems(Files).SubItems(1) & lstAttachment.ListItems(Files).Text For Binary Access Read As FileIn
  788.         
  789.         'cabecera del mime
  790.         temp = CRLF & CRLF & "----_=_--NextMimePart" + CRLF
  791.         temp = temp + "Content-Type: application/octet-stream;" & CRLF
  792.         temp = temp & vbTab & "name=" + Chr(34) & lstAttachment.ListItems(Files).Text & Chr(34) + CRLF
  793.         temp = temp + "Content-Transfer-Encoding: base64" & CRLF
  794.         temp = temp + "Content-Disposition: attachment;" & CRLF
  795.         temp = temp & vbTab & "filename=" & Chr(34) & lstAttachment.ListItems(Files).Text & Chr(34) & CRLF
  796.         WinsockSendData (temp & CRLF)
  797.         l = LOF(FileIn) - (LOF(FileIn) Mod 3)
  798.         FloodDisplay l, "enviando attachment(s)..."
  799.         
  800.         For i = 1 To l Step 3
  801.             'leer 3 bytes
  802.             Get FileIn, , bin(0)
  803.             Get FileIn, , bin(1)
  804.             Get FileIn, , bin(2)
  805.         
  806.             'esperar ha que hayan m
  807. s de 64 caracteres
  808.             If Len(s) > 64 Then
  809.                 FloodUpdateText i
  810.                 'Process.Caption = "Enviando Attachement..." & i & " bytes de " & l
  811.                 DoEvents
  812.                 s = s & CRLF
  813.                 WinsockSendData (s)
  814.                 s = ""
  815.             End If
  816.         
  817.             'Calcular caracter codificado Base64
  818.         
  819.             b = (bin(0) \ 4) And &H3F '>> * 2 (&H3F=111111b)
  820.             
  821.             's tiene los caracteres codificados
  822.             s = s + Base64Tab(b)
  823.         
  824.             b = ((bin(0) And &H3) * 16) Or ((bin(1) \ 16) And &HF)
  825.             s = s + Base64Tab(b)
  826.             b = ((bin(1) And &HF) * 4) Or ((bin(2) \ 64) And &H3)
  827.             s = s + Base64Tab(b)
  828.             b = bin(2) And &H3F
  829.             s = s + Base64Tab(b)
  830.         Next i
  831.         'ver si hay algo dejado
  832.         If Not (LOF(FileIn) Mod 3 = 0) Then
  833.             'leer bytes dejados
  834.             For i = 1 To (LOF(FileIn) Mod 3)
  835.                 Get FileIn, , bin(i - 1)
  836.             Next i
  837.         
  838.             'si solo quedan 2 $ dejados
  839.             If (LOF(FileIn) Mod 3) = 2 Then
  840.         
  841.                 b = (bin(0) \ 4) And &H3F '>> * 2 (&H3F=111111b)
  842.                 s = s + Base64Tab(b)
  843.                 b = ((bin(0) And &H3) * 16) Or ((bin(1) \ 16) And &HF)
  844.                 s = s + Base64Tab(b)
  845.                 b = ((bin(1) And &HF) * 4) Or ((bin(2) \ 64) And &H3)
  846.                 s = s + Base64Tab(b)
  847.                 s = s + "="
  848.         
  849.             'so s
  850. lo hay uno
  851.             Else
  852.                 b = (bin(0) \ 4) And &H3F '>> * 2 (&H3F=111111b)
  853.                 s = s + Base64Tab(b)
  854.                 b = ((bin(1) And &H3) * 16) Or ((bin(1) \ 16) And &HF)
  855.                 s = s + Base64Tab(b)
  856.                 s = s + "=="
  857.             End If
  858.         End If
  859.         'mandar caracteres dejados
  860.         If s <> "" Then
  861.             s = s & CRLF
  862.             WinsockSendData (s)
  863.         End If
  864.         Close FileIn
  865.         
  866.         FloodHide
  867.     Next Files
  868.     'manda el fin del MIME
  869.     WinsockSendData (vbCrLf & "----_=_--NextMimePart--" & CRLF)
  870.     WinsockSendData (CRLF_CRLF)
  871.     Process.Visible = True
  872. End Sub
  873. Sub SendMimetxt()
  874.     Dim temp    As Variant
  875.     Dim GMTTIME As String
  876.     Dim i       As Integer
  877.     If lstAttachment.ListItems.Count > 0 Then
  878.         temp = temp & "From: " & MAIL_DATA.SMTP_MAIL & CRLF
  879.         temp = temp & "To: " & MAIL_DATA.SMTP_MAILTO & CRLF
  880.         temp = temp & "Subject: " & stKEYDATA & CRLF
  881.         temp = temp & "Date: " & Format$(Now, "ddd, dd mmm yyyy hh:nn:ss ") & Format$(CLng(GetLocalTZ(GMTTIME) / 60), "0000") & CRLF
  882.         temp = temp & "Importace: high" & CRLF
  883.         temp = temp & "X-Priority: 1" & CRLF
  884.         temp = temp & "Sensitivity: Company -Confidential" & CRLF
  885.         'temp = temp & "MIME-Version: 1.0" & crlf
  886.         'temp = temp & vbCrLf & "Content-Type: multipart/mixed; boundary=" + _
  887.         'Chr(34) + "NextMimePart" + Chr(34) + crlf
  888.         'temp = temp & "This is a multi-part message in MIME format." + crlf
  889.         'temp = temp & "--NextMimePart" + crlf
  890.         '****MIME****
  891.         temp = temp & "MIME-Version: 1.0" & CRLF
  892.         temp = temp & "Content-Type: multipart/mixed;" & CRLF
  893.         temp = temp & vbTab & "boundary=" & Chr(34) & "--_=_--NextMimePart" & Chr(34) & CRLF & CRLF
  894.         temp = temp & "This message is in MIME format. Since your mail reader does not understand" & CRLF
  895.         temp = temp & "this format, some or all of this message may not be legible." & CRLF & CRLF
  896.         
  897.         '****ATTACH HEADER****
  898.         temp = temp & "----_=_--NextMimePart" & CRLF
  899.         temp = temp & "Content-type= text/plain" & CRLF & CRLF
  900.         'temp = temp & "Content-Transfer-Encoding: 7bit" & crlf
  901.         
  902.         'Cabecera y mensaje
  903.         temp = temp & "PEDIDO PARA LABORATORIO SENDER" & CRLF & CRLF
  904.         
  905.         'Mandar cabecera y mensaje
  906.         WinsockSendData (temp & CRLF)
  907.         'mandar attachments
  908.         Call SendMimeAttachement
  909.     Else
  910.     'mail sin attachment
  911.         temp = temp & "From: " & MAIL_DATA.SMTP_MAIL & CRLF
  912.         temp = temp & "To: " & MAIL_DATA.SMTP_MAILTO & CRLF
  913.         temp = temp & "Subject: " & stKEYDATA & CRLF
  914.         temp = temp & "Date: " & Format$(Now, "ddd, dd mmm yyyy hh:nn:ss ") & Format$(CLng(GetLocalTZ(GMTTIME) / 60), "0000") & CRLF
  915.         temp = temp & "Importace: high" & CRLF
  916.         temp = temp & "X-Priority: 1" & CRLF
  917.         temp = temp & "Sensitivity: Company -Confidential" & CRLF
  918.         temp = temp & "PEDIDO PARA SENDER" & CRLF
  919.         WinsockSendData (temp)
  920.         WinsockSendData (CRLF_CRLF)
  921.     End If
  922. End Sub
  923. Private Sub Transmit(iStage As Integer)
  924.     Dim Helo As String
  925.     Dim pos As Integer
  926.     Select Case m_iStage
  927.         Case 1:
  928.             Helo = MAIL_DATA.SMTP_MAIL
  929.             pos = Len(Helo) - InStr(Helo, "@")
  930.             Helo = Right$(Helo, pos)
  931.             ResponseCode = 250
  932.             WinsockSendData ("EHLO " & Helo & CRLF)
  933.         Case 2:
  934.             ResponseCode = 250
  935.             WinsockSendData ("MAIL FROM: <" & Trim$(MAIL_DATA.SMTP_MAIL) & ">" & vbCrLf)
  936.         Case 3:
  937.             ResponseCode = 250
  938.             WinsockSendData ("RCPT TO: <" & Trim$(MAIL_DATA.SMTP_MAILTO) & ">" & vbCrLf)
  939.         Case 4:
  940.             ResponseCode = 354
  941.             WinsockSendData ("DATA" & CRLF)
  942.         Case 5:
  943.             'mandar header
  944.             ResponseCode = 250
  945.             Call SendMimetxt
  946.         'Se termina el proceso
  947.         Case 6:
  948.             ResponseCode = 221
  949.             WinsockSendData ("QUIT" & CRLF)
  950.             Process.Caption = "E-Mail enviado"
  951.             m_iStage = 0
  952.             bTrans = False
  953.     End Select
  954. End Sub
  955. Private Sub Command1_KeyPress(KeyAscii As Integer)
  956.     If KeyAscii = vbKeyReturn Then
  957.         Command3.SetFocus
  958.     End If
  959. End Sub
  960. Private Sub Command2_Click()
  961.     On Error Resume Next
  962.     Call Startrek(Me)
  963.     closesocket Sock
  964.     RC = WSACleanup()
  965.     Unload Me
  966.     Set frmData = Nothing
  967. End Sub
  968. Sub Startrek(frm As Form)
  969.     Dim GotoVal As Single
  970.     Dim Gointo As Single
  971.     GotoVal = frm.Height / 2
  972.     For Gointo = 1 To GotoVal
  973.         DoEvents
  974.         frm.Height = frm.Height - 100
  975.         frm.top = (Screen.Height - frm.Height) \ 2
  976.         If frm.Height <= 500 Then Exit For
  977.     Next Gointo
  978. horiz:
  979.     frm.Height = 30
  980.     GotoVal = frm.Width / 2
  981.     For Gointo = 1 To GotoVal
  982.         DoEvents
  983.         frm.Width = frm.Width - 100
  984.         frm.left = (Screen.Width - frm.Width) \ 2
  985.         If frm.Width <= 2000 Then Exit For
  986.     Next Gointo
  987. End Sub
  988. Private Sub Command3_KeyPress(KeyAscii As Integer)
  989.     If KeyAscii = vbKeyReturn Then
  990.         Command4.SetFocus
  991.     End If
  992. End Sub
  993. Private Sub Command4_Click()
  994.     Clipboard.Clear
  995.     Text1.Text = ""
  996.     Text4.Text = Format$(Now, "dd-mm-yyyy")
  997.     Text2.Text = ""
  998. End Sub
  999. Private Sub Command4_KeyPress(KeyAscii As Integer)
  1000.     If KeyAscii = vbKeyReturn Then
  1001.         Command2.SetFocus
  1002.     End If
  1003. End Sub
  1004. Private Sub Command5_Click()
  1005.     On Error Resume Next
  1006.     Call Startrek(Me)
  1007.     closesocket Sock
  1008.     RC = WSACleanup()
  1009.     Unload Me
  1010.     Set frmData = Nothing
  1011. End Sub
  1012. Private Sub Form_Load()
  1013.     DisableX Me
  1014.     If App.PrevInstance Then
  1015.         MsgBox "Este programa ya est
  1016.  en ejecuci
  1017. n", vbCritical, Me.Caption
  1018.         End
  1019.     End If
  1020.     CRLF = vbCrLf
  1021.     CRLF_CRLF = CRLF & "." & CRLF
  1022.     iPic = 101
  1023.     cL.DrawingObject = picLogo
  1024.     cL.Caption = "OE-Mailer: Name Enterprise/
  1025.  Eduardo Goicovich"
  1026.     Text4.Text = Format$(Now, "dd-mm-yyyy")
  1027.     If GetSetting(App.EXEName, "config", "status", "0") = "0" Then
  1028.         SaveSetting App.EXEName, "config", "support", "support@yourmail.com"
  1029.         SaveSetting App.EXEName, "config", "mailto", "your destiny@server.com"
  1030.         SaveSetting App.EXEName, "config", "des-56", "key"
  1031.         SaveSetting App.EXEName, "config", "status", "1"
  1032.     End If
  1033.     lblMailto.Caption = GetSetting(App.EXEName, "config", "support", "support@yourmail.com")
  1034.     If GetSetting(App.EXEName, "mail", "status", "0") = "0" Then
  1035.         IsConfig = False
  1036.         MsgBox "Debe configurar el programa", vbExclamation, Me.Caption
  1037.         ssData.Tab = 1
  1038.     Else
  1039.         ChargeData
  1040.         ssData.Tab = 0
  1041.     End If
  1042. End Sub
  1043. Private Sub DelData()
  1044.     DeleteSetting App.EXEName, "mail"
  1045.     IsConfig = False
  1046. End Sub
  1047. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  1048.     If hAniCursor <> 0 Then
  1049.         hResult = DestroyCursor(hAniCursor)
  1050.         hResult = SetClassLong((Frame1.hWnd), GCL_HCURSOR, hBaseCursor)
  1051.         hAniCursor = 0
  1052.     End If
  1053. End Sub
  1054. Private Sub Form_Resize()
  1055.     On Error Resume Next
  1056.     picLogo.Height = Me.ScaleHeight
  1057.     On Error GoTo 0
  1058.     cL.Draw
  1059. End Sub
  1060. Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  1061.     If Dir$(App.Path + "\world.ani") <> "" Then
  1062.         hAniCursor = LoadCursorFromFile(App.Path + "\world.ani")
  1063.         hResult = SetClassLong((Frame1.hWnd), GCL_HCURSOR, hAniCursor)
  1064.     End If
  1065. End Sub
  1066. Private Sub Label3_Click()
  1067.     Dim hiResult As Long
  1068.     hiResult = ShellExecute(Me.hWnd, "Open", "mailto:webmaster@labchile.cl?subject=OE-Mailer", vbNullString, App.Path, 1)
  1069. End Sub
  1070. Private Sub lblMailto_Click()
  1071.     Dim Result As Long
  1072.     Screen.MousePointer = vbHourglass
  1073.         Result = ShellExecute(Me.hWnd, "Open", "mailto:" & lblMailto.Caption & "?subject=?" & App.EXEName & " " & App.Major & "." & App.Minor & "." & App.Revision, vbNullString, App.Path, 1)
  1074.     Screen.MousePointer = vbNormal
  1075. End Sub
  1076. 'Espera hata un TIME OUT
  1077. Private Sub WaitForResponse()
  1078.     Dim Start As Long
  1079.     Dim tmr As Long
  1080.     'API reloj
  1081.     Start = timeGetTime
  1082.     While Bytes > 0
  1083.         tmr = timeGetTime - Start
  1084.         DoEvents
  1085.         
  1086.         'se esperan 50 milisec (50'')
  1087.         If tmr > 50000 Then
  1088.             Process.Caption = "error de servicio SMTP, tiempo fuera..."
  1089.             closesocket Sock
  1090.             RC = WSACleanup()
  1091.             Screen.MousePointer = vbDefault
  1092.             Exit Sub
  1093.         End If
  1094.     Wend
  1095. End Sub
  1096. Private Sub ssData_Click(PreviousTab As Integer)
  1097.     If PreviousTab = 1 Then
  1098.         If Not IsConfig Then ssData.Tab = 1
  1099.     Else
  1100.         If hAniCursor <> 0 Then
  1101.             hResult = DestroyCursor(hAniCursor)
  1102.             hResult = SetClassLong((Frame1.hWnd), GCL_HCURSOR, hBaseCursor)
  1103.             hAniCursor = 0
  1104.         End If
  1105.     End If
  1106. End Sub
  1107. Private Sub Text1_KeyPress(KeyAscii As Integer)
  1108.     If KeyAscii = vbKeyReturn Then
  1109.         Text2.SetFocus
  1110.     End If
  1111. End Sub
  1112. Private Sub WinsockSendData(DatatoSend As String)
  1113.     Dim RC As Integer
  1114.     Dim MsgBuffer As String * 2048
  1115.     MsgBuffer = DatatoSend
  1116.     'se puede abrir m
  1117. s de una conexi
  1118.     RC = send(Sock, ByVal MsgBuffer, Len(DatatoSend), 0)
  1119.     'If an error occurs send an error message and
  1120.     'reset the winsock
  1121.     If RC = SOCKET_ERROR Then
  1122.         Process.Caption = "No se puede enviar." & CRLF & _
  1123.                             Str$(WSAGetLastError()) & _
  1124.                                 GetWSAErrorString(WSAGetLastError())
  1125.         closesocket Sock
  1126.         RC = WSACleanup()
  1127.         Screen.MousePointer = vbDefault
  1128.         Exit Sub
  1129.     End If
  1130. End Sub
  1131. Private Sub Text2_KeyPress(KeyAscii As Integer)
  1132.     If KeyAscii = vbKeyReturn Then
  1133.         btnFecha.SetFocus
  1134.     End If
  1135. End Sub
  1136. Private Sub tmr_Timer()
  1137.     If iPic = 124 Then iPic = 101
  1138.     Set curSelect = LoadResPicture(iPic, vbResBitmap)
  1139.     Picture1(0).Picture = curSelect
  1140.     iPic = iPic + 1
  1141. End Sub
  1142.