oT = newobject('{sometoolbar}','{toolbarclasslib}') oT.Dock(0) ClearToolbarMover(oT, _VFP.hWnd)The code:
PROCEDURE ClearToolbarMover LPARAMETERS toToolbarRef, tnParenthWnd *toToolbarRef toolbar reference *tnParenthWnd screen or top level form hwnd property value IF toToolbarRef.DockPosition = -1 RETURN ENDIF LOCAL i,j DeclareAPI() lnToolbarHwnd = GetToolbarHwnd(toToolbarRef, tnParenthWnd) &&get toolbar hWnd thDC = GetWindowDC(lnToolbarHwnd) &&get toolbar DC DO case CASE INLIST(toToolbarRef.DockPosition,0,3) FOR i=2 TO 6 FOR j=2 TO toToolbarRef.height - 4 setpixel(thDC,i,j,toToolbarRef.backcolor) NEXT NEXT CASE INLIST(toToolbarRef.DockPosition,1,2) FOR i=2 TO toToolbarRef.width - 4 FOR j=2 TO 6 setpixel(thDC,i,j,toToolbarRef.backcolor) NEXT NEXT ENDCASE ReleaseDC(thDC,lnToolbarHwnd) CLEAR DLLS "GetWindow","GetWindowText","GetWindowDC","SetPixel","ReleaseDC" RETURN PROCEDURE GetToolbarHwnd PARAMETERS toToolbarRef, tnParenthWnd lcToolbarCaption = toToolbarRef.Caption IF VARTYPE(tnParenthWnd) = 'L' lnVFPHnd = _VFP.hWnd ELSE lnVFPHnd = tnParenthWnd ENDIF lnToolbarWhnd = 0 GetWindows(lnVFPHnd, 0,0) RETURN lnToolbarWhnd PROCEDURE GetWindows LPARAMETERS lnHandle,lnParent,lnLevel #DEFINE GW_HWNDNEXT 2 #DEFINE GW_CHILD 5 LOCAL WinCaption, hWindow, hParent, lvl LOCAL hChild, oChild, hNext, oNext WinCaption = '' hWindow = 0 hParent = 0 lvl = 0 IF lnHandle = 0 RETURN .F. ENDIF lvl = lnLevel hWindow = lnHandle hParent = lnParent WinCaption = GetWinText(lnHandle) IF TRIM(WinCaption) = TRIM(lcToolbarCaption) lnToolbarWhnd = hWindow endif hChild = GetWindow(hWindow, GW_CHILD) oChild = GetWindows( hChild, hWindow, lvl+1) IF lnParent <> 0 hNext = GetWindow(hWindow, GW_HWNDNEXT) oNext = GetWindows(hNext, hParent, lvl) ENDIF FUNCTION GetWinText(hWindow) LOCAL lcBuffer, lnResult lcBuffer = Space(250) lnResult = GetWindowText(hWindow, @lcBuffer, Len(lcBuffer)) RETURN Left(lcBuffer, lnResult) FUNCTION DeclareAPI DECLARE INTEGER GetWindow IN user32 INTEGER hwnd, INTEGER wFlag DECLARE INTEGER GetWindowText IN user32; INTEGER hwnd, STRING @lpString, INTEGER cch DECLARE INTEGER SetPixel IN gdi32 integer hDc, INTEGER x, INTEGER y, INTEGER nColor DECLARE INTEGER GetWindowDC IN user32 INTEGER hwnd DECLARE INTEGER ReleaseDC IN user32 INTEGER hwnd, INTEGER hdc>Hi Everyone,