home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Devview
- Caption = "Device Context Viewer"
- ClientHeight = 4065
- ClientLeft = 1095
- ClientTop = 1485
- ClientWidth = 7365
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 4065
- ScaleWidth = 7365
- Begin VB.TextBox Text1
- BackColor = &H00C0C0C0&
- Height = 3855
- Left = 120
- MultiLine = -1 'True
- TabIndex = 0
- Top = 120
- Width = 5895
- End
- Begin VB.CommandButton Command1
- Caption = "Form"
- Height = 495
- Left = 6240
- TabIndex = 1
- Top = 120
- Width = 975
- End
- Begin VB.CommandButton Command2
- Caption = "Printer"
- Height = 495
- Left = 6240
- TabIndex = 2
- Top = 720
- Width = 975
- End
- Attribute VB_Name = "Devview"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- ' Copyright
- 1997 by Desaware Inc. All Rights Reserved
- Private Sub Command1_Click()
- LoadInfo Devview.hDC
- End Sub
- Private Sub Command2_Click()
- LoadInfo Printer.hDC
- End Sub
- ' Loads the edit box with information about the DC
- Private Sub LoadInfo(usehDC&)
- Dim a$
- #If Win32 Then
- Dim r As Long
- Dim nhDC As Long
- #Else
- Dim r As Integer
- Dim nhDC As Integer
- #End If
- nhDC = usehDC
- Dim crlf$
- crlf$ = Chr$(13) + Chr$(10)
- r = GetDeviceCaps(nhDC, TECHNOLOGY)
- If r And DT_RASPRINTER Then a$ = "Raster Printer"
- If r And DT_RASDISPLAY Then a$ = "Raster Display"
- ' You can detect other technology types here - see the
- ' GetDeviceCaps function description for technology types
- If a$ = "" Then a$ = "Other technology"
- a$ = a$ + crlf$
- a$ = a$ + "X,Y Dimensions in pixels:" + Str$(GetDeviceCaps(nhDC, HORZRES)) + "," + Str$(GetDeviceCaps(nhDC, VERTRES)) + crlf$
- a$ = a$ + "X,Y Pixels/Logical Inch:" + Str$(GetDeviceCaps(nhDC, LOGPIXELSX)) + "," + Str$(GetDeviceCaps(nhDC, LOGPIXELSY)) + crlf$
- a$ = a$ + "Bits/Pixel:" + Str$(GetDeviceCaps(nhDC, BITSPIXEL)) + crlf$
- a$ = a$ + "Color Planes:" + Str$(GetDeviceCaps(nhDC, PLANES)) + crlf$
- a$ = a$ + "Color Table Entries:" + Str$(GetDeviceCaps(nhDC, NUMCOLORS)) + crlf$
- a$ = a$ + "Aspect X,Y,XY:" + Str$(GetDeviceCaps(nhDC, ASPECTX)) + "," + Str$(GetDeviceCaps(nhDC, ASPECTY)) + "," + Str$(GetDeviceCaps(nhDC, ASPECTXY)) + crlf$
- r = GetDeviceCaps(nhDC, RASTERCAPS)
- a$ = a$ + crlf$ + "Device capabilities:" + crlf$
- If r And RC_BANDING Then a$ = a$ + "Banding" + crlf$
- If r And RC_BIGFONT Then a$ = a$ + "Fonts >64K" + crlf$
- If r And RC_BITBLT Then a$ = a$ + "BitBlt" + crlf$
- If r And RC_BITMAP64 Then a$ = a$ + "Bitmaps >64k" + crlf$
- If r And RC_DI_BITMAP Then a$ = a$ + "Device Independent Bitmaps" + crlf$
- If r And RC_DIBTODEV Then a$ = a$ + "DIB to device" + crlf$
- If r And RC_FLOODFILL Then a$ = a$ + "Flood fill" + crlf$
- If r And RC_SCALING Then a$ = a$ + "Scaling" + crlf$
- If r And RC_STRETCHBLT Then a$ = a$ + "StretchBlt" + crlf$
- If r And RC_STRETCHDIB Then a$ = a$ + "StretchDIB" + crlf$
- Text1.Text = a$
- End Sub
-