Post by Walt Decker on Feb 12, 2022 14:34:38 GMT -5
There are a number of ways to scroll a memory bitmap in a window. I have chosen to scroll a memory bitmap based on the position of the mouse cursor relative to the borders of a graphic control.
If you have questions about the code, please ask.
'
VK.LBUTTON = 01 '<--- left mouse button
VK.RBUTTON = 02 '<--- right mouse button
OPEN "User32.DLL" FOR DLL AS #USER
OPEN "Gdi32.DLL" FOR DLL AS #GDI
RetVal = 0 '<--- dummy varb
GfxHndl = 0 '<--- graphic control handle
GfxDc = 0 '<--- graphic control device context
DktCmDc = 0 '<--- private device context
MemBmp = 0 '<--- DIB memory bitmap handle
OldBmp = 0 '<--- Original memory bitmap handle
GfxWide = 0 'width and height of graphic control canvas area
GfxHigh = 0
WinTag$ = "" '<--- name of parent window
GfxTag$ = "" '<--- name of graphic control
RetVal = FN.Instruct() '<--- beginning instructions
[BEGIN.WAIT]
TIMER 100, [GET.VK.CODE] '<--- wait for right mouse button click
WAIT
[END.WAIT]
DktCmDc = FN.ScreenCapture(MemBmp, OldBmp) '<--- capture contents of
'monitor
GfxTag$ = FN.MakeWindow$(WinTag$) '<--- make display surface
GfxHndl = FN.GetHandle(GfxTag$) '<--- handle of graphic control
GfxDc = FN.GetDc(GfxHndl) '<--- device context of graphic control
GfxWide = DisplayWidth * .33 '<--- approx width/height of gfx ctrl
GfxHigh = DisplayHeight * .33
'<----------- copy a portion of monitor to graphic control --------->
RetVal = FN.Blt(GfxDc, 0, 0, INT(GfxWide), INT(GfxHigh), DktCmDc, 0, 0)
RetVal = FN.StickBmp(GfxTag$, GfxWide, GfxHigh) '<--- make it stick
RetVal = FN.ScrlInstr() '<--- scroll instructions
'<--------------- scroll routine ---------------------->
RetVal = FN.BeginScroll(GfxDc, DktCmDc, WinTag$, GfxTag$, OldBmp)
WAIT
END
'-----------------------------------------------------
'-----------------------------------------------------
[GET.VK.CODE]
Key = 0 '<--- return value from FN.KeyState
Key = FN.KeyState(VK.RBUTTON) '<--- get right mouse button state
IF Key THEN
TIMER 0
GOTO [END.WAIT]
END IF
GOTO [BEGIN.WAIT]
[END.VK.CODE]
'-----------------------------------------------------
'-----------------------------------------------------
SUB CLOSE.WIN WinHndl$
CLOSE #USER
CLOSE #GDI
CLOSE #WinHndl$
END
END SUB
'-----------------------------------------------------
'-----------------------------------------------------
FUNCTION FN.ScreenCapture(BYREF MemBmp, BYREF OldBmp)
'################################################################
'
' PURPOSE: Create a memory bitmap large enough to contain the
' monitor and copy the montior to the memory bitamp.
'
' ARGUMENTS:
' MemBmp: Handle of created memory bitmap.
'
' OldBmp: Handle of original bitmap
'
' The function returns the private device context for rendering
' the memory bitmap.
'
'################################################################
BmpWide = DisplayWidth '<--- width and height of desktop
BmpHigh = DisplayHeight
DktHndl = FN.DeskTop() '<--- desktop(monitor) handle
DktDc = FN.GetDc(DktHndl) '<--- desktop device context
MemBmp = FN.CreateDIB(BmpWide, BmpHigh) '<--- create memory DIB bitmap
DktCmDc = FN.CompatDc(DktDc) '<--- get a private device context
OldBmp = FN.AttachObj(DktCmDc, MemBmp) '<--- make DIB active
'<---------- copy desktop to memory bitmap ------------------>
RetVal = FN.Blt(DktCmDc, 0, 0, BmpWide, BmpHigh, DktDc, 0, 0)
DktDc = FN.DetachDc(DktHndl, DktDc) '<--- release the desktop context
FN.ScreenCapture = DktCmDc '<--- return private device context
END FUNCTION
'-----------------------------------------------------
'-----------------------------------------------------
FUNCTION FN.MakeWindow$(BYREF Tag$)
WS.BORDER = HEXDEC("&H00800000")
WS.THICKFRAME = HEXDEC("&H00040000")
WS.EX.TOPMOST = HEXDEC("&H00000008")
Tag$ = "#CAP"
GfxHndl = 0
BmWide = INT(DisplayWidth * .33)
BmHigh = INT(DisplayHeight * .33)
STYLEBITS #CAP.GFX, 0, WS.BORDER, 0, 0
GRAPHICBOX #CAP.GFX, 5, 5, BmWide, BmHigh
STYLEBITS #CAP, 0, WS.THICKFRAME, WS.EX.TOPMOST, 0
UpperLeftX = 50
UpperLeftY = 50
WindowWidth = BmWide + 15
WindowHeight = BmHigh + 38
OPEN "SCROLL DEMO" FOR WINDOW AS #CAP
PRINT #CAP, "TRAPCLOSE CLOSE.WIN"
'<----- work-around for LB parser bug -------->
PRINT #CAP.GFX, "LOCATE 5 5 ";BmWide;" ";BmHigh
PRINT #CAP, "REFRESH"
FN.MakeWindow$ = "#CAP.GFX"
END FUNCTION
'-----------------------------------------------------
'-----------------------------------------------------
FUNCTION FN.StickBmp(GfxTag$, BmpWide, BmpHigh)
'##############################################################
' makes a bitblted image permenant
'##############################################################
PRINT #GfxTag$, "getbmp DIB 0 0 ";BmpWide;" ";BmpHigh
PRINT #GfxTag$, "drawbmp DIB 0 0"
PRINT #GfxTag$, "flush"
PRINT #GfxTag$, "discard"
UNLOADBMP "DIB"
END FUNCTION
'-----------------------------------------------------
'-----------------------------------------------------
FUNCTION FN.BeginScroll(DestDc, SrcDc, WinTag$, GfxTag$, OrgBmp)
'#################################################################
'
' PURPOS: Scroll a memory bitmap in a graphic control based on the
' position of the mouse cursor.
'
' ARGUMENTS:
' DestDc: Device context of graphic control
' SrcDc: Priveate device context to which the bmp is attached
' WinTag$: Name of parent window
' GfxTag$: Name of graphic control
' OrgBmp: Handle of original memory bitmap
'
'#################################################################
VK.LBUTTON = 01 '<--- left mouse button
VK.RBUTTON = 02 '<--- right mouse button
WinHndl = 0 '<--- parent window handle
GfxHndl = 0 '<--- graphic control handle
RetVal = 0 '<--- dummy variable
GfxSzx = 0 '<--- graphic control canvas size
GfxSzy = 0
HorzSzx = 0 '<--- scroll offset factors
VertSzy = 0
Key = 0 '<--- return value from FN.KeyState()
ScrlPosX = 0 '<--- where to begin scrolling in memory bitmap
ScrlPosY = 0
LstPosX = 0 '<--- last scroll position for calculations
LstPosY = 0
BmpWide = 0 '<--- size of memory bitmap
BmpHigh = 0
CursX = 0 '<--- where the mouse cursor is in the graphic control
CursY = 0
Done = 0 '<--- flag for exiting function
WinHndl = FN.GetHandle(WinTag$) '<--- handle of parent window
GfxHndl = FN.GetHandle(GfxTag$) '<--- handle of graphic control
BmpWide = DisplayWidth '<--- set width/height for calculations
BmpHigh = DisplayHeight
RetVal = FN.ClientSize(GfxHndl, GfxSzx, GfxSzy) '<--- get size of canvas
HorzSzx = INT(GfxSzx * 0.15 + 0.4) '<--- set scroll offsets
VertSzy = INT(GfxSzy * 0.15 + 0.4)
OPEN "Kernel32.dll" FOR DLL AS #KERN
CALLDLL #KERN, "Sleep", 500 AS LONG, RetVal AS VOID
PRINT "SCROLL.READY"
[SCROLL.READY]
SCAN
Key = FN.KeyState(VK.RBUTTON) '<--- check state of right mouse button
IF Key THEN
GOTO [SET.CAPTURE]
END IF
'<------- check to whether the parent is active ----->
CALLDLL #USER, "IsWindow", WinHndl AS ULONG, Done AS LONG
IF Done = 0 THEN
RetVal = FN.AttachObj(SrcDc, OrgBmp) '<--- release everything
RetVal = FN.KillDc(SrcDc)
RetVal = FN.DetachDc(GfxHndl, DestDc)
CLOSE #KERN
EXIT FUNCTION
END IF
CALLDLL #KERN, "Sleep", 100 AS LONG, RetVal AS VOID '<--- a wait
GOTO [SCROLL.READY]
[SET.CAPTURE]
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' Insure that the graphic control has the focus and capture
' the mouse so all mouse input is relative to the client
' area of the graphic control.
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
PRINT "SET CAPTURE"
CALLDLL #USER, "SetFocus", GfxHndl AS ULONG, RetVal AS LONG
CALLDLL #USER, "SetCapture", GfxHndl AS ULONG, RetVal AS LONG
[STRT.SCRL]
SCAN
RetVal = FN.CursorPos(CursX, CursY) '<--- where cursor is
RetVal = FN.ScreenToClient(GfxHndl, CursX, CursY) '<--- translate to
'graphic control
'coordinates
Done = 1
Key = FN.KeyState(VK.LBUTTON) '<--- state of left mouse button for exit
IF Key THEN Done = 0
[EXT.FUNC]
IF Done = 0 THEN '<--- release stuff
PRINT "DONE"
CALLDLL #USER, "ReleaseCapture", RetVal AS VOID
RetVal = FN.AttachObj(SrcDc, OrgBmp)
RetVal = FN.KillDc(SrcDc)
RetVal = FN.DetachDc(GfxHndl, DestDc)
CLOSE #KERN
EXIT FUNCTION
END IF
'<------------- check for active parent ------------->
CALLDLL #USER, "IsWindow", WinHndl AS ULONG, Done AS LONG
IF Done = 0 THEN GOTO [EXT.FUNC]
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' The following is not quite correct, but it mostly produces
' the desired effect of scrolling the memory bitmap on the
' graphic control canvas.
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
SELECT CASE
CASE (CursX >= GfxSzx) AND (CursX <= GfxSzx + HorzSzx)
ScrlPosX = LstPosX + HorzSzx '<--- calculate membmp scroll offset
IF ScrlPosX + GfxSzx > BmpWide THEN
GOTO [SCRL.END]
END IF
'<---------- display membmp scroll region ------------->
RetVal = FN.Blt(DestDc, 0, 0, GfxSzx, GfxSzy, SrcDc, ScrlPosX, ScrlPosY)
LstPosX = ScrlPosX
RetVal = FN.StickBmp(GfxTag$, GfxSzx, GfxSzy) '<--- make it permanent
CASE (CursX >= 0 - HorzSzx) AND (CursX <= 0)
ScrlPosX = LstPosX - HorzSzx
IF ScrlPosX < 0 THEN
GOTO [SCRL.END]
END IF
RetVal = FN.Blt(DestDc, 0, 0, GfxSzx, GfxSzy, SrcDc, ScrlPosX, ScrlPosY)
LstPosX = ScrlPosX
RetVal = FN.StickBmp(GfxTag$, GfxSzx, GfxSzy)
CASE (CursY >= GfxSzy) AND (CursY <= GfxSzy + VertSzy)
ScrlPosY = LstPosY + VertSzy
IF ScrlPosY + GfxSzy > BmpHigh THEN
GOTO [SCRL.END]
END IF
RetVal = FN.Blt(DestDc, 0, 0, GfxSzx, GfxSzy, SrcDc, ScrlPosX, ScrlPosY)
LstPosY = ScrlPosY
RetVal = FN.StickBmp(GfxTag$, GfxSzx, GfxSzy)
CASE (CursY >= 0 - VertSzy) AND (CursY <= 0)
ScrlPosY = LstPosY - VertSzy
IF ScrlPosY < 0 THEN
GOTO [SCRL.END]
END IF
RetVal = FN.Blt(DestDc, 0, 0, GfxSzx, GfxSzy, SrcDc, ScrlPosX, ScrlPosY)
LstPosY = ScrlPosY
RetVal = FN.StickBmp(GfxTag$, GfxSzx, GfxSzy)
END SELECT
[SCRL.END]
CALLDLL #KERN, "Sleep", 50 AS LONG, RetVal AS VOID
GOTO [STRT.SCRL]
END FUNCTION
'-----------------------------------------------------
'-----------------------------------------------------
FUNCTION FN.DeskTop()
'######################################################################
' Get a handle to the monitor
'######################################################################
DtHndl = 0
CALLDLL #USER, "GetDesktopWindow", DtHndl AS ULONG
FN.DeskTop = DtHndl
END FUNCTION
'---------------------------------------------------------------
'---------------------------------------------------------------
FUNCTION FN.GetDc(WinHndl)
'######################################################################
' Get a context from MSWIN for the device (form window, control,
' printer, audio, external device).
'######################################################################
WinDc = 0
CALLDLL #USER, "GetDC", WinHndl AS ULONG, WinDc AS ULONG
FN.GetDc = WinDc
END FUNCTION
'---------------------------------------------------------------
'---------------------------------------------------------------
FUNCTION FN.CompatDc(WinDc)
'######################################################################
' Create a context compatible with a device.
'
' ARGUMENTS:
' WinDc: Device context.
' Do NOT use user32.dll ReleaseDC(), use gdi32.DLL
' DeleteDC() instead.
'######################################################################
ComPatDc = 0
CALLDLL #GDI, "CreateCompatibleDC", WinDc AS ULONG, ComPatDc AS ULONG
FN.CompatDc = ComPatDc
END FUNCTION
'-------------------------------------------------------------------
'-------------------------------------------------------------------
FUNCTION FN.CreateDIB(BmWide, BmHigh)
'##############################################################
' Create a device independant bit map. The bitmap data will
' be in the form of blue, green, red instead of red, green
' blue.
'
' ARGUMENTS:
' BmpWide: Size of the bitmap
' BmpHigh:
'##############################################################
BI.RGB = 0 '<--- type codes
DIB.RGB.COLORS = 0
STRUCT tBmInfo, _ '<--- bitmap information structure
StrSize AS ULONG, _ '<--- size of structure
Width AS LONG, _ '<--- width of bitmap
Height AS LONG, _ '<--- height of bitmap
Planes AS SHORT, _ '<--- number of color planes
BitCount AS SHORT, _ '<--- number of bits to define colors
Compression AS ULONG, _ '<--- type of compression
SizeImage AS ULONG, _ '<--- size of image
XPelsPerMeter AS LONG, _ '<--- number of pixels per meter
YPelsPerMeter AS LONG, _
ClrUsed AS ULONG, _ '<--- number of colors in the bitmap
ClrImportant AS ULONG, _ '<--- important colors
Colors AS ULONG '<--- array of color in BRG format
RetVal = 0
BmpHndl = 0
DispHndl = FN.DeskTop() '<--- get a handle to the desktop window
DispDc = FN.GetDc(DispHndl) '<--- get a device context for desktop
Tmpdc = FN.CompatDc(DispDc) '<--- create a compatible context
RetVal = FN.DetachDc(DispHndl, DispDc) '<--- release the desktop context
tBmInfo.StrSize.struct = LEN(tBmInfo.struct)
tBmInfo.Width.struct = BmWide
tBmInfo.Height.struct = -1 * BmHigh '<--- top-down instead of bottom up
tBmInfo.Planes.struct = 1
tBmInfo.BitCount.struct = 32
tBmInfo.Compression.struct = BI.RGB
CALLDLL #GDI, "CreateDIBSection", Tmpdc AS ULONG, tBmInfo AS STRUCT, _
DIB.RGB.COLORS AS LONG, 0 AS LONG, 0 AS LONG, 0 AS LONG, _
BmpHndl AS ULONG
RetVal = FN.KillDc(Tmpdc)
FN.CreateDIB = BmpHndl
END FUNCTION
'--------------------------------------------------------------
'--------------------------------------------------------------
FUNCTION FN.KillDc(WinDc)
'############################################################
' Destroy a device context and release WIN resources
'
' ARGUMENTS:
' WinDc: Device context to destroy.
' Do NOT use this function to destroy a device
' context obtained with the GetDC() function.
'############################################################
RetVal = 0
CALLDLL #GDI, "DeleteDC", WinDc AS ULONG, RetVal AS VOID
END FUNCTION
'-----------------------------------------------------------------
'-----------------------------------------------------------------
FUNCTION FN.DetachDc(WinHndl, WinDc)
'######################################################################
' Release a device context and its resources
'
' ARGUMENTS:
' WinHndl: The handle of a form window or control.
' WinDc: Device context obtained from GetDc().
'######################################################################
RetVal = 0
CALLDLL #USER, "ReleaseDC", WinHndl AS ULONG, WinDc AS ULONG, RetVal AS VOID
END FUNCTION
'---------------------------------------------------------------
'---------------------------------------------------------------
FUNCTION FN.AttachObj(WinDc, ThisObject)
'######################################################################
' Make an object (pen, brush, font, bitmap) active.
'
' ARGUMENTS:
' WinDc: Device context handle
' ThisObject: Object to make active.
'######################################################################
OrgObj = 0
CALLDLL #GDI, "SelectObject", WinDc AS ULONG, ThisObject AS ULONG, _
OrgObj AS ULONG
FN.AttachObj = OrgObj
END FUNCTION
'---------------------------------------------------------------
'---------------------------------------------------------------
FUNCTION FN.KillObj(ThisObj)
'######################################################################
' Destroy an object (brush, pen, font) and release its resources
'######################################################################
DeadObj = 0
CALLDLL #GDI, "DeleteObject", ThisObj AS ULONG, DeadObj AS VOID
END FUNCTION
'---------------------------------------------------------------
'---------------------------------------------------------------
FUNCTION FN.GetHandle(WinTag$)
'###########################################################
' Return the numeric handle of a Liberty Basic form window
' or control.
' ARGUMENTS:
' WinTag$: Form window tag or control tag.
' EXAMPLE: #1, #1.TXB, #1.GFX
'###########################################################
Hndl = 0 '<--- numeric handle returned from LB's HWND() function
'<------------------ check for proper syntax --------------->
WinTag$ = FN.CheckTag$(WinTag$)
Hndl = HWND(#WinTag$) '<--- get numeric handle
FN.GetHandle = Hndl '<--- return handle
END FUNCTION
'---------------------------------------------------------------------
'---------------------------------------------------------------------
FUNCTION FN.CheckTag$(Tag$)
IF LEFT$(Tag$, 1) <> "#" THEN Tag$ = "#" + Tag$
FN.CheckTag$ = Tag$
END FUNCTION
'---------------------------------------------------------------------
'---------------------------------------------------------------------
FUNCTION FN.KeyState(Vkey)
'################################################################
' Determine whether Vkey is pressed
'################################################################
VK.SHIFT = HEXDEC("&H10") '<--- keyboard shift key
VK.CONTROL = HEXDEC("&H11") '<--- keyboard control key
KeyPressed = 0
Value = 0
Mask = HEXDEC("&H8000") '<--- value used to determine if the
'pressed bit is set
'<--- the following checks to see if 2 keys are pressed at the same time --->
CALLDLL #USER, "GetAsyncKeyState", VK.SHIFT AS LONG, KeyPressed AS SHORT
IF KeyPressed AND Mask THEN
CALLDLL #USER, "GetAsyncKeyState", Vkey AS LONG, KeyPressed AS SHORT
IF KeyPressed AND Mask THEN
FN.KeyState = 2
EXIT FUNCTION
END IF
END IF
CALLDLL #USER, "GetAsyncKeyState", VK.CONTROL AS LONG, KeyPressed AS SHORT
IF KeyPressed AND Mask THEN
CALLDLL #USER, "GetAsyncKeyState", Vkey AS LONG, KeyPressed AS SHORT
IF KeyPressed AND Mask THEN
FN.KeyState = 2
EXIT FUNCTION
END IF
END IF
'<--- only the Vkey parameter is pressed ----------->
CALLDLL #USER, "GetAsyncKeyState", Vkey AS LONG, KeyPressed AS SHORT
IF KeyPressed AND Mask THEN FN.KeyState = KeyPressed
END FUNCTION
'------------------------------------------------------------------
'------------------------------------------------------------------
FUNCTION FN.CursorPos(BYREF Cpx, BYREF Cpy)
'################################################################
' Retrieve the position of the mouse cursor. The position is
' in screen coordinates.
'################################################################
STRUCT tPnt, _
X AS LONG, _
Y AS LONG
RetVal = 0
CALLDLL #USER, "GetCursorPos", tPnt AS STRUCT, RetVal AS VOID
Cpx = tPnt.X.struct
Cpy = tPnt.Y.struct
END FUNCTION
'------------------------------------------------------------------
'------------------------------------------------------------------
FUNCTION FN.ScreenToClient(WinHndl, BYREF Pntx, BYREF Pnty)
'############################################################
' Translate screen coordinte to window coordinate
'############################################################
STRUCT tPnt, _
X AS LONG, _
Y AS LONG
RetVal = 0
tPnt.X.struct = Pntx
tPnt.Y.struct = Pnty
CALLDLL #USER, "ScreenToClient", WinHndl AS ULONG, tPnt AS STRUCT, _
RetVal AS VOID
Pntx = tPnt.X.struct
Pnty = tPnt.Y.struct
END FUNCTION
'------------------------------------------------------------------
'------------------------------------------------------------------
FUNCTION FN.ClientSize(WinHndl, BYREF Brx, BYREF Bry)
'###########################################################
' Get the client area of a window. The client area is
' that area which is not border, sizing frame, or caption.
'###########################################################
STRUCT tRect, _
X AS LONG, _
Y AS LONG, _
X1 AS LONG, _
Y1 AS LONG
RetVal = 0
CALLDLL #USER, "GetClientRect", WinHndl AS ULONG, tRect AS STRUCT, _
RetVal AS VOID
Brx = tRect.X1.struct
Bry = tRect.Y1.struct
END FUNCTION
'-------------------------------------------------------------------
'-------------------------------------------------------------------
FUNCTION FN.Blt(DestDc, Dx, Dy, Wide, High, SrcDc, Sx, Sy)
'###################################################################
' Display a memory bitmap on a form window or control OR
' place a memory bitmap on another memory bitmap.
'
' ARGUMENTS:
' DestDc: Device context that receives the memory bitmap
' Dx, Dy: Where the memory bitmap will be placed
' Wide: How much of the receiving DC will be covered
' High:
' SrcDc: Device context that supplies the image
' Sx, Sy: Coordinate from which to draw the image.
' Drawing will start here and continue until
' the destination size is filled or the size
' of the source is reached.
'####################################################################
SRCCOPY = HEXDEC("&H00CC0020") '<--- raster operation code
RetVal = 0
CALLDLL #GDI, "BitBlt", DestDc AS ULONG, Dx AS LONG, Dy AS LONG, _
Wide AS LONG, High AS LONG, SrcDc AS ULONG, _
Sx AS LONG, Sy AS LONG, SRCCOPY AS ULONG, RetVal AS LONG
FN.Blt = RetVal
END FUNCTION
'-------------------------------------------------------------
'-------------------------------------------------------------
FUNCTION FN.MsgBox(Title$, Msg$)
MB.OK = HEXDEC("&h00000000")
MB.ICONINFORMATION = HEXDEC("&h00000040")
MB.DEFBUTTON1 = HEXDEC("&h00000000")
MB.SYSTEMMODAL = HEXDEC("&h00001000")
MB.TASKMODAL = HEXDEC("&h00002000")
MB.SETFOREGROUND = HEXDEC("&h00010000")
MB.TOPMOST = HEXDEC("&h00040000")
Style = MB.OK OR MB.DEFBUTTON1 OR MB.TASKMODAL OR MB.SETFOREGROUND OR _
MB.TOPMOST OR MB.ICONINFORMATION
CALLDLL #USER, "MessageBoxA", 0 AS ULONG, Msg$ AS PTR, Title$ AS PTR, _
Style AS ULONG, RetVal AS VOID
END FUNCTION
'------------------------------------------------------------
'------------------------------------------------------------
FUNCTION FN.Instruct()
RetVal = 0
Msg$ = ""
CRLF$ = CHR$(13) + CHR$(10)
Msg$ = "To obtain an image of the desktop without other " + CRLF$
Msg$ = Msg$ + "applications:" + CRLF$
Msg$ = Msg$ + "1. Minimize all visible windows." + CRLF$
Msg$ = Msg$ + "2. Click the right mouse button anywhere on the screen" _
+ CRLF$ + CRLF$
Msg$ = Msg$ + "NOTE: Be careful not to click on one of the desktop icons"
RetVal = FN.MsgBox("INSTRUCTIONS", Msg$)
END FUNCTION
'----------------------------------------------------------------
'----------------------------------------------------------------
FUNCTION FN.ScrlInstr()
RetVal = 0
Msg$ = ""
CRLF$ = CHR$(13) + CHR$(10)
Msg$ = "TO BEGIN SCROLLING:" + CRLF$ + CRLF$
Msg$ = Msg$ + "1: Move the mouse cursor to a position on the " + CRLF$
Msg$ = Msg$ + " graphic control." + CRLF$
Msg$ = Msg$ + "2. Click the RIGHT mouse button." + CRLF$
Msg$ = Msg$ + "3. Move the mouse cursor to one of the borders." + CRLF$
Msg$ = Msg$ + " The image will scroll based on the border " + CRLF$
Msg$ = Msg$ + " at which the cursor is or beyond." + CRLF$ + CRLF$
Msg$ = Msg$ + "4. To exit scrolling, click the LEFT mouse button"
RetVal = FN.MsgBox("SCROLLING", Msg$)
END FUNCTION
'