When resizing a window i would like to detect when the left button is released (detecting when the drag operation is ended).
WM_LBUTTONUP is no good. Any ideas?
Regards
Peter
WM_LBUTTONUP is no good. Any ideas?
Regards
Peter
case %WM_NCLBUTTONUP msgbox "test"
CallBack Function HtmlProc() As Long Select Case CbMsg Case %WM_ACTIVATE Case %WM_INITDIALOG Case %WM_SIZE Control Send hDlg,hStatus, %WM_SIZE, cbwParam, cblParam Case %WM_COMMAND 'Insert most menu's etc here Select Case CBWParam End Select End Select End Function The mistake I have made in the past is putting the WM_SIZE under the WM_COMMAND, maybe not applicable to you, just adding my onion [img]http://www.powerbasic.com/support/forums/smile.gif[/img]
#Compile Exe #Dim All #Register None #Include "win32api.inc" CallBack Function DlgProc Static x As Long, y As Long Select Case CbMsg Case %WM_SIZING: x = 1: y = SetTimer(CbHndl, 1, 250, ByVal 0) Case %WM_TIMER: If x = 1 Then KillTimer CbHndl, y: x = 0: MsgBox "ok" End Select End Function Function PbMain Local hDlg As Long Dialog New %HWND_DESKTOP, "", , , 400, 200, %WS_CAPTION Or %WS_SYSMENU Or %WS_THICKFRAME To hDlg Dialog Show Modal hDlg Call DlgProc End Function
... CASE %WM_SIZE SendMessage hStatus, wMsg, wParam, lParam SendMessage hToolTop, wMsg, wParam, lParam CALL SizeDockChild() CALL SizeClient() ... '----------------------------------------------------------- 'Resize Client window to snuggly fit the Frame window '----------------------------------------------------------- SUB SizeClient() LOCAL cRect AS RECT LOCAL ToolHeight AS LONG LOCAL StatHeight AS LONG LOCAL DockHeight AS LONG LOCAL ChildHeight AS LONG LOCAL ChildWidth AS LONG '--- 'fill up RECT structure 'for ref'=>nLeft(x), nTop(y), nRight(cx), nBottom(cy) '--- GetWindowRect hToolTop, cRect ToolHeight = cRect.nBottom - cRect.nTop GetWindowRect hStatus, cRect StatHeight = cRect.nBottom - cRect.nTop IF fDockFloat = 1 Then GetWindowRect hWndDockFloat, cRect DockHeight = cRect.nBottom - cRect.nTop End If If fDockChild = 1 Then GetWindowRect hWndDockChild, cRect ChildHeight = cRect.nBottom - cRect.nTop ChildWidth = cRect.nRight - cRect.nleft End If GetClientRect hWnd, cRect MoveWindow hwndClient, _ cRect.nLeft + ChildWidth, _ ToolHeight + DockHeight, _ cRect.nRight - ChildWidth, _ cRect.nBottom - (ToolHeight + StatHeight + DockHeight), _ %TRUE '**Resize to Client any Max'd child windows not docked 'I found that using the MoveWindow when a window is Maximized 'gives the window a border in its Maximized state. If IsZoomed(hWndChild) = %TRUE Then GetClientRect hWndClient, cRect MoveWindow hWndChild, cRect.nLeft,cRect.nTop, _ cRect.nRight,cRect.nBottom,%TRUE End IF END SUB '--- SUB SizeDockChild() IF fDockChild = 1 THEN Local cRect as RECT LOCAL ToolHeight AS LONG LOCAL StatHeight AS LONG LOCAL DockHeight AS LONG 'get StatHeight,ToolHeight,DockHeight GetWindowRect hToolTop, cRect ToolHeight = cRect.nBottom - cRect.nTop GetWindowRect hStatus, cRect StatHeight = cRect.nBottom - cRect.nTop IF fDockFloat = 1 Then GetWindowRect hWndDockFloat, cRect DockHeight = cRect.nBottom - cRect.nTop End If GetClientRect hWnd, cRect SetWindowPos hWndDockChild,hWnd,cRect.nLeft, _ cRect.nTop+(ToolHeight + DockHeight),80,cRect.nBottom _ -(StatHeight + ToolHeight + DockHeight), _ %SWP_NOZORDER OR %SWP_DRAWFRAME UpdateWindow hWndDockChild END IF END SUB
CASE %WM_SIZE IF IsLButtonDown() = %FALSE THEN ... Now do the resizing of the child window/control. ELSE ... Resizing continues! END IF
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment