home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Universal_2106383172008.psc / Forms / frmCallbackObj.frm
Text File  |  2008-03-11  |  5KB  |  142 lines

  1. VERSION 5.00
  2. Begin VB.Form frmCallbackObj 
  3.    BackColor       =   &H00FFFFFF&
  4.    Caption         =   "Callback sample"
  5.    ClientHeight    =   8100
  6.    ClientLeft      =   165
  7.    ClientTop       =   480
  8.    ClientWidth     =   8370
  9.    ClipControls    =   0   'False
  10.    FillStyle       =   0  'Solid
  11.    BeginProperty Font 
  12.       Name            =   "Tahoma"
  13.       Size            =   9.75
  14.       Charset         =   0
  15.       Weight          =   400
  16.       Underline       =   0   'False
  17.       Italic          =   0   'False
  18.       Strikethrough   =   0   'False
  19.    EndProperty
  20.    FontTransparent =   0   'False
  21.    ForeColor       =   &H00800000&
  22.    LinkTopic       =   "Form1"
  23.    ScaleHeight     =   540
  24.    ScaleMode       =   3  'Pixel
  25.    ScaleWidth      =   558
  26.    StartUpPosition =   2  'CenterScreen
  27.    Begin VB.Menu mnuCallback 
  28.       Caption         =   "&Callback"
  29.       Begin VB.Menu mnuItem 
  30.          Caption         =   "EnumWindows"
  31.          Index           =   0
  32.       End
  33.       Begin VB.Menu mnuItem 
  34.          Caption         =   "EnumFontFamilies"
  35.          Index           =   1
  36.       End
  37.       Begin VB.Menu mnuItem 
  38.          Caption         =   "-"
  39.          Index           =   2
  40.       End
  41.       Begin VB.Menu mnuItem 
  42.          Caption         =   "Subclass"
  43.          Index           =   3
  44.       End
  45.       Begin VB.Menu mnuItem 
  46.          Caption         =   "-"
  47.          Index           =   4
  48.       End
  49.       Begin VB.Menu mnuItem 
  50.          Caption         =   "Smooth scrolling"
  51.          Index           =   5
  52.       End
  53.       Begin VB.Menu mnuItem 
  54.          Caption         =   "-"
  55.          Index           =   6
  56.       End
  57.       Begin VB.Menu mnuItem 
  58.          Caption         =   "E&xit"
  59.          Index           =   7
  60.       End
  61.    End
  62. End
  63. Attribute VB_Name = "frmCallbackObj"
  64. Attribute VB_GlobalNameSpace = False
  65. Attribute VB_Creatable = False
  66. Attribute VB_PredeclaredId = True
  67. Attribute VB_Exposed = False
  68.  
  69. '*************************************************************************************************
  70. '** frmCallbackObj - Demonstrate object callbacks
  71. '*************************************************************************************************
  72.  
  73. Option Explicit
  74.  
  75. Private Const LF_FACESIZE As Long = 32
  76.  
  77. Private Type LOGFONT
  78.   lfHeight                As Long
  79.   lfWidth                 As Long
  80.   lfEscapement            As Long
  81.   lfOrientation           As Long
  82.   lfWeight                As Long
  83.   lfItalic                As Byte
  84.   lfUnderline             As Byte
  85.   lfStrikeOut             As Byte
  86.   lfCharSet               As Byte
  87.   lfOutPrecision          As Byte
  88.   lfClipPrecision         As Byte
  89.   lfQuality               As Byte
  90.   lfPitchAndFamily        As Byte
  91.   lfFaceName(LF_FACESIZE) As Byte
  92. End Type
  93.  
  94. Private Type NEWTEXTMETRIC
  95.   tmHeight                As Long
  96.   tmAscent                As Long
  97.   tmDescent               As Long
  98.   tmInternalLeading       As Long
  99.   tmExternalLeading       As Long
  100.   tmAveCharWidth          As Long
  101.   tmMaxCharWidth          As Long
  102.   tmWeight                As Long
  103.   tmOverhang              As Long
  104.   tmDigitizedAspectX      As Long
  105.   tmDigitizedAspectY      As Long
  106.   tmFirstChar             As Byte
  107.   tmLastChar              As Byte
  108.   tmDefaultChar           As Byte
  109.   tmBreakChar             As Byte
  110.   tmItalic                As Byte
  111.   tmUnderlined            As Byte
  112.   tmStruckOut             As Byte
  113.   tmPitchAndFamily        As Byte
  114.   tmCharSet               As Byte
  115.   ntmFlags                As Long
  116.   ntmSizeEM               As Long
  117.   ntmCellHeight           As Long
  118.   ntmAveWidth             As Long
  119. End Type
  120.  
  121. Private Type RECT
  122.   Left                    As Long
  123.   Top                     As Long
  124.   Right                   As Long
  125.   Bottom                  As Long
  126. End Type
  127.  
  128. Private Declare Function CallWindowProcA Lib "user32" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  129. Private Declare Function EnumFontFamiliesA Lib "gdi32" (ByVal hDC As Long, ByVal lpszFamily As String, ByVal lpEnumFontFamProc As Long, lParam As Any) As Long
  130. Private Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
  131. Private Declare Function GetWindowTextA Lib "user32" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  132. Private Declare Function IsWindowVisible Lib "user32" (ByVal hWnd As Long) As Long
  133. Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  134. Private Declare Function Queiva     areeeeeE     =   "Smooth scrolling"
  135.   zng
  136. Private Declaru,2 lP        mNalic                As Byte
  137.   tmUnderlined            As Byte
  138.   tmStruckOut O t As Byte
  139.   tmStruckOut O t A tmn*O far
  140. Priv Stru10cscrolling"
  141. UalSeaIPmA tm    >Val umtmSt   arn*O Cong, ByVal wMsg AstAs L
  142. PrimSt   arnal umt.eong, ByI O