home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nivb / print.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-07  |  15.7 KB  |  503 lines

  1. VERSION 2.00
  2. Begin Form PrntForm 
  3.    Caption         =   "Print and Queue Services Test"
  4.    ClientHeight    =   6045
  5.    ClientLeft      =   2415
  6.    ClientTop       =   1110
  7.    ClientWidth     =   6765
  8.    Height          =   6450
  9.    Left            =   2355
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   6045
  13.    ScaleWidth      =   6765
  14.    Top             =   765
  15.    Width           =   6885
  16.    Begin CommandButton OKButton 
  17.       Caption         =   "&OK"
  18.       Height          =   375
  19.       Left            =   2880
  20.       TabIndex        =   16
  21.       Top             =   5520
  22.       Width           =   810
  23.    End
  24.    Begin Label banner 
  25.       Height          =   255
  26.       Left            =   2040
  27.       TabIndex        =   48
  28.       Top             =   2160
  29.       Width           =   1575
  30.    End
  31.    Begin Label Label22 
  32.       Alignment       =   1  'Right Justify
  33.       Caption         =   "User name for banner page:"
  34.       Height          =   495
  35.       Left            =   600
  36.       TabIndex        =   47
  37.       Top             =   1920
  38.       Width           =   1335
  39.    End
  40.    Begin Label printJobNum 
  41.       Height          =   195
  42.       Left            =   5400
  43.       TabIndex        =   46
  44.       Top             =   5160
  45.       Width           =   630
  46.    End
  47.    Begin Label Label21 
  48.       Alignment       =   1  'Right Justify
  49.       Caption         =   "Print job number:"
  50.       Height          =   255
  51.       Left            =   3480
  52.       TabIndex        =   45
  53.       Top             =   5160
  54.       Width           =   1815
  55.    End
  56.    Begin Label printQueueID 
  57.       Height          =   255
  58.       Left            =   2040
  59.       TabIndex        =   44
  60.       Top             =   5160
  61.       Width           =   1215
  62.    End
  63.    Begin Label Label20 
  64.       Alignment       =   1  'Right Justify
  65.       Caption         =   "Print queue ID:"
  66.       Height          =   255
  67.       Left            =   480
  68.       TabIndex        =   43
  69.       Top             =   5160
  70.       Width           =   1455
  71.    End
  72.    Begin Label jobValid 
  73.       Height          =   195
  74.       Left            =   5400
  75.       TabIndex        =   42
  76.       Top             =   4920
  77.       Width           =   630
  78.    End
  79.    Begin Label Label19 
  80.       Alignment       =   1  'Right Justify
  81.       Caption         =   "Capture file open:"
  82.       Height          =   255
  83.       Left            =   3480
  84.       TabIndex        =   41
  85.       Top             =   4920
  86.       Width           =   1815
  87.    End
  88.    Begin Label inQueue 
  89.       Height          =   255
  90.       Left            =   2040
  91.       TabIndex        =   40
  92.       Top             =   4920
  93.       Width           =   735
  94.    End
  95.    Begin Label Label18 
  96.       Alignment       =   1  'Right Justify
  97.       Caption         =   "Print job in queue:"
  98.       Height          =   255
  99.       Left            =   240
  100.       TabIndex        =   39
  101.       Top             =   4920
  102.       Width           =   1695
  103.    End
  104.    Begin Label serverConnID 
  105.       Height          =   255
  106.       Left            =   2040
  107.       TabIndex        =   36
  108.       Top             =   4560
  109.       Width           =   735
  110.    End
  111.    Begin Label Label16 
  112.       Alignment       =   1  'Right Justify
  113.       Caption         =   "Connection ID of queueing server:"
  114.       Height          =   495
  115.       Left            =   240
  116.       TabIndex        =   35
  117.       Top             =   4440
  118.       Width           =   1695
  119.    End
  120.    Begin Label inProgress 
  121.       Height          =   195
  122.       Left            =   5400
  123.       TabIndex        =   38
  124.       Top             =   4560
  125.       Width           =   630
  126.    End
  127.    Begin Label Label17 
  128.       Alignment       =   1  'Right Justify
  129.       Caption         =   "Capture in progress:"
  130.       Height          =   255
  131.       Left            =   3480
  132.       TabIndex        =   37
  133.       Top             =   4560
  134.       Width           =   1815
  135.    End
  136.    Begin Label fileCapture 
  137.       Height          =   255
  138.       Left            =   2040
  139.       TabIndex        =   32
  140.       Top             =   4200
  141.       Width           =   735
  142.    End
  143.    Begin Label Label14 
  144.       Alignment       =   1  'Right Justify
  145.       Caption         =   "Capturing to file:"
  146.       Height          =   255
  147.       Left            =   480
  148.       TabIndex        =   31
  149.       Top             =   4200
  150.       Width           =   1455
  151.    End
  152.    Begin Label timingOut 
  153.       Height          =   195
  154.       Left            =   5400
  155.       TabIndex        =   34
  156.       Top             =   4200
  157.       Width           =   630
  158.    End
  159.    Begin Label Label15 
  160.       Alignment       =   1  'Right Justify
  161.       Caption         =   "Timing out:"
  162.       Height          =   255
  163.       Left            =   4320
  164.       TabIndex        =   33
  165.       Top             =   4200
  166.       Width           =   975
  167.    End
  168.    Begin Label frmName 
  169.       Height          =   255
  170.       Left            =   2040
  171.       TabIndex        =   28
  172.       Top             =   3960
  173.       Width           =   1095
  174.    End
  175.    Begin Label Label12 
  176.       Alignment       =   1  'Right Justify
  177.       Caption         =   "Form name:"
  178.       Height          =   255
  179.       Left            =   480
  180.       TabIndex        =   27
  181.       Top             =   3960
  182.       Width           =   1455
  183.    End
  184.    Begin Label captureFlag 
  185.       Height          =   195
  186.       Left            =   5400
  187.       TabIndex        =   30
  188.       Top             =   3960
  189.       Width           =   615
  190.    End
  191.    Begin Label Label13 
  192.       Alignment       =   1  'Right Justify
  193.       Caption         =   "Currently captured:"
  194.       Height          =   255
  195.       Left            =   3480
  196.       TabIndex        =   29
  197.       Top             =   3960
  198.       Width           =   1815
  199.    End
  200.    Begin Label maxChars 
  201.       Height          =   195
  202.       Left            =   5400
  203.       TabIndex        =   26
  204.       Top             =   3720
  205.       Width           =   630
  206.    End
  207.    Begin Label Label11 
  208.       Alignment       =   1  'Right Justify
  209.       Caption         =   "Maximum characters per line:"
  210.       Height          =   375
  211.       Left            =   3480
  212.       TabIndex        =   25
  213.       Top             =   3480
  214.       Width           =   1815
  215.    End
  216.    Begin Label maxLines 
  217.       Height          =   255
  218.       Left            =   2040
  219.       TabIndex        =   24
  220.       Top             =   3600
  221.       Width           =   735
  222.    End
  223.    Begin Label Label10 
  224.       Alignment       =   1  'Right Justify
  225.       Caption         =   "Max lines per page:"
  226.       Height          =   255
  227.       Left            =   240
  228.       TabIndex        =   23
  229.       Top             =   3600
  230.       Width           =   1695
  231.    End
  232.    Begin Label lptDevice 
  233.       Height          =   195
  234.       Left            =   5400
  235.       TabIndex        =   18
  236.       Top             =   3120
  237.       Width           =   630
  238.    End
  239.    Begin Label Label7 
  240.       Alignment       =   1  'Right Justify
  241.       Caption         =   "Local LPT device #:"
  242.       Height          =   255
  243.       Left            =   3480
  244.       TabIndex        =   17
  245.       Top             =   3120
  246.       Width           =   1815
  247.    End
  248.    Begin Label formType 
  249.       Height          =   255
  250.       Left            =   2040
  251.       TabIndex        =   13
  252.       Top             =   3360
  253.       Width           =   735
  254.    End
  255.    Begin Label Label5 
  256.       Alignment       =   1  'Right Justify
  257.       Caption         =   "Form type:"
  258.       Height          =   255
  259.       Left            =   600
  260.       TabIndex        =   12
  261.       Top             =   3360
  262.       Width           =   1335
  263.    End
  264.    Begin Label Label9 
  265.       Alignment       =   1  'Right Justify
  266.       Caption         =   "Flush capture on device close:"
  267.       Height          =   495
  268.       Left            =   240
  269.       TabIndex        =   21
  270.       Top             =   2880
  271.       Width           =   1695
  272.    End
  273.    Begin Label timeoutCount 
  274.       Height          =   195
  275.       Left            =   5400
  276.       TabIndex        =   20
  277.       Top             =   2880
  278.       Width           =   630
  279.    End
  280.    Begin Label Label8 
  281.       Alignment       =   1  'Right Justify
  282.       Caption         =   "Flush capture timeout count (ticks):"
  283.       Height          =   495
  284.       Left            =   3360
  285.       TabIndex        =   19
  286.       Top             =   2640
  287.       Width           =   1935
  288.    End
  289.    Begin Label deviceClose 
  290.       Height          =   255
  291.       Left            =   2040
  292.       TabIndex        =   22
  293.       Top             =   3120
  294.       Width           =   735
  295.    End
  296.    Begin Label bannerText 
  297.       Height          =   195
  298.       Left            =   5400
  299.       TabIndex        =   15
  300.       Top             =   2400
  301.       Width           =   1215
  302.    End
  303.    Begin Label Label6 
  304.       Alignment       =   1  'Right Justify
  305.       Caption         =   "Banner text:"
  306.       Height          =   255
  307.       Left            =   4080
  308.       TabIndex        =   14
  309.       Top             =   2400
  310.       Width           =   1215
  311.    End
  312.    Begin Label numCopies 
  313.       Height          =   255
  314.       Left            =   2040
  315.       TabIndex        =   11
  316.       Top             =   2640
  317.       Width           =   735
  318.    End
  319.    Begin Label Label4 
  320.       Alignment       =   1  'Right Justify
  321.       Caption         =   "Number of copies:"
  322.       Height          =   255
  323.       Left            =   360
  324.       TabIndex        =   10
  325.       Top             =   2640
  326.       Width           =   1575
  327.    End
  328.    Begin Label serverPrinter 
  329.       Height          =   195
  330.       Left            =   5400
  331.       TabIndex        =   9
  332.       Top             =   2160
  333.       Width           =   765
  334.    End
  335.    Begin Label Label3 
  336.       Alignment       =   1  'Right Justify
  337.       Caption         =   "Server printer number:"
  338.       Height          =   375
  339.       Left            =   4080
  340.       TabIndex        =   8
  341.       Top             =   1920
  342.       Width           =   1215
  343.    End
  344.    Begin Label tabSize 
  345.       Height          =   255
  346.       Left            =   2040
  347.       TabIndex        =   7
  348.       Top             =   2400
  349.       Width           =   735
  350.    End
  351.    Begin Label Label2 
  352.       Alignment       =   1  'Right Justify
  353.       Caption         =   "Tab size:"
  354.       Height          =   255
  355.       Left            =   1080
  356.       TabIndex        =   6
  357.       Top             =   2400
  358.       Width           =   855
  359.    End
  360.    Begin Label flags4 
  361.       Height          =   255
  362.       Left            =   1080
  363.       TabIndex        =   4
  364.       Top             =   1320
  365.       Width           =   4695
  366.    End
  367.    Begin Label flags3 
  368.       Height          =   255
  369.       Left            =   1080
  370.       TabIndex        =   3
  371.       Top             =   1080
  372.       Width           =   4695
  373.    End
  374.    Begin Label flags2 
  375.       Height          =   255
  376.       Left            =   1080
  377.       TabIndex        =   2
  378.       Top             =   825
  379.       Width           =   4695
  380.    End
  381.    Begin Label flags1 
  382.       Height          =   255
  383.       Left            =   1080
  384.       TabIndex        =   1
  385.       Top             =   600
  386.       Width           =   4695
  387.    End
  388.    Begin Label Label1 
  389.       Caption         =   "Print job flags:"
  390.       Height          =   255
  391.       Left            =   600
  392.       TabIndex        =   5
  393.       Top             =   360
  394.       Width           =   1335
  395.    End
  396.    Begin Label LPTNumLabel 
  397.       Height          =   255
  398.       Left            =   120
  399.       TabIndex        =   0
  400.       Top             =   120
  401.       Width           =   3375
  402.    End
  403. Sub Form_Unload (Cancel As Integer)
  404.     SetPreferredConnectionID (originalPrefConnID%)
  405. End Sub
  406. Sub OKButton_Click ()
  407.     Unload PrntForm
  408. End Sub
  409. Sub Form_Load ()
  410.     Dim flags As CAPTURE_FLAGS
  411.     ccode% = GetLPTCaptureStatus(connID%)
  412.     If (ccode% <> CAPTURE_IS_ACTIVE) Then
  413.         LPTNumLabel.Caption = "Default LPT device is not captured"
  414.     Else
  415.         SetPreferredConnectionID (connID%)
  416.         localLPT% = GetDefaultLocalPrinter()
  417.         bannerName$ = String$(48, 0)
  418.         ccode% = GetBannerUserName(bannerName$)
  419.         If (ccode% = SUCCESSFUL) Then
  420.             bannerName$ = Left$(bannerName$, InStr(bannerName$, Chr$(0)) - 1)
  421.             banner.Caption = bannerName$
  422.         End If
  423.         LPTNumLabel.Caption = "Status of LPT" + Str$(localLPT% + 1)
  424.         ccode% = GetSpecificCaptureFlags(localLPT%, flags)
  425.         If (ccode% <> SUCCESSFUL) Then
  426.             MsgBox "Unable to get capture flags for LPT" + Format$(defaultLPT%), MB_OK, "Error"
  427.         Else
  428.             If (Asc(flags.flags) And 4) Then
  429.                 flags1.Caption = "Release print job if connection lost"
  430.             Else
  431.                 flags1.Caption = "Do not release print job if connection lost"
  432.             End If
  433.             If (Asc(flags.flags) And 8) Then
  434.                 flags2.Caption = "Suppress form feed at end of job"
  435.             Else
  436.                 flags2.Caption = "Do not suppress form feed at end of job"
  437.             End If
  438.             If (Asc(flags.flags) And 64) Then
  439.                 flags3.Caption = "Print service will interpret printer control sequences"
  440.             Else
  441.                 flags3.Caption = "Print service will not interpret printer control sequences"
  442.             End If
  443.             If (Asc(flags.flags) And 128) Then
  444.                 flags4.Caption = "Print banner page"
  445.             Else
  446.                 flags4.Caption = "Do not print banner page"
  447.             End If
  448.             tabSize.Caption = Str$(Asc(flags.tabSize))
  449.             serverPrinter.Caption = Str$(Asc(flags.serverPrinter))
  450.             numCopies.Caption = Str$(Asc(flags.numberOfCopies))
  451.             formType.Caption = Str$(Asc(flags.formType))
  452.             bannerText.Caption = flags.bannerText
  453.             lptDevice.Caption = Str$(Asc(flags.localLPTDevice))
  454.             timeoutCount.Caption = Str$(flags.flushCaptureTimeoutCount)
  455.             If (Asc(flags.flushCaptureOnDeviceClose) = 0) Then
  456.                 deviceClose.Caption = "Enabled"
  457.             Else
  458.                 deviceClose.Caption = "Disabled"
  459.             End If
  460.             maxLines.Caption = Str$(flags.maxLines)
  461.             maxChars.Caption = Str$(flags.maxChars)
  462.             frmName.Caption = flags.formName
  463.             If (Asc(flags.LPTCaptureFlag) = 0) Then
  464.                 captureFlag.Caption = "No"
  465.             Else
  466.                 captureFlag.Caption = "Yes"
  467.             End If
  468.             If (Asc(flags.fileCaptureFlag) = 0) Then
  469.                 fileCapture.Caption = "No"
  470.             Else
  471.                 fileCapture.Caption = "Yes"
  472.             End If
  473.             If (Asc(flags.timingOutFlag) = 0) Then
  474.                 timingOut.Caption = "No"
  475.             Else
  476.                 timingOut.Caption = "Yes"
  477.             End If
  478.             serverConnID.Caption = Str$(Asc(flags.connectionIDQueuePrintJob))
  479.             If (Asc(flags.captureInProgress) = 0) Then
  480.                 inProgress.Caption = "No"
  481.             Else
  482.                 inProgress.Caption = "Yes"
  483.             End If
  484.             If (Asc(flags.printQueueFlag) = 255) Then
  485.                 inQueue.Caption = "Yes"
  486.             Else
  487.                 inQueue.Caption = "No"
  488.             End If
  489.             If (Asc(flags.printJobValid) = 0) Then
  490.                 jobValid.Caption = "No"
  491.             Else
  492.                 jobValid.Caption = "Yes"
  493.             End If
  494.             If (Asc(flags.printQueueFlag) = 255) Then
  495.                 printQueueID.Caption = Hex$(flags.printQueueID)
  496.             Else
  497.                 printQueueID.Caption = ""
  498.             End If
  499.             printJobNum.Caption = Str$(flags.printJobNumber)
  500.         End If
  501.     End If
  502. End Sub
  503.