madhatter2002
Programmer
does anybody know how to add a status bar to the default vfp screen using no forms but just the default scree (_screen)?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
PROCEDURE ClearToolbarMover
LPARAMETERS toToolbarRef, tnParenthWnd
*toToolbarRef toolbar reference
*tnParenthWnd _VFP or top level form(if toolbar is docked there) hwnd property
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