home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / vbpg32 / samples4 / ch15 / enumprop.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-02-16  |  2.0 KB  |  60 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   1620
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1515
  7.    ClientWidth     =   4410
  8.    Height          =   2025
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1620
  12.    ScaleWidth      =   4410
  13.    Top             =   1170
  14.    Width           =   4530
  15.    Begin VB.CommandButton Command1 
  16.       Caption         =   "Command1"
  17.       Height          =   525
  18.       Left            =   1500
  19.       TabIndex        =   0
  20.       Top             =   540
  21.       Width           =   1245
  22.    End
  23.    Begin Cbkd.Callback Callback1 
  24.       Left            =   420
  25.       Top             =   480
  26.       _Version        =   262144
  27.       _ExtentX        =   847
  28.       _ExtentY        =   847
  29.       _StockProps     =   0
  30.       Type            =   5
  31.    End
  32. Attribute VB_Name = "Form1"
  33. Attribute VB_Creatable = False
  34. Attribute VB_Exposed = False
  35. Option Explicit
  36. ' Copyright 
  37.  1997 by Desaware Inc. All Rights Reserved
  38. Private Declare Function EnumProps Lib "user32" Alias "EnumPropsA" (ByVal hwnd&, ByVal lpaddress&) As Long
  39. Private Declare Function SetProp Lib "user32" Alias "SetPropA" (ByVal hwnd&, ByVal lpstring As String, ByVal hdata&) As Long
  40. Private Declare Function RemoveProp Lib "user32" Alias "RemovePropA" (ByVal hwnd&, ByVal lpstring As String) As Long
  41. Private Sub Callback1_EnumProps(hwnd As Long, lpstring As String, hdata As Long, retval As Long)
  42. Dim l As Long, lpstr As Long
  43. Debug.Print "Got Callback, prop name is " & lpstring & " data is " & hdata
  44. End Sub
  45. Private Sub Command1_Click()
  46. Dim l As Long
  47. l = EnumProps(Me.hwnd, Callback1.ProcAddress)
  48. Debug.Print l
  49. End Sub
  50. Private Sub Form_Load()
  51. Dim l As Long
  52. l = SetProp(Me.hwnd, "DesawareInc", 3)
  53. Debug.Print "Property set was " & l
  54. End Sub
  55. Private Sub Form_Unload(Cancel As Integer)
  56. Dim l As Long
  57. l = RemoveProp(Me.hwnd, "DesawareInc")
  58. Debug.Print "Property removed was " & l
  59. End Sub
  60.