VERSION 5.00 Begin VB.Form Form1 Caption = "Print Wizard DLL Tester" ClientHeight = 5310 ClientLeft = 60 ClientTop = 450 ClientWidth = 9285 LinkTopic = "Form1" ScaleHeight = 5310 ScaleWidth = 9285 StartUpPosition = 3 'Windows Default Begin VB.CommandButton SetOverlay Caption = "Set" Height = 375 Left = 4560 TabIndex = 23 Top = 4800 Width = 735 End Begin VB.TextBox overlay Height = 375 Left = 120 TabIndex = 22 Top = 4800 Width = 4215 End Begin VB.CommandButton SetFont Caption = "Set" Height = 375 Left = 4560 TabIndex = 20 Top = 3960 Width = 735 End Begin VB.TextBox fonts Height = 375 Left = 120 TabIndex = 19 Top = 3960 Width = 4215 End Begin VB.Frame Frame2 Caption = "Orientation" Height = 1095 Left = 5760 TabIndex = 14 Top = 720 Width = 3255 Begin VB.OptionButton Automatic Caption = "Automatic" Height = 255 Left = 360 TabIndex = 17 Top = 720 Width = 2775 End Begin VB.OptionButton Landscape Caption = "Landscape" Height = 255 Left = 360 TabIndex = 16 Top = 480 Width = 2415 End Begin VB.OptionButton Portrait Caption = "Portrait" Height = 255 Left = 360 TabIndex = 15 Top = 240 Value = -1 'True Width = 2295 End End Begin VB.CheckBox Check1 Caption = "Preview" Height = 375 Left = 5760 TabIndex = 12 Top = 240 Width = 2295 End Begin VB.Frame Frame1 Caption = "Output type" Height = 1815 Left = 120 TabIndex = 8 Top = 840 Width = 3975 Begin VB.TextBox faxnum Height = 375 Left = 960 TabIndex = 13 Top = 1200 Width = 2775 End Begin VB.OptionButton Option2 Caption = "Fax to:" Height = 375 Left = 480 TabIndex = 11 Top = 840 Width = 1215 End Begin VB.OptionButton Option1 Caption = "PDF" Height = 255 Left = 480 TabIndex = 10 Top = 600 Width = 1095 End Begin VB.OptionButton Printer Caption = "Printer" Height = 255 Left = 480 TabIndex = 9 Top = 360 Value = -1 'True Width = 1335 End End Begin VB.CommandButton Command4 Caption = "Print this file" Height = 375 Left = 6840 TabIndex = 7 Top = 4440 Width = 2175 End Begin VB.TextBox Text3 Height = 375 Left = 5760 TabIndex = 6 Text = "http://www.anzio.com/pub/printwiz-samples/features.txt" Top = 3960 Width = 3255 End Begin VB.TextBox Text2 Height = 1215 Left = 5760 MultiLine = -1 'True TabIndex = 5 Text = "TestDll1.frx":0000 Top = 1920 Width = 3255 End Begin VB.CommandButton Command3 Caption = "Set" Height = 375 Left = 4560 TabIndex = 4 Top = 3120 Width = 735 End Begin VB.TextBox Text1 Height = 375 Left = 120 TabIndex = 2 Top = 3120 Width = 4215 End Begin VB.CommandButton Command2 Caption = "Printer Setup" Height = 495 Left = 120 TabIndex = 1 Top = 120 Width = 2055 End Begin VB.CommandButton Command1 Caption = "Print this text" Height = 495 Left = 6840 TabIndex = 0 Top = 3240 Width = 2175 End Begin VB.Label Label3 Caption = "Overlay" Height = 255 Left = 120 TabIndex = 21 Top = 4440 Width = 2655 End Begin VB.Label Label2 Caption = "Font(s) to use" Height = 255 Left = 120 TabIndex = 18 Top = 3600 Width = 3015 End Begin VB.Label Label1 Caption = "Printer Name" Height = 255 Left = 120 TabIndex = 3 Top = 2760 Width = 3735 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Declare Function pw_configure_printer Lib "pwdll" (ByVal window As Integer) _ As Long 'returns 1 if successful, else 0 Private Declare Sub pw_set_printer Lib "pwdll" (ByVal lpchar As String) 'set printer by name Private Declare Function pw_print_text Lib "pwdll" (ByVal lpchar As String, _ ByVal count As Long, ByVal cs As Long) As Long 'returns 1 if successful, else 0 'cs is 0 for ISO ' 1 for OEM ' 2 for other (no translation) ' 3 for Unicode UTF-8' ''WIDE VERSION ### Private Declare Sub pw_flush Lib "pwdll" () 'terminates print job Private Declare Sub pw_set_html_base Lib "pwdll" (ByVal lpchar As String) 'sets the html_base for relative filenames Private Declare Sub pw_set_preview Lib "pwdll" (ByVal b As Long) 'b is 1 for preview on ' 0 for preview off Private Declare Sub pw_set_orientation Lib "pwdll" (ByVal b As Long) 'b is 0 for portrait ' 1 for landscape ' 2 for auto Private Declare Sub pw_set_font Lib "pwdll" (ByVal lpchar As String) 'specify font name(s) Private Declare Sub pw_set_overlay Lib "pwdll" (ByVal lpchar As String) 'specify name of overlay Private Declare Sub pw_set_copies Lib "pwdll" (ByVal n As Long) 'set number of copies Private Declare Sub pw_eject_page Lib "pwdll" () 'equivalent to printing a formfeed Private Declare Function pw_set_output Lib "pwdll" (ByVal lpchar As String, _ ByVal count As Long) As Integer 'returns 1 if successful, else 0 'sets type of output ' empty string for printing ' PDF:// Generate PDF file with default name ' PDF:// Generate PDF file with given name ' FAX32:// Send fax Private Declare Function pw_print_file Lib "pwdll" (ByVal lpchar As String, _ ByVal count As Long, _ ByVal cs As Long) As Integer 'prints an entire file 'returns 1 if successful 'cs is charset as above Private Sub Automatic_Click() pw_set_orientation (2) End Sub Private Sub Check1_Click() If Check1.Value Then pw_set_preview (1) Else pw_set_preview (0) End If End Sub Private Sub Command1_Click() ct = Len(Text2.Text) res = pw_print_text(Text2.Text, ct, 0) If res <> 0 Then pw_flush End If If res = 0 Then MsgBox ("Function failed") End If End Sub Private Sub Command2_Click() res = pw_configure_printer(TestDll1) End Sub Private Sub Command4_Click() ct = Len(Text3.Text) res = pw_print_file(Text3.Text, ct, 0) If res = 0 Then MsgBox ("Function failed") End If End Sub Private Sub Landscape_Click() pw_set_orientation (1) End Sub Private Sub Option1_Click() res = pw_set_output("PDF://", 6) End Sub Private Sub Option2_Click() s = "FAX32://" & faxnum.Text res = pw_set_output(s, Len(s)) End Sub Private Sub Portrait_Click() pw_set_orientation (0) End Sub Private Sub Printer_Click() res = pw_set_output("", 0) End Sub Private Sub SetFont_Click() s = fonts.Text pw_set_font (s) End Sub Private Sub SetOverlay_Click() pw_set_overlay (overlay.Text) End Sub