home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / nivb_src / print.frm < prev    next >
Text File  |  1993-06-03  |  16KB  |  524 lines

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