home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / system / callback / enumobje.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-02-27  |  4.1 KB  |  126 lines

  1. VERSION 2.00
  2. Begin Form frmEnumObjects 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "EnumObjects"
  5.    ClientHeight    =   4485
  6.    ClientLeft      =   1395
  7.    ClientTop       =   795
  8.    ClientWidth     =   3270
  9.    Height          =   4890
  10.    Left            =   1335
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4485
  13.    ScaleWidth      =   3270
  14.    Top             =   450
  15.    Width           =   3390
  16.    Begin CommandButton cmdZur
  17.       BackColor       =   &H00C0C0C0&
  18.       Caption         =   "Zur
  19.       Height          =   330
  20.       Left            =   2100
  21.       TabIndex        =   6
  22.       Top             =   4080
  23.       Width           =   1065
  24.    End
  25.    Begin Frame fraComment 
  26.       BackColor       =   &H00C0C0C0&
  27.       Height          =   1695
  28.       Left            =   60
  29.       TabIndex        =   3
  30.       Top             =   2340
  31.       Width           =   3075
  32.       Begin Label lblComment 
  33.          Alignment       =   2  'Center
  34.          BackColor       =   &H00000000&
  35.          Caption         =   " Kommentar:"
  36.          ForeColor       =   &H00FFFFFF&
  37.          Height          =   255
  38.          Left            =   -60
  39.          TabIndex        =   5
  40.          Top             =   0
  41.          Width           =   3135
  42.       End
  43.       Begin Label lblCommentText 
  44.          BackStyle       =   0  'Transparent
  45.          Caption         =   "In der obigen Lsite sehen Sie alle Zeichen-Objekte (Zeichenstifte und Pinsel), die augenblicklich im DeviceContect (hDC) des Forms zur Verf
  46. gung stehen."
  47.          FontBold        =   0   'False
  48.          FontItalic      =   0   'False
  49.          FontName        =   "MS Sans Serif"
  50.          FontSize        =   9.75
  51.          FontStrikethru  =   0   'False
  52.          FontUnderline   =   0   'False
  53.          Height          =   1335
  54.          Left            =   60
  55.          TabIndex        =   4
  56.          Top             =   240
  57.          Width           =   2955
  58.       End
  59.    End
  60.    Begin Frame fraEnumObjects 
  61.       BackColor       =   &H00C0C0C0&
  62.       Height          =   2235
  63.       Left            =   60
  64.       TabIndex        =   0
  65.       Top             =   60
  66.       Width           =   3075
  67.       Begin ListBox lstEnumObjects 
  68.          Height          =   1785
  69.          Left            =   60
  70.          TabIndex        =   1
  71.          Top             =   300
  72.          Width           =   2955
  73.       End
  74.       Begin Label lblEnumObjects 
  75.          Alignment       =   2  'Center
  76.          BackColor       =   &H00000000&
  77.          Caption         =   "Object-Liste:"
  78.          ForeColor       =   &H00FFFFFF&
  79.          Height          =   255
  80.          Left            =   0
  81.          TabIndex        =   2
  82.          Top             =   0
  83.          Width           =   3075
  84.       End
  85.    End
  86.    Begin CBVBX EnumBrush 
  87.       CBType          =   4  ' 4  - EnumObjectsProc
  88.       Left            =   0
  89.       Top             =   0
  90.    End
  91.    Begin CBVBX EnumPen 
  92.       CBType          =   4  ' 4  - EnumObjectsProc
  93.       Left            =   0
  94.       Top             =   0
  95.    End
  96. Option Explicit
  97. Sub cmdZur
  98. ck_Click ()
  99.   Unload Me
  100. End Sub
  101. Sub EnumBrush_EnumObjectsProc (lpLogObject As Long, lpdata As Long, RetVal As Integer)
  102.     Dim lb As LogBrush
  103.     TypeAtAdress lb, ByVal lpLogObject, Len(lb)
  104.     lstEnumObjects.AddItem "Brush: " & lb.lbColor
  105.     RetVal = True 'weitermachen
  106. End Sub
  107. Sub EnumPen_EnumObjectsProc (lpLogObject As Long, lpdata As Long, RetVal As Integer)
  108.     Dim lp As LogPen
  109.     Dim l As Long
  110.     TypeAtAdress lp, ByVal lpLogObject, Len(lp)
  111.     TypeAtAdress l, ByVal lpdata, Len(l)  'zuerst zeiger derefenzieren
  112.     lstEnumObjects.AddItem "Pen (" & l & "): " & lp.lopnColor
  113.     l = l + 1   'wert erh
  114.     TypeAtAdress ByVal lpdata, l, Len(l) 'neuen wert in adresse lpdata kopieren
  115.     RetVal = True 'weitermachen
  116. End Sub
  117. Sub Form_Load ()
  118.     Dim dummy
  119.     Dim l&
  120.     l& = 0
  121.     dummy = EnumObjects(Me.hDC, OBJ_PEN, enumpen.CBAdress, l)  'Adresse von l 
  122. bergeben
  123.     l& = 0
  124.     dummy = EnumObjects(Me.hDC, OBJ_BRUSH, enumbrush.CBAdress, l)
  125. End Sub
  126.