I have managed to solve my problem with the following code:
Code:
CallBack Function DlgProc Select Case CbMsg Case %WM_INITDIALOG RetMouseHook = SetWindowsHookEx(%WH_MOUSE, CodePtr(MouseHook), 0, GetCurrentThreadId) Case %WM_DESTROY: UnhookWindowsHookEx RetMouseHook End Select End Function Function MouseHook(ByVal iCode As Integer, ByVal wParam As Long, ByVal lParam As Long) As Dword Static LButtonDown as long If iCode = %HC_ACTION Then Select Case wParam Case %WM_LBUTTONDOWN LButtonDown = %True Case %WM_LBUTTONUP LButtonDown = %False Case %WM_MOUSEMOVE if LButtonDown = %True then SendMessage hDlg, %WM_NCLBUTTONDOWN, %HTCAPTION, BYVAL %NULL end if End Select End If Function = CallNextHookEx(RetMouseHook, iCode, wParam, lParam) End Function
Leave a comment: