|
-
Aug 7th, 2001, 06:15 AM
#1
Thread Starter
PowerPoster
What does "GetProp" API call do?
What is that API call used for? I looked in PSDK but did not understand what was written there. SO can you tell me what does this "Getprop" API call do?
Thanks
-
Aug 8th, 2001, 07:21 PM
#2
Thread Starter
PowerPoster
Nobody knows anything about it????
-
Aug 14th, 2001, 05:19 PM
#3
From MSDN
The GetProp function retrieves a data handle from the property list of the given window. The given character string identifies the handle to be retrieved. The string and handle must have been added to the property list by a previous call to the SetProp function.
HANDLE GetProp(
HWND hWnd, // handle of window
LPCTSTR lpString // atom or address of string
);
Parameters
hWnd
Handle to the window whose property list is to be searched.
lpString
Pointer to a null-terminated character string or contains an atom that identifies a string. If this parameter is an atom, it must have been created by using theGlobalAddAtom function. The atom, a 16-bit value, must be placed in the low-order word of the lpString parameter; the high-order word must be zero.
Return Values
If the property list contains the given string, the return value is the associated data handle. Otherwise, the return value is NULL.
-
Aug 16th, 2001, 09:28 AM
#4
It lets you get & set arbitrary (meaning things you make up meanings for, not stuff the OS cares about.) property values
Code:
from allapi.net
'in a module
Declare Function GetProp Lib "user32" Alias "GetPropA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Declare Function SetProp Lib "user32" Alias "SetPropA" (ByVal hwnd As Long, ByVal lpString As String, ByVal hData As Long) As Long
Declare Function RemoveProp Lib "user32" Alias "RemovePropA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Declare Function EnumProps Lib "user32" Alias "EnumPropsA" (ByVal hwnd As Long, ByVal lpEnumFunc As Long) As Long
Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As Long
Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyA" (ByVal lpString1 As String, ByVal lpString2 As Long) As Long
Function PropEnumProc(ByVal hwnd As Long, ByVal lpszString As Long, ByVal hData As Long) As Boolean
Dim Buffer As String
'create ab buffer
Buffer = Space(lstrlen(lpszString) + 1)
'copy the string to the buffer
lstrcpy Buffer, lpszString
'show the buffer
Form1.Print Buffer
'continue enumeration
PropEnumProc = True
End Function
'in a form
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: [email protected]
'set the form's graphic mode to persistent
Me.AutoRedraw = True
'create a new property and set its value to 123
SetProp Me.hwnd, "TestProp", 123
'retrieve the value and show it
MsgBox "Property Value:" + Str(GetProp(Me.hwnd, "TestProp"))
'begin the enumeration
EnumProps Me.hwnd, AddressOf PropEnumProc
'remove the property
RemoveProp Me.hwnd, "TestProp"
End Sub
-
Aug 16th, 2001, 11:13 AM
#5
Monday Morning Lunatic
Errrr....this is the C++ forum
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 17th, 2001, 09:11 AM
#6
Mea culpa. woops sorry.
Answered about 10 VB questions, got locked into VB mode.
heh. You think this is bad. I once wrote a whole block of Macro (assembler) right into the middle of a Fortran routine. It had a lot of trouble compiling....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|