Fritzfax oder Winfax ohne Dialog?

Du brauchst Grafiken, gute Programme oder Leute die dir helfen? Frag hier.
shim
Beiträge: 65
Registriert: 12.09.2004 23:09

Fritzfax oder Winfax ohne Dialog?

Beitrag von shim »

Hallo,

gibt es eine Möglichkeit ein Faxprogramm ohne Dialog aufzurufen und die Faxnummer und die zu faxende Datei als Parameter zu übergeben?

Lars
shim
Beiträge: 65
Registriert: 12.09.2004 23:09

Beitrag von shim »

Auf der Winfax-Seite habe ich folgenden Code gefunden. Sieht sich jemand im Stande, diesen Code zu konvertieren? Als Anreiz winkt als "Prämie" ein Original Version Winfax 10.0.

Code: Alles auswählen

Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX"
Begin VB.Form frmMain 
   Caption         =   "Send to WinFax SDK Applet"
   ClientHeight    =   5115
   ClientLeft      =   4905
   ClientTop       =   3825
   ClientWidth     =   10095
   LinkTopic       =   "Form1"
   ScaleHeight     =   5115
   ScaleWidth      =   10095
   StartUpPosition =   2  'CenterScreen
   Begin VB.CheckBox chkShowSendScreen 
      Caption         =   "Show Send Screen"
      Height          =   375
      Left            =   8040
      TabIndex        =   36
      Top             =   4440
      Value           =   1  'Checked
      Width           =   1695
   End
   Begin VB.CommandButton cmdPrintToWinFax 
      Caption         =   "Send via ""&Print To WinFax"""
      Height          =   615
      Left            =   2040
      TabIndex        =   25
      Top             =   4440
      Width           =   1695
   End
   Begin TabDlg.SSTab tabMain 
      Height          =   4215
      Left            =   0
      TabIndex        =   2
      Top             =   0
      Width           =   10095
      _ExtentX        =   17806
      _ExtentY        =   7435
      _Version        =   327680
      TabOrientation  =   1
      Style           =   1
      Tabs            =   6
      TabsPerRow      =   6
      TabHeight       =   512
      TabCaption(0)   =   "Send Options"
      TabPicture(0)   =   "Main.frx":0000
      Tab(0).ControlCount=   18
      Tab(0).ControlEnabled=   -1  'True
      Tab(0).Control(0)=   "lblSubject"
      Tab(0).Control(0).Enabled=   0   'False
      Tab(0).Control(1)=   "lblSendOptionsTabTitle"
      Tab(0).Control(1).Enabled=   0   'False
      Tab(0).Control(2)=   "lblCoverText"
      Tab(0).Control(2).Enabled=   0   'False
      Tab(0).Control(3)=   "lblResolution"
      Tab(0).Control(3).Enabled=   0   'False
      Tab(0).Control(4)=   "lblBillingCode"
      Tab(0).Control(4).Enabled=   0   'False
      Tab(0).Control(5)=   "lblKeyWords"
      Tab(0).Control(5).Enabled=   0   'False
      Tab(0).Control(6)=   "edtSubject"
      Tab(0).Control(6).Enabled=   0   'False
      Tab(0).Control(7)=   "chkUseCover"
      Tab(0).Control(7).Enabled=   0   'False
      Tab(0).Control(8)=   "edtCoverText"
      Tab(0).Control(8).Enabled=   0   'False
      Tab(0).Control(9)=   "chkPreviewFax"
      Tab(0).Control(9).Enabled=   0   'False
      Tab(0).Control(10)=   "chkEnableBillingCodeKeyWords"
      Tab(0).Control(10).Enabled=   0   'False
      Tab(0).Control(11)=   "cmbResolution"
      Tab(0).Control(11).Enabled=   0   'False
      Tab(0).Control(12)=   "chkUseCreditCardDialing"
      Tab(0).Control(12).Enabled=   0   'False
      Tab(0).Control(13)=   "chkUsePrefix"
      Tab(0).Control(13).Enabled=   0   'False
      Tab(0).Control(14)=   "chkDeleteAfterSend"
      Tab(0).Control(14).Enabled=   0   'False
      Tab(0).Control(15)=   "edtBillingCode"
      Tab(0).Control(15).Enabled=   0   'False
      Tab(0).Control(16)=   "edtKeyWords"
      Tab(0).Control(16).Enabled=   0   'False
      Tab(0).Control(17)=   "cmdLeaveRunning"
      Tab(0).Control(17).Enabled=   0   'False
      TabCaption(1)   =   "Recipients"
      TabPicture(1)   =   "Main.frx":001C
      Tab(1).ControlCount=   23
      Tab(1).ControlEnabled=   0   'False
      Tab(1).Control(0)=   "lblCtryCode"
      Tab(1).Control(0).Enabled=   0   'False
      Tab(1).Control(1)=   "lblDialPrefix"
      Tab(1).Control(1).Enabled=   0   'False
      Tab(1).Control(2)=   "lblAreaCode"
      Tab(1).Control(2).Enabled=   0   'False
      Tab(1).Control(3)=   "lblPhoneNumber"
      Tab(1).Control(3).Enabled=   0   'False
      Tab(1).Control(4)=   "lblName"
      Tab(1).Control(4).Enabled=   0   'False
      Tab(1).Control(5)=   "lblRecipientsTabTitle"
      Tab(1).Control(5).Enabled=   0   'False
      Tab(1).Control(6)=   "lblExt"
      Tab(1).Control(6).Enabled=   0   'False
      Tab(1).Control(7)=   "lblRecipCount"
      Tab(1).Control(7).Enabled=   0   'False
      Tab(1).Control(8)=   "edtCtryCode"
      Tab(1).Control(8).Enabled=   -1  'True
      Tab(1).Control(9)=   "edtDialPrefix"
      Tab(1).Control(9).Enabled=   -1  'True
      Tab(1).Control(10)=   "edtAreaCode"
      Tab(1).Control(10).Enabled=   -1  'True
      Tab(1).Control(11)=   "edtPhoneNumber"
      Tab(1).Control(11).Enabled=   -1  'True
      Tab(1).Control(12)=   "lstRecipients"
      Tab(1).Control(12).Enabled=   -1  'True
      Tab(1).Control(13)=   "edtName"
      Tab(1).Control(13).Enabled=   -1  'True
      Tab(1).Control(14)=   "cmdAddRecipient"
      Tab(1).Control(14).Enabled=   -1  'True
      Tab(1).Control(15)=   "cmdRemoveAllRecipients"
      Tab(1).Control(15).Enabled=   -1  'True
      Tab(1).Control(16)=   "cmdRemoveRecipient"
      Tab(1).Control(16).Enabled=   -1  'True
      Tab(1).Control(17)=   "cmbSetPriority"
      Tab(1).Control(17).Enabled=   -1  'True
      Tab(1).Control(18)=   "edtExtension"
      Tab(1).Control(18).Enabled=   -1  'True
      Tab(1).Control(19)=   "frameSchedule"
      Tab(1).Control(19).Enabled=   0   'False
      Tab(1).Control(20)=   "lstTypes"
      Tab(1).Control(20).Enabled=   -1  'True
      Tab(1).Control(21)=   "chkSetTypeByName"
      Tab(1).Control(21).Enabled=   -1  'True
      Tab(1).Control(22)=   "cmdUseSelectPBRecip"
      Tab(1).Control(22).Enabled=   -1  'True
      TabCaption(2)   =   "Attachments"
      TabPicture(2)   =   "Main.frx":0038
      Tab(2).ControlCount=   8
      Tab(2).ControlEnabled=   0   'False
      Tab(2).Control(0)=   "cmdAddAttachment"
      Tab(2).Control(0).Enabled=   -1  'True
      Tab(2).Control(1)=   "cmdNumOfAttachments"
      Tab(2).Control(1).Enabled=   -1  'True
      Tab(2).Control(2)=   "cmdRefreshAttachList"
      Tab(2).Control(2).Enabled=   -1  'True
      Tab(2).Control(3)=   "lstAttachments"
      Tab(2).Control(3).Enabled=   -1  'True
      Tab(2).Control(4)=   "lblPleaseWait2"
      Tab(2).Control(4).Enabled=   0   'False
      Tab(2).Control(5)=   "lblNumOfAttachments"
      Tab(2).Control(5).Enabled=   0   'False
      Tab(2).Control(6)=   "lblAttachments"
      Tab(2).Control(6).Enabled=   0   'False
      Tab(2).Control(7)=   "lblAddAttachmentsTabTitle"
      Tab(2).Control(7).Enabled=   0   'False
      TabCaption(3)   =   "Phonebook"
      TabPicture(3)   =   "Main.frx":0054
      Tab(3).ControlCount=   4
      Tab(3).ControlEnabled=   0   'False
      Tab(3).Control(0)=   "lvwPBRecip"
      Tab(3).Control(0).Enabled=   0   'False
      Tab(3).Control(1)=   "tvwPhoneFolders"
      Tab(3).Control(1).Enabled=   0   'False
      Tab(3).Control(2)=   "lblPBRecipients"
      Tab(3).Control(2).Enabled=   0   'False
      Tab(3).Control(3)=   "lblPbFolders"
      Tab(3).Control(3).Enabled=   0   'False
      TabCaption(4)   =   "Cover Pages"
      TabPicture(4)   =   "Main.frx":0070
      Tab(4).ControlCount=   11
      Tab(4).ControlEnabled=   0   'False
      Tab(4).Control(0)=   "lblCoverPagesTabTitle"
      Tab(4).Control(0).Enabled=   0   'False
      Tab(4).Control(1)=   "lblDefault"
      Tab(4).Control(1).Enabled=   0   'False
      Tab(4).Control(2)=   "lblDescription"
      Tab(4).Control(2).Enabled=   0   'False
      Tab(4).Control(3)=   "lblFilename"
      Tab(4).Control(3).Enabled=   0   'False
      Tab(4).Control(4)=   "lblOleType"
      Tab(4).Control(4).Enabled=   0   'False
      Tab(4).Control(5)=   "lblPleaseWait"
      Tab(4).Control(5).Enabled=   0   'False
      Tab(4).Control(6)=   "lblNumOfCoverPages"
      Tab(4).Control(6).Enabled=   0   'False
      Tab(4).Control(7)=   "lblCoverPages"
      Tab(4).Control(7).Enabled=   0   'False
      Tab(4).Control(8)=   "chkUseQuickCoverPage"
      Tab(4).Control(8).Enabled=   -1  'True
      Tab(4).Control(9)=   "lstCoverPages"
      Tab(4).Control(9).Enabled=   -1  'True
      Tab(4).Control(10)=   "cmdRefreshCoverPages"
      Tab(4).Control(10).Enabled=   -1  'True
      TabCaption(5)   =   "Application Object"
      TabPicture(5)   =   "Main.frx":008C
      Tab(5).ControlCount=   12
      Tab(5).ControlEnabled=   0   'False
      Tab(5).Control(0)=   "lblAppObjTabTitle"
      Tab(5).Control(0).Enabled=   0   'False
      Tab(5).Control(1)=   "lblReturnVal"
      Tab(5).Control(1).Enabled=   0   'False
      Tab(5).Control(2)=   "lblReturnLabel"
      Tab(5).Control(2).Enabled=   0   'False
      Tab(5).Control(3)=   "lblWFName"
      Tab(5).Control(3).Enabled=   0   'False
      Tab(5).Control(4)=   "lblFullName"
      Tab(5).Control(4).Enabled=   0   'False
      Tab(5).Control(5)=   "cmdGetAutoRecvStatus"
      Tab(5).Control(5).Enabled=   0   'False
      Tab(5).Control(6)=   "cmdAutoRecvOff"
      Tab(5).Control(6).Enabled=   0   'False
      Tab(5).Control(7)=   "cmdAutoRecvOn"
      Tab(5).Control(7).Enabled=   0   'False
      Tab(5).Control(8)=   "cmdRefreshDeviceList"
      Tab(5).Control(8).Enabled=   0   'False
      Tab(5).Control(9)=   "lstDeviceList"
      Tab(5).Control(9).Enabled=   0   'False
      Tab(5).Control(10)=   "cmdLeaveAppRunning"
      Tab(5).Control(10).Enabled=   0   'False
      Tab(5).Control(11)=   "cmdQuit"
      Tab(5).Control(11).Enabled=   0   'False
      Begin VB.CommandButton cmdAddAttachment 
         Caption         =   "Add Attachment"
         Height          =   495
         Left            =   -71400
         TabIndex        =   87
         Top             =   930
         Width           =   1935
      End
      Begin VB.CommandButton cmdQuit 
         Caption         =   "Quit"
         Height          =   495
         Left            =   -70200
         TabIndex        =   81
         Top             =   2085
         Width           =   1815
      End
      Begin VB.CommandButton cmdLeaveAppRunning 
         Caption         =   "Leave Running"
         Height          =   495
         Left            =   -70200
         TabIndex        =   80
         Top             =   2685
         Width           =   1815
      End
      Begin VB.ListBox lstDeviceList 
         Height          =   1230
         Left            =   -74760
         TabIndex        =   79
         Top             =   1485
         Width           =   2895
      End
      Begin VB.CommandButton cmdRefreshDeviceList 
         Caption         =   "Refresh"
         Height          =   495
         Left            =   -74760
         TabIndex        =   78
         Top             =   2805
         Width           =   975
      End
      Begin VB.CommandButton cmdAutoRecvOn 
         Caption         =   "Auto Recv On"
         Height          =   495
         Left            =   -73680
         TabIndex        =   77
         Top             =   2805
         Width           =   855
      End
      Begin VB.CommandButton cmdAutoRecvOff 
         Caption         =   "Auto Recv Off"
         Height          =   495
         Left            =   -72720
         TabIndex        =   76
         Top             =   2805
         Width           =   855
      End
      Begin VB.CommandButton cmdGetAutoRecvStatus 
         Caption         =   "Get Auto Recv Status"
         Height          =   375
         Left            =   -74760
         TabIndex        =   75
         Top             =   3405
         Width           =   1935
      End
      Begin VB.CommandButton cmdUseSelectPBRecip 
         Caption         =   "Use PB Recip"
         Height          =   495
         Left            =   -71880
         TabIndex        =   70
         Top             =   3045
         Width           =   1335
      End
      Begin VB.CheckBox chkSetTypeByName 
         Caption         =   "Set Type By Name"
         Height          =   375
         Left            =   -70200
         TabIndex        =   69
         Top             =   3330
         Width           =   1815
      End
      Begin VB.ListBox lstTypes 
         Height          =   1035
         Left            =   -70200
         TabIndex        =   68
         Top             =   2250
         Width           =   1815
      End
      Begin VB.CommandButton cmdNumOfAttachments 
         Caption         =   "Number of Selected Attachments"
         Height          =   615
         Left            =   -71400
         TabIndex        =   67
         Top             =   1680
         Width           =   1935
      End
      Begin VB.CommandButton cmdLeaveRunning 
         Caption         =   "Leave Running"
         Height          =   495
         Left            =   7560
         TabIndex        =   66
         Top             =   2640
         Width           =   1575
      End
      Begin VB.CommandButton cmdRefreshAttachList 
         Caption         =   "Refresh Attachments"
         Height          =   495
         Left            =   -71400
         TabIndex        =   65
         Top             =   2520
         Width           =   1935
      End
      Begin VB.ListBox lstAttachments 
         Height          =   2400
         Left            =   -74880
         TabIndex        =   60
         Top             =   810
         Width           =   3255
      End
      Begin VB.CommandButton cmdRefreshCoverPages 
         Caption         =   "Refresh Cover Pages List"
         Enabled         =   0   'False
         Height          =   615
         Left            =   -70920
         TabIndex        =   53
         Top             =   2370
         Width           =   1575
      End
      Begin VB.ListBox lstCoverPages 
         Enabled         =   0   'False
         Height          =   2205
         Left            =   -74880
         TabIndex        =   52
         Top             =   810
         Width           =   3735
      End
      Begin VB.Frame frameSchedule 
         Caption         =   "Schedule: "
         Height          =   2055
         Left            =   -70200
         TabIndex        =   44
         Top             =   90
         Width           =   2535
         Begin VB.CheckBox chkOnHold 
            Caption         =   "On Hold"
            Height          =   255
            Left            =   240
            TabIndex        =   49
            Top             =   240
            Width           =   1935
         End
         Begin VB.CheckBox chkOffPeak 
            Caption         =   "Off Peak"
            Height          =   375
            Left            =   240
            TabIndex        =   48
            Top             =   600
            Width           =   1935
         End
         Begin VB.CheckBox chkSendOn 
            Caption         =   "Send On"
            Height          =   375
            Left            =   240
            TabIndex        =   47
            Top             =   960
            Width           =   1215
         End
         Begin VB.TextBox edtDate 
            Enabled         =   0   'False
            Height          =   285
            Left            =   840
            TabIndex        =   46
            Top             =   1320
            Width           =   1095
         End
         Begin VB.TextBox edtTime 
            Enabled         =   0   'False
            Height          =   285
            Left            =   840
            TabIndex        =   45
            Top             =   1680
            Width           =   1095
         End
         Begin VB.Label lblTime 
            Caption         =   "Time:"
            Enabled         =   0   'False
            Height          =   255
            Left            =   360
            TabIndex        =   51
            Top             =   1680
            Width           =   495
         End
         Begin VB.Label lblDate 
            Caption         =   "Date:"
            Enabled         =   0   'False
            Height          =   255
            Left            =   360
            TabIndex        =   50
            Top             =   1320
            Width           =   495
         End
      End
      Begin VB.TextBox edtKeyWords 
         Height          =   375
         Left            =   7200
         TabIndex        =   41
         Top             =   1830
         Width           =   1695
      End
      Begin VB.TextBox edtBillingCode 
         Height          =   375
         Left            =   7200
         TabIndex        =   40
         Top             =   1080
         Width           =   1695
      End
      Begin VB.CheckBox chkDeleteAfterSend 
         Caption         =   "Delete After Send"
         Height          =   375
         Left            =   4560
         TabIndex        =   39
         Top             =   1890
         Width           =   2175
      End
      Begin VB.TextBox edtExtension 
         Height          =   375
         Left            =   -74040
         TabIndex        =   34
         Top             =   2610
         Width           =   1575
      End
      Begin VB.ComboBox cmbSetPriority 
         Enabled         =   0   'False
         Height          =   315
         Left            =   -67680
         Style           =   2  'Dropdown List
         TabIndex        =   33
         Top             =   2640
         Width           =   2295
      End
      Begin VB.CheckBox chkUsePrefix 
         Caption         =   "Use Prefix"
         Height          =   375
         Left            =   4560
         TabIndex        =   32
         Top             =   1410
         Value           =   1  'Checked
         Width           =   2055
      End
      Begin VB.CheckBox chkUseCreditCardDialing 
         Caption         =   "Use Credit Card Dialing (must be setup in WinFax)"
         Height          =   495
         Left            =   4560
         TabIndex        =   31
         Top             =   930
         Width           =   2175
      End
      Begin VB.ComboBox cmbResolution 
         Height          =   315
         ItemData        =   "Main.frx":00A8
         Left            =   4560
         List            =   "Main.frx":00B2
         Style           =   2  'Dropdown List
         TabIndex        =   30
         Top             =   450
         Width           =   2055
      End
      Begin VB.CheckBox chkUseQuickCoverPage 
         Caption         =   "Use Quick Cover Page"
         Height          =   375
         Left            =   -74760
         TabIndex        =   27
         Top             =   3120
         Value           =   1  'Checked
         Width           =   2175
      End
      Begin VB.CheckBox chkEnableBillingCodeKeyWords 
         Caption         =   "Enable Billing Code && Keywods"
         Height          =   375
         Left            =   7200
         TabIndex        =   26
         Top             =   240
         Width           =   2055
      End
      Begin VB.CommandButton cmdRemoveRecipient 
         Caption         =   "&Remove"
         Enabled         =   0   'False
         Height          =   495
         Left            =   -71880
         TabIndex        =   24
         Top             =   1890
         Width           =   1335
      End
      Begin VB.CommandButton cmdRemoveAllRecipients 
         Caption         =   "Remove A&ll"
         Enabled         =   0   'False
         Height          =   495
         Left            =   -71880
         TabIndex        =   23
         Top             =   2490
         Width           =   1335
      End
      Begin VB.CheckBox chkPreviewFax 
         Caption         =   "Preview Fax"
         Height          =   495
         Left            =   4560
         TabIndex        =   22
         Top             =   2400
         Width           =   1335
      End
      Begin VB.TextBox edtCoverText 
         Height          =   1455
         Left            =   120
         MultiLine       =   -1  'True
         TabIndex        =   20
         Top             =   2250
         Width           =   3975
      End
      Begin VB.CheckBox chkUseCover 
         Caption         =   "Use Cover Page"
         Height          =   375
         Left            =   120
         TabIndex        =   19
         Top             =   1530
         Value           =   1  'Checked
         Width           =   1575
      End
      Begin VB.CommandButton cmdAddRecipient 
         Caption         =   "&Add Recipient"
         Height          =   495
         Left            =   -71880
         TabIndex        =   18
         Top             =   1290
         Width           =   1335
      End
      Begin VB.TextBox edtName 
         Height          =   375
         Left            =   -74040
         TabIndex        =   15
         Top             =   1410
         Width           =   1575
      End
      Begin VB.ListBox lstRecipients 
         Height          =   1620
         Left            =   -67560
         TabIndex        =   13
         Top             =   90
         Width           =   2295
      End
      Begin VB.TextBox edtPhoneNumber 
         Height          =   375
         Left            =   -74040
         TabIndex        =   12
         Top             =   2010
         Width           =   1575
      End
      Begin VB.TextBox edtAreaCode 
         Height          =   375
         Left            =   -71160
         TabIndex        =   10
         Text            =   "416"
         Top             =   690
         Width           =   735
      End
      Begin VB.TextBox edtDialPrefix 
         Height          =   375
         Left            =   -74160
         TabIndex        =   8
         Text            =   "9,"
         Top             =   690
         Width           =   375
      End
      Begin VB.TextBox edtCtryCode 
         Height          =   375
         Left            =   -72600
         TabIndex        =   5
         Text            =   "1"
         Top             =   690
         Width           =   375
      End
      Begin VB.TextBox edtSubject 
         Height          =   375
         Left            =   120
         TabIndex        =   4
         Text            =   "Your Test Fax"
         Top             =   1050
         Width           =   2895
      End
      Begin ComctlLib.ListView lvwPBRecip 
         Height          =   3495
         Left            =   -72480
         TabIndex        =   71
         Top             =   330
         Width           =   7335
         _ExtentX        =   12938
         _ExtentY        =   6165
         View            =   3
         LabelWrap       =   -1  'True
         HideSelection   =   -1  'True
         _Version        =   327680
         ForeColor       =   -2147483640
         BackColor       =   -2147483643
         BorderStyle     =   1
         Appearance      =   1
         MouseIcon       =   "Main.frx":00DA
         NumItems        =   7
         BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
            Key             =   "Group"
            Object.Tag             =   ""
            Text            =   "Type"
            Object.Width           =   1411
         EndProperty
         BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
            SubItemIndex    =   1
            Key             =   "DisplayName"
            Object.Tag             =   ""
            Text            =   "Display Name"
            Object.Width           =   2540
         EndProperty
         BeginProperty ColumnHeader(3) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
            SubItemIndex    =   2
            Key             =   "FirstName"
            Object.Tag             =   ""
            Text            =   "First Name"
            Object.Width           =   1764
         EndProperty
         BeginProperty ColumnHeader(4) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
            SubItemIndex    =   3
            Key             =   "LastName"
            Object.Tag             =   ""
            Text            =   "Last Name"
            Object.Width           =   1764
         EndProperty
         BeginProperty ColumnHeader(5) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
            SubItemIndex    =   4
            Key             =   "CountryCode"
            Object.Tag             =   ""
            Text            =   "Country Code"
            Object.Width           =   529
         EndProperty
         BeginProperty ColumnHeader(6) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
            SubItemIndex    =   5
            Key             =   ""
            Object.Tag             =   ""
            Text            =   "Area Code"
            Object.Width           =   1411
         EndProperty
         BeginProperty ColumnHeader(7) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
            SubItemIndex    =   6
            Key             =   ""
            Object.Tag             =   ""
            Text            =   "Number"
            Object.Width           =   2540
         EndProperty
      End
      Begin ComctlLib.TreeView tvwPhoneFolders 
         Height          =   3495
         Left            =   -75000
         TabIndex        =   72
         Top             =   330
         Width           =   2415
         _ExtentX        =   4260
         _ExtentY        =   6165
         _Version        =   327680
         Indentation     =   529
         LineStyle       =   1
         Style           =   6
         Appearance      =   1
         MouseIcon       =   "Main.frx":00F6
      End
      Begin VB.Label lblFullName 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   1  'Fixed Single
         Height          =   375
         Left            =   -74880
         TabIndex        =   86
         Top             =   525
         Width           =   8535
      End
      Begin VB.Label lblWFName 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   1  'Fixed Single
         Height          =   375
         Left            =   -74880
         TabIndex        =   85
         Top             =   1005
         Width           =   3135
      End
      Begin VB.Label lblReturnLabel 
         Caption         =   "Return Value:"
         Height          =   255
         Left            =   -68160
         TabIndex        =   84
         Top             =   2520
         Width           =   1095
      End
      Begin VB.Label lblReturnVal 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   1  'Fixed Single
         Height          =   375
         Left            =   -67080
         TabIndex        =   83
         Top             =   2445
         Width           =   615
      End
      Begin VB.Label lblAppObjTabTitle 
         Caption         =   "Application Obj:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   18
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   495
         Left            =   -74880
         TabIndex        =   82
         Top             =   45
         Width           =   5175
      End
      Begin VB.Label lblPBRecipients 
         Caption         =   "Phonebook Recipients:"
         Height          =   255
         Left            =   -72480
         TabIndex        =   74
         Top             =   90
         Width           =   3375
      End
      Begin VB.Label lblPbFolders 
         Caption         =   "Phonebook Folders:"
         Height          =   255
         Left            =   -75000
         TabIndex        =   73
         Top             =   90
         Width           =   2415
      End
      Begin VB.Label lblPleaseWait2 
         Caption         =   "Please Wait..."
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   18
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000C0&
         Height          =   615
         Left            =   -74640
         TabIndex        =   64
         Top             =   2370
         Width           =   2775
      End
      Begin VB.Label lblNumOfAttachments 
         Height          =   375
         Left            =   -74880
         TabIndex        =   63
         Top             =   3360
         Width           =   3255
      End
      Begin VB.Label lblAttachments 
         Caption         =   "Available Attachments:"
         Height          =   375
         Left            =   -74880
         TabIndex        =   62
         Top             =   570
         Width           =   3255
      End
      Begin VB.Label lblCoverPages 
         Caption         =   "Available Cover Pages:"
         Height          =   255
         Left            =   -74880
         TabIndex        =   61
         Top             =   570
         Width           =   3735
      End
      Begin VB.Label lblNumOfCoverPages 
         Height          =   255
         Left            =   -74880
         TabIndex        =   59
         Top             =   3480
         Width           =   3735
      End
      Begin VB.Label lblPleaseWait 
         Caption         =   "Please Wait..."
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   18
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000C0&
         Height          =   615
         Left            =   -74400
         TabIndex        =   58
         Top             =   2130
         Width           =   2775
      End
      Begin VB.Label lblOleType 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   1  'Fixed Single
         Enabled         =   0   'False
         Height          =   375
         Left            =   -70920
         TabIndex        =   57
         Top             =   1770
         Width           =   5175
      End
      Begin VB.Label lblFilename 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   1  'Fixed Single
         Enabled         =   0   'False
         Height          =   375
         Left            =   -70920
         TabIndex        =   56
         Top             =   1410
         Width           =   5175
      End
      Begin VB.Label lblDescription 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   1  'Fixed Single
         Enabled         =   0   'False
         Height          =   375
         Left            =   -70920
         TabIndex        =   55
         Top             =   1050
         Width           =   5175
      End
      Begin VB.Label lblDefault 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   1  'Fixed Single
         Enabled         =   0   'False
         Height          =   375
         Left            =   -70920
         TabIndex        =   54
         Top             =   690
         Width           =   5175
      End
      Begin VB.Label lblKeyWords 
         Caption         =   "KeyWords:"
         Height          =   255
         Left            =   7200
         TabIndex        =   43
         Top             =   1590
         Width           =   975
      End
      Begin VB.Label lblBillingCode 
         Caption         =   "Billing Code:"
         Height          =   255
         Left            =   7200
         TabIndex        =   42
         Top             =   840
         Width           =   975
      End
      Begin VB.Label lblRecipCount 
         Caption         =   "Recipient Count = 0"
         Height          =   255
         Left            =   -67560
         TabIndex        =   38
         ToolTipText     =   "This value is generated by the SDK"
         Top             =   1770
         Width           =   2295
      End
      Begin VB.Label lblCoverPagesTabTitle 
         Caption         =   "Select Cover Page:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   18
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   495
         Left            =   -74880
         TabIndex        =   37
         Top             =   90
         Width           =   5175
      End
      Begin VB.Label lblExt 
         Caption         =   "Extension:"
         Height          =   375
         Left            =   -74880
         TabIndex        =   35
         Top             =   2610
         Width           =   735
      End
      Begin VB.Label lblResolution 
         Caption         =   "Resolution:"
         Height          =   255
         Left            =   4560
         TabIndex        =   29
         Top             =   210
         Width           =   975
      End
      Begin VB.Label lblAddAttachmentsTabTitle 
         Caption         =   "Add Attachments:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   18
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   495
         Left            =   -74880
         TabIndex        =   28
         Top             =   90
         Width           =   5175
      End
      Begin VB.Label lblCoverText 
         Caption         =   "Cover Page Text:"
         Height          =   375
         Left            =   120
         TabIndex        =   21
         Top             =   2010
         Width           =   2175
      End
      Begin VB.Label lblSendOptionsTabTitle 
         Caption         =   "Enter Send Options:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   18
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   495
         Left            =   120
         TabIndex        =   17
         Top             =   90
         Width           =   4095
      End
      Begin VB.Label lblRecipientsTabTitle 
         Caption         =   "Enter Recipient Information:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   18
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   495
         Left            =   -74880
         TabIndex        =   16
         Top             =   90
         Width           =   5175
      End
      Begin VB.Label lblName 
         Caption         =   "Name:"
         Height          =   375
         Left            =   -74640
         TabIndex        =   14
         Top             =   1410
         Width           =   735
      End
      Begin VB.Label lblPhoneNumber 
         Caption         =   "Phone Number:"
         Height          =   375
         Left            =   -74760
         TabIndex        =   11
         Top             =   2010
         Width           =   735
      End
      Begin VB.Label lblAreaCode 
         Caption         =   "Area Code:"
         Height          =   495
         Left            =   -71640
         TabIndex        =   9
         Top             =   690
         Width           =   615
      End
      Begin VB.Label lblDialPrefix 
         Caption         =   "Dialing Prefix:"
         Height          =   495
         Left            =   -74760
         TabIndex        =   7
         Top             =   690
         Width           =   735
      End
      Begin VB.Label lblCtryCode 
         Caption         =   "Country Code:"
         Height          =   375
         Left            =   -73200
         TabIndex        =   6
         Top             =   690
         Width           =   735
      End
      Begin VB.Label lblSubject 
         Caption         =   "Subject:"
         Height          =   255
         Left            =   120
         TabIndex        =   3
         Top             =   810
         Width           =   735
      End
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "E&xit"
      Height          =   615
      Left            =   4920
      TabIndex        =   1
      Top             =   4440
      Width           =   1815
   End
   Begin VB.CommandButton cmdSendNow 
      Caption         =   "&Send Now"
      Height          =   615
      Left            =   120
      TabIndex        =   0
      Top             =   4440
      Width           =   1695
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' General Constants
Const TAB_SENDOPTIONS = 0
Const TAB_RECIPIENTS = 1
Const TAB_ATTACHMENTS = 2
Const TAB_PHONEBOOK = 3
Const TAB_COVERPAGES = 4
Const TAB_WINFAX = 5

' variables and constants for manipulating the phonebook to use with adding recipients
Const EVENTTYPE_UNKNOWN = 0
Const EVENTTYPE_LGFOLDER = 1
Const EVENTTYPE_FAX = 2
Const EVENTTYPE_VOICE = 3
Const EVENTTYPE_PBFOLDER = 4
Const EVENTTYPE_USER = 5
Const EVENTTYPE_GROUP = 6

Const STANDARDFOLDER_NONE = 0
Const STANDARDFOLDER_WINFAX_ROOT = 1
Const STANDARDFOLDER_WINFAX_LOG = 2
Const STANDARDFOLDER_WINFAX_RECEIVELOG = 3
Const STANDARDFOLDER_WINFAX_SENDLOG = 4
Const STANDARDFOLDER_WINFAX_WASTEBASKET = 5
Const STANDARDFOLDER_WINFAX_OUTBOX = 6
Const STANDARDFOLDER_MAPI = 7
    
Const SDKERROR_NOERROR = 0
Const SDKERROR_NOENTRYID = 2
Const SDKERROR_BADENTRYID = 3
Const SDKERROR_BADDATASTRUCT = 4
Const SDKERROR_BADFILESPEC = 5
Const SDKERROR_CANTSETFOLDER = 6
Const SDKERROR_CANTGETCOUNTER = 7
Const SDKERROR_CANTENUMERATE = 8
Const SDKERROR_CANTREMOVE = 9
Const SDKERROR_CANTADD = 10
Const SDKERROR_WRONGEVENTTYPE = 11

Dim arrayOfPBFolders() As String
Dim arrayOfRecips() As String

Dim curUserGroupID As String ' the ID of the currently highlighted recipient(user)/group
Dim curDisplayName As String ' the display name of the currently highlighted recipient
Dim curFolderID As String ' the ID of the currently highlighted folder

Dim phoneObj As Object

' variables to manipulate the SDK
Dim pagesObj As Object
Dim attachsObj As Object
Dim winfaxObj As Object
Dim sendObj As Object

Private Sub chkOffPeak_Click()
  If chkOffPeak.Value = 1 Then
    chkSendOn.Value = 0
  End If
End Sub

Private Sub chkSendOn_Click()
  If chkSendOn.Value = 1 Then
    ' enable the Date and Time fields
    lblDate.Enabled = True
    lblTime.Enabled = True
    edtDate.Enabled = True
    edtTime.Enabled = True
    
    ' turn off the "Off Peak" settings
    chkOffPeak.Value = 0
  Else
    lblDate.Enabled = False
    lblTime.Enabled = False
    edtDate.Enabled = False
    edtTime.Enabled = False
  End If
End Sub

Private Sub chkUseQuickCoverPage_Click()
  If chkUseQuickCoverPage.Value = 0 Then
    lstCoverPages.Enabled = True
    lblDefault.Enabled = True
    lblDescription.Enabled = True
    lblOleType.Enabled = True
    lblFilename.Enabled = True
    cmdRefreshCoverPages.Enabled = True
  Else
    lstCoverPages.Enabled = False
    lblDefault.Enabled = False
    lblDescription.Enabled = False
    lblOleType.Enabled = False
    lblFilename.Enabled = False
    cmdRefreshCoverPages.Enabled = False
  End If
End Sub

Private Sub cmdAddAttachment_Click()
  If lstAttachments.ListIndex <> -1 Then
    If sendObj.AddAttachment(lstAttachments.ListIndex + 1) = 1 Then
      MsgBox "Failed when adding attachment!"
    End If
  Else
    MsgBox "You must select an attachment before adding it to the send job.", vbExclamation
  End If
End Sub

Private Sub cmdAddRecipient_Click()
  ' Add a recipient, as long as the minimum info is there
  If edtName.Text <> "" And edtPhoneNumber.Text <> "" Then
    ' Add each bit of recipient info:
    '   To use in conjunction with ResetCurrentRecipient, set either all
    '   or some of the recipient parameters based on the chkVerifyWhenAdding
    '   checkbox.  If a control is blank or off and VerifyWhenAdding is
    '   on, don't set that recipient parameter.  In all other cases,
    '   set the parameter in question.
    sendObj.SetAreaCode (edtAreaCode.Text)
    sendObj.SetCountryCode (edtCtryCode.Text)
    sendObj.SetDialPrefix (edtDialPrefix.Text)
    sendObj.SetNumber (edtPhoneNumber.Text)
    sendObj.SetExtension (edtExtension.Text)
    sendObj.SetTo (edtName.Text)
    If chkOnHold.Value = 1 Then
      sendObj.SetHold (chkOnHold.Value)
    ElseIf chkOffPeak.Value = 1 Then
      sendObj.SetOffPeak (chkOffPeak.Value)
    ElseIf chkSendOn.Value = 1 Then
      sendObj.SetTime (edtTime.Text)
      sendObj.SetDate (edtDate.Text)
    End If

    If chkSetTypeByName.Value = 0 Then
      sendObj.SetType (lstTypes.ListIndex)
    Else
      sendObj.SetTypeByName (Mid$(lstType.List(lstTypes.ListIndex), 2))
    End If
    
    If sendObj.AddRecipient() = 1 Then
      MsgBox "The Recipient couldn't be added.", vbExclamation
    Else
      ' update the recipient list
      lstRecipients.AddItem (edtName.Text)
      cmdRemoveRecipient.Enabled = True
      cmdRemoveAllRecipients.Enabled = True
      
      ' clear the phone number and name fields
      edtName.Text = ""
      edtPhoneNumber.Text = ""
      edtExtension.Text = ""
    End If
  End If
  
  lblRecipCount.Caption = "Recipient Count =" + Str$(sendObj.GetRecipientCount)
End Sub

Private Sub cmdAutoRecvOff_Click()
  If MsgBox("Turn Off Auto Recv for """ + lstDeviceList.List(lstDeviceList.ListIndex) + """?", vbYesNo) = vbYes Then
    lblReturnVal.Caption = Str$(winfaxObj.AutoReceive(lstDeviceList.List(lstDeviceList.ListIndex), False))
  End If
End Sub

Private Sub cmdAutoRecvOn_Click()
  If MsgBox("Turn On Auto Recv for """ + lstDeviceList.List(lstDeviceList.ListIndex) + """?", vbYesNo) = vbYes Then
    lblReturnVal.Caption = Str$(winfaxObj.AutoReceive(lstDeviceList.List(lstDeviceList.ListIndex), True))
  End If
End Sub

Private Sub cmdExit_Click()
  Unload frmMain
End Sub

Private Sub cmdLeaveAppRunning_Click()
Dim visible As Integer
  If MsgBox("Leave winfax running visible?", vbYesNo) Then
    visible = True
  Else
    visible = False
  End If
  lblReturnVal.Caption = winfaxObj.LeaveRunning(visible)
End Sub

Private Sub cmdLeaveRunning_Click()
  sendObj.LeaveRunning
End Sub

Private Sub cmdMaximized_Click()
  lblReturnVal.Caption = Str$(winfaxObj.ShowMaximized())
End Sub

Private Sub cmdNumOfAttachments_Click()
  MsgBox "The have been" + Str$(sendObj.GetAttachmentCount()) + " attachments attached to the send job.", vbInformation
End Sub

Private Sub cmdPrintToWinFax_Click()
  If lstRecipients.ListCount <> 0 Then
    ' send the fax
    SetSendOptions
    sendObj.SetPrintFromApp (1)
    sendObj.Send (0)
    
    ' okay, lets print
    MsgBox "Print to Winfax now using any app you choose and WinFax will send that print job using the send options set here.  Click OK here once you have finished printing.", vbInformation
  
    ' Reset Send Info
    ResetSendInfo
    Set sendObj = Nothing
    Set sendObj = CreateObject("WinFax.SDKSend")
  Else
    MsgBox "Please Correct Send Information!", vbCritical
  End If
End Sub

Private Sub cmdQuit_Click()
  If MsgBox("Are you sure you want to cause WinFax and the Controller to quit?", vbQuestion) = vbYes Then
    Set sendObj = Nothing
    Set phoneObj = Nothing
    Set pagesObj = Nothing
    Set attachsObj = Nothing
    lblReturnVal.Caption = Str$(winfaxObj.Quit())
  End If
End Sub

Private Sub cmdRefreshAttachList_Click()
  showAttachments
End Sub

Private Sub cmdRefreshCoverPages_Click()
  showCoverPages
End Sub

Private Sub cmdRefreshDeviceList_Click()
  getDeviceList
End Sub

Private Sub cmdRemoveAllRecipients_Click()
Dim t As Integer
  
  ' remove all recipients
  sendObj.RemoveAllRecipients
  lblRecipCount.Caption = "Recipient Count =" + Str$(sendObj.GetRecipientCount)
  
  clearRecipientsList

  ' disable the two Remove buttons
  cmdRemoveAllRecipients.Enabled = False
  cmdRemoveRecipient.Enabled = False
End Sub

Private Sub clearRecipientsList()
  edtName.Text = ""
  edtPhoneNumber.Text = ""
  edtDialPrefix.Text = "9,"
  edtCtryCode.Text = "1"
  edtAreaCode.Text = "416"

  ' clear "lstRecipients"
  For t = 1 To lstRecipients.ListCount
    lstRecipients.RemoveItem (0)
  Next t
End Sub

Private Sub cmdRemoveRecipient_Click()
  sendObj.RemoveRecipient (lstRecipients.ListIndex)
  lstRecipients.RemoveItem lstRecipients.ListIndex
  lblRecipCount.Caption = "Recipient Count =" + Str$(sendObj.GetRecipientCount)
End Sub

Private Sub cmdSendNow_Click()
Dim ret As Integer
Static didAReset As Boolean

  ' send the fax
  If (lstRecipients.ListCount <> 0 And chkUseCover.Value = 1) Or (didAReset) Then
    SetSendOptions
    
    ' okay, lets go!
    ret = sendObj.Send(0)
  
    ' was there an error?
    If ret <> 0 Then
      MsgBox "There was an Error", vbOKOnly
    Else
      MsgBox "Fax has been sent!", vbInformation
    End If
      
    ' clean up after the send
    ResetSendInfo
    didAReset = False
    ' destroy and recreate the send object so we can send another fax
    Set sendObj = Nothing
    Set sendObj = CreateObject("WinFax.SDKSend")
  Else
    MsgBox "Please Correct Send Information!", vbCritical
  End If
End Sub

Private Sub cmdUseSelectPBRecip_Click()
  If curUserGroupID <> "" Then
    sendObj.SetUserGroupEntryID (curUserGroupID)
      
    If sendObj.AddRecipient() = 1 Then
      MsgBox "The Recipient couldn't be added.", vbExclamation
    Else
      ' update the recipient list
      lstRecipients.AddItem (curDisplayName)
      cmdRemoveRecipient.Enabled = True
      cmdRemoveAllRecipients.Enabled = True
    End If
  Else
    MsgBox "You must select a recipient on the Phonebook Tab!", vbExclamation
  End If

  lblRecipCount.Caption = "Recipient Count =" + Str$(sendObj.GetRecipientCount)
End Sub

Private Sub cmdGetAutoRecvStatus_Click()
Dim device As String
Dim autoRecvStatus As Integer

  device = lstDeviceList.List(lstDeviceList.ListIndex)

  If winfaxObj.GetAutoReceive(device, autoRecvStatus) = 1 Then
    MsgBox "Failed to get Auto Receive Status"
  Else
    MsgBox "The status of """ + device + """ is:" + Str$(autoRecvStatus), vbInformation
  End If
End Sub

Private Sub Form_Load()
Dim prtObj As Printer

  ' init
  cmbResolution.ListIndex = 1

  ' initialize objects
  Set sendObj = CreateObject("WinFax.SDKSend")
  Set phoneObj = CreateObject("WinFax.SDKPhoneBook")
  If showAllPbFolders() = 0 Then
    MsgBox "Couldn't show the phonebook folders!", vbCritical
  End If
End Sub

Private Sub Form_Terminate()
  ' clean up the use of any created objects
  Set sendObj = Nothing
  Set pagesObj = Nothing
  Set attachsObj = Nothing
  Set winfaxObj = Nothing
  Set phoneObj = Nothing
End Sub

Private Sub lblReturnVal_Click()
  lblReturnVal.Caption = ""
End Sub

Private Sub lstCoverPages_Click()
Dim pageObj As Object

  Set pagesObj = CreateObject("WinFax.CoverPages")
  Set pageObj = pagesObj.Item(lstCoverPages.ListIndex + 1)
  lblDefault.Caption = "Default =" + Str(pageObj.GetDefault())
  lblDescription.Caption = pageObj.GetDescription()
  lblFilename.Caption = pageObj.GetFilename()
  lblOleType.Caption = "OleType =" + Str$(pageObj.GetOleType())
  Set pageObj = Nothing
  Set pagesObj = Nothing
End Sub

Private Sub lvwPBRecip_ItemClick(ByVal Item As ComctlLib.ListItem)
  ' set the "current" user/group ID
  curUserGroupID = arrayOfRecips(Item.Index)
  
  ' set the "current" display name
  If phoneObj.GetType(curUserGroupID) = EVENTTYPE_USER Then
    curDisplayName = phoneObj.GetUserDisplayName(curUserGroupID)
  Else
    curDisplayName = phoneObj.GetGroupDisplayName(curUserGroupID)
  End If
End Sub

Private Sub tabMain_Click(PreviousTab As Integer)
Dim sdkObj As Object
Dim t As Integer
Static gotPB As Boolean
  
  Select Case tabMain.Tab
    Case TAB_SENDOPTIONS:
    Case TAB_RECIPIENTS:
      If lstTypes.ListCount = 0 Then
        For t = 0 To sendObj.GetTypeCount() - 1
          lstTypes.AddItem (Trim$(Str$(t)) + "=" + sendObj.GetType(t))
        Next t
        lstTypes.ListIndex = 0
      End If
    Case TAB_ATTACHMENTS:
      If lstAttachments.ListCount = 0 Then
        ' create the attachments object
        Set attachsObj = CreateObject("WinFax.Attachments")
        ' show the attachments
        showAttachments
      End If
    Case TAB_ATTACHFILES:
    Case TAB_COVERPAGES:
      ' get a list of cover pages if we don't already have one
      If lstCoverPages.ListCount = 0 Then
        showCoverPages
      End If
    Case TAB_ERRORS:
    Case TAB_WINFAX:
      Set winfaxObj = sendObj.Application
      ' get various winfax app information
      If lblFullName.Caption = "" Then
        lblFullName.Caption = winfaxObj.FullName()
        lblWFName.Caption = winfaxObj.Name()
      
        ' get device list
        getDeviceList
      End If
    Case TAB_PHONEBOOK:
  End Select
End Sub

Private Sub ResetSendInfo()
  clearRecipientsList
  
  chkUseCover.Value = 1
  edtCoverText.Text = ""
  edtSubject.Text = "Your SDK App"
  chkPreviewFax.Value = 0
  chkDeleteAfterSend.Value = 0
  chkUsePrefix.Value = 1
  edtBillingCode.Text = ""
  edtKeyWords.Text = ""
  cmbResolution.ListIndex = 1
  cmdRemoveRecipient.Enabled = False
  cmdRemoveAllRecipients.Enabled = False
  lblRecipCount.Caption = "Recipient Count = 0"
End Sub

Private Sub SetSendOptions()
  ' set Preview, Billing & Keywords settings
  sendObj.SetPreviewFax (chkPreviewFax.Value)
  
  sendObj.EnableBillingCodeKeyWords (chkEnableBillingCodeKeyWords.Value)
  If chkEnableBillingCodeKeyWords.Value = 1 Then
     sendObj.SetBillingCode (edtBillingCode.Text)
     sendObj.SetKeywords (edtKeyWords.Text)
  End If
  
  ' set cover page settings
  If chkUseCover.Value = 1 Then
    sendObj.SetUseCover (1)
    
    If chkUseQuickCoverPage.Value = 1 Then
      sendObj.SetQuickCover (1)
    Else
      sendObj.SetQuickCover (0)
      If chkUseFileName.Value = 1 Then
        sendObj.SetCoverFile (lblFilename.Caption)
      Else
        sendObj.SetCoverPage (lstCoverPages.ListIndex + 1)
      End If
    End If
  
    sendObj.SetCoverText (edtCoverText.Text)
  Else
    sendObj.SetUseCover (0)
  End If
  
  ' other settings
  sendObj.SetSubject (edtSubject.Text)
  
  sendObj.SetUseCreditCard (chkUseCreditCardDialing.Value)
  
  sendObj.SetResolution (cmbResolution.ListIndex)
  
  sendObj.SetUsePrefix (chkUsePrefix.Value)
  
  sendObj.SetDeleteAfterSend (chkDeleteAfterSend.Value)

  sendObj.ShowCallProgess (chkShowSendScreen.Value)
End Sub

Sub showCoverPages()
Dim pageObj As Object
Dim t As Integer
  
  Set pagesObj = CreateObject("WinFax.CoverPages")
  lstCoverPages.visible = False
  
  lstCoverPages.Clear
  For t = 1 To pagesObj.Count
    Set pageObj = pagesObj.Item(t)
    lstCoverPages.AddItem pageObj.GetDescription
    lblNumOfCoverPages = "Number Of Cover Pages =" + Str$(t)
    Set pageObj = Nothing
  Next t

  lstCoverPages.visible = True
  Set pagesObj = Nothing
End Sub

Sub showAttachments()
Dim attachObj As Object
Dim t As Integer
Dim attachCount As Integer
  
  lstAttachments.visible = False
  
  lstAttachments.Clear
  attachCount = attachsObj.Count()
  If attachCount <> 0 Then
    For t = 1 To attachCount
      Set attachObj = attachsObj.Item(t)
      lstAttachments.AddItem attachObj.GetDescription()
      lblNumOfAttachments.Caption = "Number Of Attachments =" + Str$(t)
    Next t
  Else
    lblNumOfAttachments.Caption = "Number Of Attachments = 0"
  End If

  lstAttachments.visible = True
End Sub

Sub getDeviceList()
Dim deviceList As String
Dim strLen As Integer
Dim strPos As Integer
Dim divPos As Integer

  ' clear the device listbox
  lstDeviceList.Clear

  ' get the device list string
  deviceList = winfaxObj.getDeviceList()
  
  ' pull out the devices in the string, which are delimited by "|"
  strLen = Len(deviceList)
  pos = 1
  While pos <= strLen
    divPos = InStr(pos, deviceList, "|")
    lstDeviceList.AddItem Mid$(deviceList, pos, divPos - pos)
    pos = divPos + 1
  Wend

  ' highlight the first device
  lstDeviceList.ListIndex = 0
End Sub

Private Sub clearPhoneList()
  While tvwPhoneFolders.Nodes.Count > 0
    tvwPhoneFolders.Nodes.Remove (tvwPhoneFolders.Nodes.Count)
  Wend
End Sub
Private Function prepareFolderState(targetID As String) As Boolean
Dim eID As String
  
  'search the folders for "targetID" and stop when it is found
  eID = phoneObj.GetFolderListFirst(STANDARDFOLDER_WINFAX_ROOT, eID)
  'MsgBox phoneObj.GetFolderDisplayName(eID)
  If LenB(eID) <> 0 Then ' if there is a first folder
    ' if we found a match we are done, else search the rest of the tree
    If eID <> targetID Then
      ' search the remainder of the tree
      prepareFolderState = prepareFolderStateSearch(eID, targetID)
    Else
      ' return success
      prepareFolderState = True
    End If
  Else
    ' return failure
    prepareFolderState = False
  End If
End Function

Private Function prepareFolderStateSearch(firstID, targetID As String) As Boolean
Dim t As Integer
Dim eID As String
Dim folderIDs() As String
Dim folderIndex As Integer
  
  prepareFolderStateSearch = False
  
  ' store away the first folder found so that it can be searched...
  ' ... for sub folders later
  ReDim Preserve folderIDs(1)
  folderIDs(1) = firstID
  folderIndex = 1

  ' search the remainder of the folders
  Do
    eID = phoneObj.GetFolderListNext() ' get the next item in the list
    'MsgBox phoneObj.GetFolderDisplayName(eID)
    
    ' check to see if this is the folder in question
    If eID = targetID Then
      ' found the target folder; stop searching
      prepareFolderStateSearch = True
    ElseIf LenB(eID) <> 0 Then
      ' didn't find target, store this way so it be searched for sub...
      ' ...folders later
      folderIndex = folderIndex + 1
      ReDim Preserve folderIDs(folderIndex)
      folderIDs(folderIndex) = eID
    End If
  Loop Until LenB(eID) = 0 Or prepareFolderStateSearch = True

  ' loop through stored folderIDs if target not yet found
  If prepareFolderStateSearch = False Then
    For t = 1 To folderIndex
      ' is there a sub folder for the folder we are looking at?
      eID = phoneObj.GetFolderListFirst(STANDARDFOLDER_NONE, folderIDs(t))
      'MsgBox phoneObj.GetFolderDisplayName(eID)
      If LenB(eID) <> 0 Then ' if there are sub folders
        ' is this first folder the target?
        If eID = targetID Then
          ' found the target
          prepareFolderStateSearch = True
          Exit For
        Else
          ' first folder isn't the target; lets search it; stop if this call succeeds
          If prepareFolderStateSearch(eID, targetID) Then
            prepareFolderStateSearch = True
            Exit For
          End If
        End If
      End If
    Next t
  End If
End Function

Private Function showAllPbFolders() As Integer
Dim nodeX As Node
Dim eID As String
  
  clearPhoneList
  
  'get the list of phonebooks and folders
  eID = phoneObj.GetFolderListFirst(STANDARDFOLDER_WINFAX_ROOT, eID)
  If LenB(eID) <> 0 Then ' if there is a first folder
    ' show the name of the first folder
    Set nodeX = tvwPhoneFolders.Nodes.Add(, , "p" + Str$(1), phoneObj.GetFolderDisplayName(eID))
    
    ' store the eID in an array of folders keyed to the treeview node index
    ReDim Preserve arrayOfPBFolders(1)
    arrayOfPBFolders(1) = eID
    
    ' get the rest now
    showPbFolders eID, "p"
    
    ' return success
    showAllPbFolders = 1
  Else
    ' return failure
    showAllPbFolders = 0
  End If
End Function
shim
Beiträge: 65
Registriert: 12.09.2004 23:09

Beitrag von shim »

Also wen es interessiert...

folgender Regestry-Eintrag muß bei FritzFax gesetzt werden, damit die Faxnummer bereits im Dialog steht:

HKEY_CURRENT_USER\Software\AVM\Fritz! 2.0\Fax\Rufnummer
(Dieser Eintrag muß allerdings überprüft werden, da er sich sicher mit anderen Fritz!Fax-Versionen ändern wird)

Das funktionierte Prima. Nun bleibt aber das Problem: Wie geht das automatisiert? Soll heißen, wie drücke ich denn nun Return und starte das Fax?

Hier ist mir nichts anders eingefallen, als ein "Return" an Fritz!Fax zu senden (sendkey)... Das geht. Pause nicht vergessen...

Momentan teste ich noch fleißig, vielleicht gibt es noch eine bessere Lösung.

Lars
Kaeru Gaman
Beiträge: 17389
Registriert: 10.11.2004 03:22

Beitrag von Kaeru Gaman »

ho man.

wurdert dich das, das keiner geantwortet hat ?

sorry, aber so ein code-monster postet man nicht, das kann man mailen auf anfrage :wink:
Der Narr denkt er sei ein weiser Mann.
Der Weise weiß, dass er ein Narr ist.
Benutzeravatar
Lars
Beiträge: 347
Registriert: 31.08.2004 23:53
Wohnort: Shanghai
Kontaktdaten:

Beitrag von Lars »

Kaeru Gaman hat geschrieben:sorry, aber so ein code-monster postet man nicht
Doch, den postet man durchaus, damit sich Leute ein Bild verschaffen
könne, was das für ein Code ist. Evtl. interessiert sich dann ja doch noch
jemand dafür, der von sich aus nie in den Emailverkehr eingetreten wäre,
aus Angst, er würde da irgendwelche Bindungen eingehen.

Code Tags könnten aber nicht schaden.
Lars
The only problem with troubleshooting is, that sometimes the trouble shoots back.
P4 2,6Ghz, 512MB RAM, GeForce 6200, WinXP Pro SP2, PB V3.94
shim
Beiträge: 65
Registriert: 12.09.2004 23:09

Beitrag von shim »

Code-Tags hab ich vergessen...

Naja, ich würde jedenfalls NICHT mailen. Außerdem steht alles auf der Winfax-Seite und ist somit frei zugänglich für jedermann.
Der Code war nur als hinweis gedacht, in der Hoffnung einen Visual-Basic-Purebasic-Programmierer könnte damit etwas anfangen.

Schade aber Egal. Mein Problem ist gelöst.

Viele Grüße

Lars
Benutzeravatar
bluejoke
Beiträge: 1244
Registriert: 08.09.2004 16:33
Kontaktdaten:

Beitrag von bluejoke »

Es wäre ganz nett, wenn du die Lösung posten würdest.

Im übrigen muss ich mich Kaeru Gaman anschließen, aber ich würde es auch nicht mailen, sondern wenn möglich einen direkt-Link zu der Quelle schreiben.
shim
Beiträge: 65
Registriert: 12.09.2004 23:09

Beitrag von shim »

Ist mir etwas entgangen, oder habe ich die Lösung nicht oben gepostet... Oder ist meine Antwort nicht lesbar für andere? :o

Also nochmal:

Registry Eintrag vornehmen (s.o.). Damit wird die Faxnummer im Fritz!Fax-Dialog eingetragen... Leider nicht mehr. Anschließend muß der Dialog noch mit einem "RETURN" beglückt werden.
Das erledigt die sendkey-Funktion, die eine "Return" an das Fritz!fax-Fenster schickt und so die Taste "OK" simuliert.

Wichtig: Nach dem Druckvorgang unbedingt etwas warten (DELAY(2000)), damit sich der Dialog aufbaut und das RETURN im richtigen Fenster landet.

Hab ich etwas vergessen? Glaube nicht.

Kurze F.A.Q.:
Wie mache ich einen Registry-Eintrag?
Da hab ich die Lib benutzt, die Andre im Code-Archiv bereitstellt. Kann man ganz leicht finden und kann sogar von mir verstanden werden.

Warum Fritz!Fax?
Weil das damit am einfachsten geht. Empfangen erledigt für mich ohnehin Winfax 10.

Wie drucke ich auf einen bestimmten Drucker aus?
Hierzu gibt es in vielen Foren einiges, was einen nicht wirklich weiterbringt. Anscheinend ist der Ausdruck nicht wirklich beliebt. Und wenn man den elenden PrintRequester nicht haben möchte, steht man sehr auf dem Schlauch... Ich drucke AUSSCHLIEßLICH PDF-Dateien und nutze die DLL von Sedtech.com.

So, das war's. Vielleicht gibt es ja doch noch jemanden, der das eleganter hinbekommt. Sendkey ist nämlich die denkbar schlechteste Lösung.

Gruß

Lars
Zuletzt geändert von shim am 23.11.2004 19:45, insgesamt 1-mal geändert.
Benutzeravatar
NicTheQuick
Ein Admin
Beiträge: 8679
Registriert: 29.08.2004 20:20
Computerausstattung: Ryzen 7 5800X, 32 GB DDR4-3200
Ubuntu 22.04.3 LTS
GeForce RTX 3080 Ti
Wohnort: Saarbrücken
Kontaktdaten:

Beitrag von NicTheQuick »

Der Code ist zu lang. Das gesamte erste Posting hat mehr als 64 kB gehabt. Ich habe ihn jetzt etwas kürzen müssen, damit die Code-Tags noch reingepasst hatten. Noch nicht einmal ein Edit hat da drunter gepasst. LOL :lol:
Bild
shim
Beiträge: 65
Registriert: 12.09.2004 23:09

Beitrag von shim »

Hui! :-)

Wenn ich ganz ehrlich bin, war ich mir der Länge nicht bewußt :oops: und mir war gänzlich unklar, das es Leute gibt, die den Code versuchen hier im Board zu verstehen und zu lesen...

Meine Wenigkeit kopiert sich sowas immer in einen Editor...

Na egal, andere Menschen, andere Sitten... ;-)

Danke für die CODE-Tags... Sieht ja jetzt richtig ordentlich aus der Code...

Bis dahin,

Lars
Antworten