The function also retrieves the 32-bit (long) value at the specified offset into the extra window memory.
大侠们知道这句话的意思吗?望指点一下!在下先谢过!`(0∩_∩0)′
——纯字面意思我知道,但不能理解!
...全文
8113打赏收藏
MSDN上的一句与内存有关的英文望大侠们指点一下!
The function also retrieves the 32-bit (long) value at the specified offset into the extra window memory. 大侠们知道这句话的意思吗?望指点一下!在下先谢过!`(0∩_∩0)′ ——纯字面意思我知道,但不能理解!
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function CallWindowProc Lib "user32" _
Alias "CallWindowProcA" _
(ByVal lpPrevWndFunc As Long, _
ByVal hwnd As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" _
Alias "RtlMoveMemory" _
(hpvDest As Any, _
hpvSource As Any, _
ByVal cbCopy As Long)
Public Sub Unhook(fhwnd As Long)
If defWindowProc Then
Call SetWindowLong(fhwnd, GWL_WNDPROC, defWindowProc)
defWindowProc = 0
End If
End Sub
Public Sub Hook(fhwnd As Long)
defWindowProc = SetWindowLong(fhwnd, _
GWL_WNDPROC, _
AddressOf WindowProc)
End Sub
Function WindowProc(ByVal hwnd As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Dim rc As RECT
Select Case uMsg
Case WM_SIZING
CopyMemory rc, ByVal lParam, LenB(rc)
Select Case wParam
GetWindowLong
The GetWindowLong function retrieves information about the specified window. The function also retrieves the 32-bit (long) value at the specified offset into the extra window memory.
If you are retrieving a pointer or a handle, this function has been superseded by the GetWindowLongPtr function. (Pointers and handles are 32 bits on 32-bit Windows and 64 bits on 64-bit Windows.) To write code that is compatible with both 32-bit and 64-bit versions of Windows, use GetWindowLongPtr.