home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form PrntForm
- Caption = "Print and Queue Services Test"
- Height = 6450
- Left = 2355
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 6045
- ScaleWidth = 6765
- Top = 765
- Width = 6885
- Begin CommandButton OKButton
- Caption = "&OK"
- Height = 375
- Left = 2880
- TabIndex = 16
- Top = 5520
- Width = 810
- End
- Begin Label banner
- Height = 255
- Left = 2040
- TabIndex = 48
- Top = 2160
- Width = 1575
- End
- Begin Label Label22
- Alignment = 1 'Right Justify
- Caption = "User name for banner page:"
- Height = 495
- Left = 600
- TabIndex = 47
- Top = 1920
- Width = 1335
- End
- Begin Label printJobNum
- Height = 195
- Left = 5400
- TabIndex = 46
- Top = 5160
- Width = 630
- End
- Begin Label Label21
- Alignment = 1 'Right Justify
- Caption = "Print job number:"
- Height = 255
- Left = 3480
- TabIndex = 45
- Top = 5160
- Width = 1815
- End
- Begin Label printQueueID
- Height = 255
- Left = 2040
- TabIndex = 44
- Top = 5160
- Width = 1215
- End
- Begin Label Label20
- Alignment = 1 'Right Justify
- Caption = "Print queue ID:"
- Height = 255
- Left = 480
- TabIndex = 43
- Top = 5160
- Width = 1455
- End
- Begin Label jobValid
- Height = 195
- Left = 5400
- TabIndex = 42
- Top = 4920
- Width = 630
- End
- Begin Label Label19
- Alignment = 1 'Right Justify
- Caption = "Capture file open:"
- Height = 255
- Left = 3480
- TabIndex = 41
- Top = 4920
- Width = 1815
- End
- Begin Label inQueue
- Height = 255
- Left = 2040
- TabIndex = 40
- Top = 4920
- Width = 735
- End
- Begin Label Label18
- Alignment = 1 'Right Justify
- Caption = "Print job in queue:"
- Height = 255
- Left = 240
- TabIndex = 39
- Top = 4920
- Width = 1695
- End
- Begin Label serverConnID
- Height = 255
- Left = 2040
- TabIndex = 36
- Top = 4560
- Width = 735
- End
- Begin Label Label16
- Alignment = 1 'Right Justify
- Caption = "Connection ID of queueing server:"
- Height = 495
- Left = 240
- TabIndex = 35
- Top = 4440
- Width = 1695
- End
- Begin Label inProgress
- Height = 195
- Left = 5400
- TabIndex = 38
- Top = 4560
- Width = 630
- End
- Begin Label Label17
- Alignment = 1 'Right Justify
- Caption = "Capture in progress:"
- Height = 255
- Left = 3480
- TabIndex = 37
- Top = 4560
- Width = 1815
- End
- Begin Label fileCapture
- Height = 255
- Left = 2040
- TabIndex = 32
- Top = 4200
- Width = 735
- End
- Begin Label Label14
- Alignment = 1 'Right Justify
- Caption = "Capturing to file:"
- Height = 255
- Left = 480
- TabIndex = 31
- Top = 4200
- Width = 1455
- End
- Begin Label timingOut
- Height = 195
- Left = 5400
- TabIndex = 34
- Top = 4200
- Width = 630
- End
- Begin Label Label15
- Alignment = 1 'Right Justify
- Caption = "Timing out:"
- Height = 255
- Left = 4320
- TabIndex = 33
- Top = 4200
- Width = 975
- End
- Begin Label frmName
- Height = 255
- Left = 2040
- TabIndex = 28
- Top = 3960
- Width = 1095
- End
- Begin Label Label12
- Alignment = 1 'Right Justify
- Caption = "Form name:"
- Height = 255
- Left = 480
- TabIndex = 27
- Top = 3960
- Width = 1455
- End
- Begin Label captureFlag
- Height = 195
- Left = 5400
- TabIndex = 30
- Top = 3960
- Width = 615
- End
- Begin Label Label13
- Alignment = 1 'Right Justify
- Caption = "Currently captured:"
- Height = 255
- Left = 3480
- TabIndex = 29
- Top = 3960
- Width = 1815
- End
- Begin Label maxChars
- Height = 195
- Left = 5400
- TabIndex = 26
- Top = 3720
- Width = 630
- End
- Begin Label Label11
- Alignment = 1 'Right Justify
- Caption = "Maximum characters per line:"
- Height = 375
- Left = 3480
- TabIndex = 25
- Top = 3480
- Width = 1815
- End
- Begin Label maxLines
- Height = 255
- Left = 2040
- TabIndex = 24
- Top = 3600
- Width = 735
- End
- Begin Label Label10
- Alignment = 1 'Right Justify
- Caption = "Max lines per page:"
- Height = 255
- Left = 240
- TabIndex = 23
- Top = 3600
- Width = 1695
- End
- Begin Label lptDevice
- Height = 195
- Left = 5400
- TabIndex = 18
- Top = 3120
- Width = 630
- End
- Begin Label Label7
- Alignment = 1 'Right Justify
- Caption = "Local LPT device #:"
- Height = 255
- Left = 3480
- TabIndex = 17
- Top = 3120
- Width = 1815
- End
- Begin Label formType
- Height = 255
- Left = 2040
- TabIndex = 13
- Top = 3360
- Width = 735
- End
- Begin Label Label5
- Alignment = 1 'Right Justify
- Caption = "Form type:"
- Height = 255
- Left = 600
- TabIndex = 12
- Top = 3360
- Width = 1335
- End
- Begin Label Label9
- Alignment = 1 'Right Justify
- Caption = "Flush capture on device close:"
- Height = 495
- Left = 240
- TabIndex = 21
- Top = 2880
- Width = 1695
- End
- Begin Label timeoutCount
- Height = 195
- Left = 5400
- TabIndex = 20
- Top = 2880
- Width = 630
- End
- Begin Label Label8
- Alignment = 1 'Right Justify
- Caption = "Flush capture timeout count (ticks):"
- Height = 495
- Left = 3360
- TabIndex = 19
- Top = 2640
- Width = 1935
- End
- Begin Label deviceClose
- Height = 255
- Left = 2040
- TabIndex = 22
- Top = 3120
- Width = 735
- End
- Begin Label bannerText
- Height = 195
- Left = 5400
- TabIndex = 15
- Top = 2400
- Width = 1215
- End
- Begin Label Label6
- Alignment = 1 'Right Justify
- Caption = "Banner text:"
- Height = 255
- Left = 4080
- TabIndex = 14
- Top = 2400
- Width = 1215
- End
- Begin Label numCopies
- Height = 255
- Left = 2040
- TabIndex = 11
- Top = 2640
- Width = 735
- End
- Begin Label Label4
- Alignment = 1 'Right Justify
- Caption = "Number of copies:"
- Height = 255
- Left = 360
- TabIndex = 10
- Top = 2640
- Width = 1575
- End
- Begin Label serverPrinter
- Height = 195
- Left = 5400
- TabIndex = 9
- Top = 2160
- Width = 765
- End
- Begin Label Label3
- Alignment = 1 'Right Justify
- Caption = "Server printer number:"
- Height = 375
- Left = 4080
- TabIndex = 8
- Top = 1920
- Width = 1215
- End
- Begin Label tabSize
- Height = 255
- Left = 2040
- TabIndex = 7
- Top = 2400
- Width = 735
- End
- Begin Label Label2
- Alignment = 1 'Right Justify
- Caption = "Tab size:"
- Height = 255
- Left = 1080
- TabIndex = 6
- Top = 2400
- Width = 855
- End
- Begin Label flags4
- Height = 255
- Left = 1080
- TabIndex = 4
- Top = 1320
- Width = 4695
- End
- Begin Label flags3
- Height = 255
- Left = 1080
- TabIndex = 3
- Top = 1080
- Width = 4695
- End
- Begin Label flags2
- Height = 255
- Left = 1080
- TabIndex = 2
- Top = 825
- Width = 4695
- End
- Begin Label flags1
- Height = 255
- Left = 1080
- TabIndex = 1
- Top = 600
- Width = 4695
- End
- Begin Label Label1
- Caption = "Print job flags:"
- Height = 255
- Left = 600
- TabIndex = 5
- Top = 360
- Width = 1335
- End
- Begin Label LPTNumLabel
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 3375
- End
- Sub Form_Load ()
- Dim flags As CAPTURE_FLAGS
- ccode% = GetLPTCaptureStatus(connID%)
- If (ccode% <> CAPTURE_IS_ACTIVE) Then
- LPTNumLabel.Caption = "Default LPT device is not captured"
- Else
- SetPreferredConnectionID (connID%)
- localLPT% = GetDefaultLocalPrinter()
- bannerName$ = String$(48, 0)
- ccode% = GetBannerUserName(bannerName$)
- If (ccode% = SUCCESSFUL) Then
- bannerName$ = Left$(bannerName$, InStr(bannerName$, Chr$(0)) - 1)
- banner.Caption = bannerName$
- End If
- LPTNumLabel.Caption = "Status of LPT" + Str$(localLPT% + 1)
- ccode% = GetSpecificCaptureFlags(localLPT%, flags)
- If (ccode% <> SUCCESSFUL) Then
- MsgBox "Unable to get capture flags for LPT" + Format$(defaultLPT%), MB_OK, "Error"
- Else
- If (Asc(flags.flags) And 4) Then
- flags1.Caption = "Release print job if connection lost"
- Else
- flags1.Caption = "Do not release print job if connection lost"
- End If
- If (Asc(flags.flags) And 8) Then
- flags2.Caption = "Suppress form feed at end of job"
- Else
- flags2.Caption = "Do not suppress form feed at end of job"
- End If
- If (Asc(flags.flags) And 64) Then
- flags3.Caption = "Print service will interpret printer control sequences"
- Else
- flags3.Caption = "Print service will not interpret printer control sequences"
- End If
- If (Asc(flags.flags) And 128) Then
- flags4.Caption = "Print banner page"
- Else
- flags4.Caption = "Do not print banner page"
- End If
- tabSize.Caption = Str$(Asc(flags.tabSize))
- serverPrinter.Caption = Str$(Asc(flags.serverPrinter))
- numCopies.Caption = Str$(Asc(flags.numberOfCopies))
- formType.Caption = Str$(Asc(flags.formType))
- bannerText.Caption = flags.bannerText
- lptDevice.Caption = Str$(Asc(flags.localLPTDevice))
- timeoutCount.Caption = Str$(flags.flushCaptureTimeoutCount)
- If (Asc(flags.flushCaptureOnDeviceClose) = 0) Then
- deviceClose.Caption = "Enabled"
- Else
- deviceClose.Caption = "Disabled"
- End If
- maxLines.Caption = Str$(flags.maxLines)
- maxChars.Caption = Str$(flags.maxChars)
- frmName.Caption = flags.formName
- If (Asc(flags.LPTCaptureFlag) = 0) Then
- captureFlag.Caption = "No"
- Else
- captureFlag.Caption = "Yes"
- End If
- If (Asc(flags.fileCaptureFlag) = 0) Then
- fileCapture.Caption = "No"
- Else
- fileCapture.Caption = "Yes"
- End If
- If (Asc(flags.timingOutFlag) = 0) Then
- timingOut.Caption = "No"
- Else
- timingOut.Caption = "Yes"
- End If
- serverConnID.Caption = Str$(Asc(flags.connectionIDQueuePrintJob))
- If (Asc(flags.captureInProgress) = 0) Then
- inProgress.Caption = "No"
- Else
- inProgress.Caption = "Yes"
- End If
- If (Asc(flags.printQueueFlag) = 255) Then
- inQueue.Caption = "Yes"
- Else
- inQueue.Caption = "No"
- End If
- If (Asc(flags.printJobValid) = 0) Then
- jobValid.Caption = "No"
- Else
- jobValid.Caption = "Yes"
- End If
- If (Asc(flags.printQueueFlag) = 255) Then
- printQueueID.Caption = Hex$(flags.printQueueID)
- Else
- printQueueID.Caption = ""
- End If
- printJobNum.Caption = Str$(flags.printJobNumber)
- End If
- End If
- End Sub
- Sub Form_Unload (Cancel As Integer)
- SetPreferredConnectionID (originalPrefConnID%)
- End Sub
- Sub OKButton_Click ()
- Unload PrntForm
- End Sub
-