WM_MOUSEMOVE
Dim pt As POINTAPI
Dim cursorPoint As Longptr
Dim rc As RECT
(pt.x=loword(lparam
(pt.y=hiword(lparam
(cursorPoint=ScreenToClient (hwnd,pt???
rc.left=0
rc.right=0
rc.right=rc.left+5
rc.bottom=rc.top+5
(If PtInRect(rc, cursorPoint
"SetWindowTextA hwnd,"in
End if
wParam : virtual keys like MK_LBUTTON(Mouse Key
(Left
lParamloword از lparam یا (Clng(lparam And 65535 نشاندهنده ی مختصات x کرسر
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left
.corner of the client area
Hiword از lparam یا (Clng(lparam \ 65535 نشاندهنده ی مختصات y کرسر
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return value
If an application processes this message, it should .return zero
Private oldUserData As LongPtr
Private oldWinProc As LongPtr
=oldUserData
(GetWindowLongPtr(hwnd,GWLP_USERDATA
oldWinProc=SetWindowLongPtr(hwnd,GWL_WNDPROC,Addressof
(WinProc
WinProc
Select Case uMsge
Case WM_MOUSMOVE
.
End Select
=userDataToRestore
(SetWindowLongPtr(GWL_USERDATA,oldUserData
)WinProc=CallWindowProc
(oldWinProc,hWnd,uMsg,wParam,lParam
SetWindowLongPtr(GWL_USERDATA,userDataToRestore
End Function
()OnNcPaint
static BOOL before=FALSE
if not before Then 'If first time, the OnNcCalcSize function will be called
SetWindowPos 0(hwnd),0,0,0,0, SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOSIZE before=TRUE
DrawBorders
End if
prect
oldrect
NCCALCSIZE
Static p As RECT
Dim nccsp As NCCALCSIZE_PARAMS
(CopyMemory nccsp,ByVal lParam,Len(lParam
(prect=nccsp.rgrc(0
oldrect=prect
CallWindowProc hWnd, wMsg, wParam, lParam
p.left=prect.left - oldrect.left
p.right=oldrect.right - prect.right
p.Top=prect.top-oldrect.top
p.Bottom=oldrect.bottom-prect.bottom
(p.right=p.right-GetSystemMetrics(SM_CXVSCROLL
ret
WinProc=WVR_VALIDRECTS
WMNCPAINT : GetButtonRect
Static btnrect
CallWindowProc hWnd, wMsg, wParam, lParam
GetWindowRect hwnd,Winrect
OffsetRect Winrect, -Winrect.left, -Winrect.top
btnrect.right=btnrect.right-p.Right
btnrect.top=btnrect.top+p.Top
btnrect.bottom=btnrect.bottom-p.Bottom
btnrect.left=btnrect.right
(GetSystemMetrics(SM_CXVSCROLL-
(hdc=GetWindowDC(hwnd
FillRect hdc,btnrect
(GetSysColorBrush(COLOR_BTNFACE,
WM_NCPAINT=&H85
WM_NCCALCSIZE=&H83
* WM_NCCALCSIZE flags
WVR_ALIGNTOP=&H10
WVR_ALIGNLEFT=&H20
WVR_ALIGNBOTTOM=&H40
WVR_ALIGNRIGHT=&H80
WVR_HREDRAW=&H100
WVR_VREDRAW=&H200
(WVR_REDRAW=(WVR_HREDRAW+ WVR_VREDRAW
WVR_VALIDRECTS=&H400