home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / WIN_UTL2 / PPRTR4.ZIP / PPRTRFRM.TXT < prev    next >
Text File  |  1993-10-31  |  16KB  |  494 lines

  1. Declare Function PPrtr Lib "PPRTR.DLL" (ByVal hWnd As Integer, ByVal ppSelection As Integer, ByVal PPNewValue As Integer, ByVal ppAction As Integer) As Integer
  2. Declare Function DefPrtr Lib "PPRTR.DLL" (ByVal newone As String, ByVal oldone As String) As Integer
  3. Declare Function Prtrs Lib "PPRTR.DLL" (ByVal plist As String) As Integer
  4. Declare Function PrtrCap Lib "PPRTR.DLL" (ndc As DEVCAP) As Integer
  5. Declare Function GetPrtr Lib "PPRTR.DLL" (ByVal DefPrtr As String) As Integer
  6. Declare Function GetPort Lib "PPRTR.DLL" (ByVal ptrport As String) As Integer
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13. Sub CLIPCAPS ()
  14.     If dc.CLIPCAPS = CP_NONE Then
  15.         list2.AddItem "CLIPCAPS:  None "
  16.         Exit Sub
  17.     Else
  18.         list2.AddItem "CLIPCAPS"
  19.     End If
  20.     If dc.CLIPCAPS And CP_RECTANGLE Then
  21.         list2.AddItem "  Output clipped to rectangles:  Yes"
  22.     Else
  23.         list2.AddItem "  Output clipped to rectangles:  No"
  24.     End If
  25.     If dc.CLIPCAPS And LC_REGION Then
  26.         list2.AddItem "  Output clipped to regions:  Yes"
  27.     Else
  28.         list2.AddItem "  Output clipped to regions:  No"
  29.     End If
  30. End Sub
  31.  
  32. Sub Command1_Click ()
  33.     MsgBox "Pagesize is: " + Str$(PPrtr(hWnd, DM_PAPERSIZE, PP_UNNEEDED, PP_GIMME)), 0, "PaperSize"
  34. End Sub
  35.  
  36. Sub Command10_Click ()
  37.     MsgBox "Quality is: " + Str$(PPrtr(hWnd, DM_PRINTQUALITY, PP_UNNEEDED, PP_GIMME)), 0, "PrintQuality"
  38. End Sub
  39.  
  40. Sub Command11_Click ()
  41.     plist$ = String$(255, 0)
  42.     i = Prtrs(plist$)
  43. '    MsgBox Str$(i), 0, "size of returned string"
  44.  '   MsgBox plist$, 0, "returned string"
  45.     While i <> 0
  46.         j = InStr(plist$, ";")
  47.         If j = 0 Then
  48.            j = i + 1        ' no equiv of max() ??
  49.         End If
  50.         list1.AddItem Mid(plist$, 1, j - 1)
  51.         plist$ = Mid(plist$, j + 1)
  52.         i = Len(plist$)
  53.     Wend
  54. End Sub
  55.  
  56. '
  57. Sub Command12_Click ()
  58.  
  59.     i = PrtrCap(dc) ' check for 996 (no driver)
  60.     'msgbox str$(i)
  61.     list2.Clear
  62.     list2.AddItem "DRIVERVERSION: " + Str$(dc.DRIVERVERSION)
  63.     list2.AddItem "TECHNOLOGY: " + tech(dc.technology)    ' bits"
  64.     list2.AddItem "HORZSIZE: " + Str$(dc.HORZSIZE)
  65.     list2.AddItem "VERTSIZE: " + Str$(dc.VERTSIZE)
  66.     list2.AddItem "HORZRES: " + Str$(dc.HORZRES)
  67.     list2.AddItem "VERTRES: " + Str$(dc.VERTRES)
  68.     list2.AddItem "BITSPIXEL: " + Str$(dc.BITSPIXEL)
  69.     list2.AddItem "PLANES: " + Str$(dc.PLANES)
  70.     list2.AddItem "NUMBRUSHES: " + Str$(dc.NUMBRUSHES)
  71.     list2.AddItem "NUMPENS: " + Str$(dc.NUMPENS)
  72.     list2.AddItem "NUMMARKERS: " + Str$(dc.NUMMARKERS)
  73.     list2.AddItem "NUMFONTS: " + Str$(dc.NUMFONTS)
  74.     list2.AddItem "NUMCOLORS: " + Str$(dc.NUMCOLORS)
  75.     list2.AddItem "PDEVICESIZE: " + Str$(dc.PDEVICESIZE)
  76.     curve
  77.     LINECAPS
  78.     POLYGONAL
  79.     txt
  80.     CLIPCAPS
  81.     raster
  82.     list2.AddItem "ASPECTX: " + Str$(dc.ASPECTX)
  83.     list2.AddItem "ASPECTY: " + Str$(dc.ASPECTY)
  84.     list2.AddItem "ASPECTXY: " + Str$(dc.ASPECTXY)
  85.     list2.AddItem "LOGPIXELSX: " + Str$(dc.LOGPIXELSX)
  86.     list2.AddItem "LOGPIXELSY: " + Str$(dc.LOGPIXELSY)
  87.     list2.AddItem "SIZEPALETTE: " + Str$(dc.SIZEPALETTE)
  88.     list2.AddItem "NUMRESERVED: " + Str$(dc.NUMRESERVED)
  89.     list2.AddItem "COLORRES: " + Str$(dc.COLORRES)
  90.  
  91. End Sub
  92.  
  93. Sub Command13_Click ()
  94.     MsgBox "Orientation was: " + Str$(PPrtr(hWnd, DM_ORIENTATION, DMORIENT_LANDSCAPE, PP_CHANGE_IT)), 0, "Orientation"
  95. End Sub
  96.  
  97. Sub Command2_Click ()
  98.     MsgBox "Orientation was: " + Str$(PPrtr(hWnd, DM_ORIENTATION, DMORIENT_PORTRAIT, PP_CHANGE_IT)), 0, "Orientation"
  99. End Sub
  100.  
  101. Sub Command3_Click ()
  102.     MsgBox "Papersize was: " + Str$(PPrtr(hWnd, DM_PAPERSIZE, DMPAPER_LEGAL, PP_CHANGE_IT)), 0, "PaperSize"
  103. End Sub
  104.  
  105. Sub Command4_Click ()
  106.     MsgBox "Orientation is: " + Str$(PPrtr(hWnd, DM_ORIENTATION, PP_UNNEEDED, PP_GIMME)), 0, "Orientation"
  107. End Sub
  108.  
  109. Sub Command5_Click ()
  110.     oldprinter$ = String$(255, 0)
  111.     i = DefPrtr("Epson LX-800 on LPT1:", oldprinter$)
  112.     getdefault
  113.     MsgBox "return code = " + Str$(i)
  114.     MsgBox "old printer = " + oldprinter$
  115. End Sub
  116.  
  117. Sub Command6_Click ()
  118.     oldprinter$ = String$(255, 0)
  119.     i = DefPrtr("HP LaserJet Series II on LPT1:", oldprinter$)
  120.     getdefault
  121.     MsgBox "return code = " + Str$(i)
  122.     MsgBox "old printer = " + oldprinter$
  123. End Sub
  124.  
  125. Sub Command7_Click ()
  126.     ptrport$ = String$(255, 0)
  127.     i = GetPort(ptrport$)
  128.     label9.Caption = ptrport$
  129. End Sub
  130.  
  131. Sub Command8_Click ()
  132.     MsgBox "Quality was: " + Str$(PPrtr(hWnd, DM_PRINTQUALITY, DMRES_DRAFT, PP_CHANGE_IT)), 0, "PrintQuality"
  133. End Sub
  134.  
  135. Sub Command9_Click ()
  136.     MsgBox "Quality was: " + Str$(PPrtr(hWnd, DM_PRINTQUALITY, DMRES_HIGH, PP_CHANGE_IT)), 0, "PrintQuality"
  137. End Sub
  138.  
  139. Sub curve ()
  140.     If dc.curvecaps = CC_NONE Then
  141.         list2.AddItem "CURVECAPS:  None "
  142.         Exit Sub
  143.     Else
  144.         list2.AddItem "CURVECAPS"
  145.     End If
  146.     If dc.curvecaps And CC_CIRCLES Then
  147.         list2.AddItem "  Circles:  Yes"
  148.     Else
  149.         list2.AddItem "  Circles:  No"
  150.     End If
  151.     If dc.curvecaps And CC_PIE Then
  152.         list2.AddItem "  Pie:  Yes"
  153.     Else
  154.         list2.AddItem "  Pie:  No"
  155.     End If
  156.     If dc.curvecaps And CC_CHORD Then
  157.         list2.AddItem "  Chord:  Yes"
  158.     Else
  159.         list2.AddItem "  Chord:  No"
  160.     End If
  161.     If dc.curvecaps And CC_ELLIPSES Then
  162.         list2.AddItem "  Ellipses:  Yes"
  163.     Else
  164.         list2.AddItem "  Ellipses:  No"
  165.     End If
  166.     If dc.curvecaps And CC_WIDE Then
  167.         list2.AddItem "  Wide:  Yes"
  168.     Else
  169.         list2.AddItem "  Wide:  No"
  170.     End If
  171.     If dc.curvecaps And CC_STYLED Then
  172.         list2.AddItem "  Styled:  Yes"
  173.     Else
  174.         list2.AddItem "  Styled:  No"
  175.     End If
  176.     If dc.curvecaps And CC_WIDESTYLED Then
  177.         list2.AddItem "  Widestyled:  Yes"
  178.     Else
  179.         list2.AddItem "  Widestyled:  No"
  180.     End If
  181.     If dc.curvecaps And CC_INTERIORS Then
  182.         list2.AddItem "  Interiors:  Yes"
  183.     Else
  184.         list2.AddItem "  Interiors:  No"
  185.     End If
  186.     If dc.curvecaps And CC_ROUNDRECT Then
  187.         list2.AddItem "  RoundRect:  Yes"
  188.     Else
  189.         list2.AddItem "  RoundRect:  No"
  190.     End If
  191. End Sub
  192.  
  193. Sub Form_Load ()
  194.     getdefault
  195. End Sub
  196.  
  197. Sub getdefault ()
  198.     defprinter$ = String$(255, 0)
  199.     i = GetPrtr(defprinter$)
  200.     If label8.Caption <> defprinter$ Then
  201.         label8.Caption = defprinter$
  202.         list2.Clear
  203.     End If
  204. End Sub
  205.  
  206. Sub LINECAPS ()
  207.     If dc.LINECAPS = PC_NONE Then
  208.         list2.AddItem "LINECAPS:  None "
  209.         Exit Sub
  210.     Else
  211.         list2.AddItem "LINECAPS"
  212.     End If
  213.     If dc.LINECAPS And LC_POLYLINE Then
  214.         list2.AddItem "  Polylines:  Yes"
  215.     Else
  216.         list2.AddItem "  Polylines:  No"
  217.     End If
  218.     If dc.LINECAPS And LC_MARKER Then
  219.         list2.AddItem "  Markers:  Yes"
  220.     Else
  221.         list2.AddItem "  Markers:  No"
  222.     End If
  223.     If dc.LINECAPS And LC_POLYMARKER Then
  224.         list2.AddItem "  PolyMarkers:  Yes"
  225.     Else
  226.         list2.AddItem "  PolyMarkers:  No"
  227.     End If
  228.     If dc.LINECAPS And LC_WIDE Then
  229.         list2.AddItem "  Wide lines:  Yes"
  230.     Else
  231.         list2.AddItem "  Wide lines:  No"
  232.     End If
  233.     If dc.LINECAPS And LC_STYLED Then
  234.         list2.AddItem "  Styled lines:  Yes"
  235.     Else
  236.         list2.AddItem "  Styled lines:  No"
  237.     End If
  238.     If dc.LINECAPS And LC_WIDESTYLED Then
  239.         list2.AddItem "  Wide and styled lines:  Yes"
  240.     Else
  241.         list2.AddItem "  Wide and styled lines:  No"
  242.     End If
  243.     If dc.LINECAPS And LC_INTERIORS Then
  244.         list2.AddItem "  Interiors:  Yes"
  245.     Else
  246.         list2.AddItem "  Interiors:  No"
  247.     End If
  248. End Sub
  249.  
  250. Sub POLYGONAL ()
  251.     If dc.POLYGONALCAPS = PC_NONE Then
  252.         list2.AddItem "POLYGONALCAPS:  None "
  253.         Exit Sub
  254.     Else
  255.         list2.AddItem "POLYGONALCAPS"
  256.     End If
  257.     If dc.POLYGONALCAPS And PC_POLYGON Then
  258.         list2.AddItem "  Alternate fill polygons:  Yes"
  259.     Else
  260.         list2.AddItem "  Alternate fill polygons:  No"
  261.     End If
  262.     If dc.POLYGONALCAPS And PC_RECTANGLE Then
  263.         list2.AddItem "  Rectangle:  Yes"
  264.     Else
  265.         list2.AddItem "  Rectangle:  No"
  266.     End If
  267.     If dc.POLYGONALCAPS And PC_WINDPOLYGON Then
  268.         list2.AddItem "  Winding number fill polygon:  Yes"
  269.     Else
  270.         list2.AddItem "  Winding number fill polygon:  No"
  271.     End If
  272.     If dc.POLYGONALCAPS And PC_SCANLINE Then
  273.         list2.AddItem "  Scanlines:  Yes"
  274.     Else
  275.         list2.AddItem "  Scanlines:  No"
  276.     End If
  277.     If dc.POLYGONALCAPS And PC_WIDE Then
  278.         list2.AddItem "  Wide borders:  Yes"
  279.     Else
  280.         list2.AddItem "  Wide borders:  No"
  281.     End If
  282.     If dc.POLYGONALCAPS And PC_STYLED Then
  283.         list2.AddItem "  Styled borders:  Yes"
  284.     Else
  285.         list2.AddItem "  Styled borders:  No"
  286.     End If
  287.     If dc.POLYGONALCAPS And PC_WIDESTYLED Then
  288.         list2.AddItem "  Wide and styled borders:  Yes"
  289.     Else
  290.         list2.AddItem "  Wide and styled borders:  No"
  291.     End If
  292.     If dc.POLYGONALCAPS And PC_INTERIORS Then
  293.         list2.AddItem "  Interiors:  Yes"
  294.     Else
  295.         list2.AddItem "  Interiors:  No"
  296.     End If
  297. End Sub
  298.  
  299. Sub raster ()
  300.     If dc.RASTERCAPS = RC_NONE Then
  301.         list2.AddItem "RASTERCAPS:  None "
  302.         Exit Sub
  303.     Else
  304.         list2.AddItem "RASTERCAPS"
  305.     End If
  306.     If dc.RASTERCAPS And RC_BITBLT Then
  307.         list2.AddItem "  Capable of simple BitBlt:  Yes"
  308.     Else
  309.         list2.AddItem "  Capable of simple BitBlt:  No"
  310.     End If
  311.     If dc.RASTERCAPS And RC_BANDING Then
  312.         list2.AddItem "  Requires banding support:  Yes"
  313.     Else
  314.         list2.AddItem "  Requires banding support:  No"
  315.     End If
  316.     If dc.RASTERCAPS And RC_SCALING Then
  317.         list2.AddItem "  Requires scaling support:  Yes"
  318.     Else
  319.         list2.AddItem "  Requires scaling support:  No"
  320.     End If
  321.     If dc.RASTERCAPS And RC_BITMAP64 Then
  322.         list2.AddItem "  Supports bitmaps >64K:  Yes"
  323.     Else
  324.         list2.AddItem "  Supports bitmaps >64K:  No"
  325.     End If
  326.     If dc.RASTERCAPS And RC_GDI20_OUTPUT Then
  327.         list2.AddItem "  Has 2.0 output calls:  Yes"
  328.     Else
  329.         list2.AddItem "  Has Win 2.0 output calls:  No"
  330.     End If
  331.     If dc.RASTERCAPS And RC_GDI20_STATE Then
  332.         list2.AddItem "  Includes state block in DC:  Yes"
  333.     Else
  334.         list2.AddItem "  Includes state block in DC:  No"
  335.     End If
  336.     If dc.RASTERCAPS And RC_SAVEBITMAP Then
  337.         list2.AddItem "  Saves bitmaps locally:  Yes"
  338.     Else
  339.         list2.AddItem "  Saves bitmaps locally:  No"
  340.     End If
  341.     If dc.RASTERCAPS And RC_DI_BITMAP Then
  342.         list2.AddItem "  Supports DIB to memory:  Yes"
  343.     Else
  344.         list2.AddItem "  Supports DIB to memory:  No"
  345.     End If
  346.     If dc.RASTERCAPS And RC_PALETTE Then
  347.         list2.AddItem "  Supports a palette:  Yes"
  348.     Else
  349.         list2.AddItem "  Supports a palette:  No"
  350.     End If
  351.     If dc.RASTERCAPS And RC_DIBTODEV Then
  352.         list2.AddItem "  Supports bitmap conversion:  Yes"
  353.     Else
  354.         list2.AddItem "  Supports bitmap conversion:  No"
  355.     End If
  356.     If dc.RASTERCAPS And RC_BIGFONT Then
  357.         list2.AddItem "  Supports fonts >64K:  Yes"
  358.     Else
  359.         list2.AddItem "  Supports fonts >64K:  No"
  360.     End If
  361.     If dc.RASTERCAPS And RC_STRETCHBLT Then
  362.         list2.AddItem "  Supports StretchBlt:  Yes"
  363.     Else
  364.         list2.AddItem "  Supports StretchBlt:  No"
  365.     End If
  366.     If dc.RASTERCAPS And RC_FLOODFILL Then
  367.         list2.AddItem "  Supports FloodFill:  Yes"
  368.     Else
  369.         list2.AddItem "  Supports FloodFill:  No"
  370.     End If
  371.     If dc.RASTERCAPS And RC_STRETCHDIB Then
  372.         list2.AddItem "  Supports StretchDIBits:  Yes"
  373.     Else
  374.         list2.AddItem "  Supports StretchDIBits:  No"
  375.     End If
  376.     If dc.RASTERCAPS And RC_OP_DX_OUTPUT Then
  377.         list2.AddItem "  Supports opaque and DX array:  Yes"
  378.     Else
  379.         list2.AddItem "  Supports opaque and DX array:  No"
  380.     End If
  381.     If dc.RASTERCAPS And RC_DEVBITS Then
  382.         list2.AddItem "  Supports device bitmaps:  Yes"
  383.     Else
  384.         list2.AddItem "  Supports device bitmaps:  No"
  385.     End If
  386.  
  387. End Sub
  388.  
  389. Function tech (i)
  390.    Select Case i
  391.           Case DT_PLOTTER
  392.                tech = "Vector Plotter"
  393.           Case DT_RASDISPLAY
  394.                tech = "Raster Display"
  395.           Case DT_RASPRINTER
  396.                tech = "Raster printer"
  397.           Case DT_RASCAMERA
  398.                tech = "Raster Camera"
  399.           Case DT_CHARSTREAM
  400.                tech = "Character-stream PLP"
  401.           Case DT_METAFILE
  402.                tech = "Metafile, VDM"
  403.           Case DT_DISPFILE
  404.                tech = "Display-file"
  405.           Case Else
  406.                tech = "Unknown"
  407.    End Select
  408. End Function
  409.  
  410. Sub txt ()
  411.     If dc.TEXTCAPS = TC_NONE Then
  412.         list2.AddItem "TEXTCAPS:  None "
  413.         Exit Sub
  414.     Else
  415.         list2.AddItem "TEXTCAPS"
  416.     End If
  417.     If dc.TEXTCAPS And TC_OP_CHARACTER Then
  418.         list2.AddItem "  Character output precision:  Yes"
  419.     Else
  420.         list2.AddItem "  Character output precision:  No"
  421.     End If
  422.     If dc.TEXTCAPS And TC_OP_STROKE Then
  423.         list2.AddItem "  Stroke output precision:  Yes"
  424.     Else
  425.         list2.AddItem "  Stroke output precision:  No"
  426.     End If
  427.     If dc.TEXTCAPS And TC_CP_STROKE Then
  428.         list2.AddItem "  Stroke clip precision:  Yes"
  429.     Else
  430.         list2.AddItem "  Stroke clip precision:  No"
  431.     End If
  432.     If dc.TEXTCAPS And TC_CR_90 Then
  433.         list2.AddItem "  90 degree character rotation:  Yes"
  434.     Else
  435.         list2.AddItem "  90 degree character rotation:  No"
  436.     End If
  437.     If dc.TEXTCAPS And TC_CR_ANY Then
  438.         list2.AddItem "  Any character rotation:  Yes"
  439.     Else
  440.         list2.AddItem "  Any character rotation:  No"
  441.     End If
  442.     If dc.TEXTCAPS And TC_SF_X_YINDEP Then
  443.         list2.AddItem "  Scaling independent of x and y:  Yes"
  444.     Else
  445.         list2.AddItem "  Scaling independent of x and y:  No"
  446.     End If
  447.     If dc.TEXTCAPS And TC_SA_DOUBLE Then
  448.         list2.AddItem "  Doubled character for scaling:  Yes"
  449.     Else
  450.         list2.AddItem "  Doubled character for scaling:  No"
  451.     End If
  452.     If dc.TEXTCAPS And TC_SA_INTEGER Then
  453.         list2.AddItem "  Integer multiples for scaling:  Yes"
  454.     Else
  455.         list2.AddItem "  Integer multiples for scaling:  No"
  456.     End If
  457.     If dc.TEXTCAPS And TC_IA_ABLE Then
  458.         list2.AddItem "  Italicizing:  Yes"
  459.     Else
  460.         list2.AddItem "  Italicizing:  No"
  461.     End If
  462.     If dc.TEXTCAPS And TC_SA_CONTIN Then
  463.         list2.AddItem "  Any multiples for exact scaling:  Yes"
  464.     Else
  465.         list2.AddItem "  Any multiples for exact scaling:  No"
  466.     End If
  467.     If dc.TEXTCAPS And TC_EA_DOUBLE Then
  468.         list2.AddItem "  Double-weight characters:  Yes"
  469.     Else
  470.         list2.AddItem "  Double-weight characters:  No"
  471.     End If
  472.     If dc.TEXTCAPS And TC_UA_ABLE Then
  473.         list2.AddItem "  Underlining:  Yes"
  474.     Else
  475.         list2.AddItem "  Underlining:  No"
  476.     End If
  477.     If dc.TEXTCAPS And TC_SO_ABLE Then
  478.         list2.AddItem "  Strikeouts:  Yes"
  479.     Else
  480.         list2.AddItem "  Strikeouts:  No"
  481.     End If
  482.     If dc.TEXTCAPS And TC_RA_ABLE Then
  483.         list2.AddItem "  Raster fonts:  Yes"
  484.     Else
  485.         list2.AddItem "  Raster fonts:  No"
  486.     End If
  487.     If dc.TEXTCAPS And TC_VA_ABLE Then
  488.         list2.AddItem "  Vertor fonts:  Yes"
  489.     Else
  490.         list2.AddItem "  Vertor fonts:  No"
  491.     End If
  492. End Sub
  493.  
  494.