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?:D
Thanks
Printable View
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?:D
Thanks
Nobody knows anything about it????:confused:
From MSDN
Quote:
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.
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
Errrr....this is the C++ forum ;)
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....
:)