$INCLUDE "Rapidq.inc"
$TYPECHECK ON
DECLARE FUNCTION GetDesktopWindow LIB "user32"
ALIAS "GetDesktopWindow" () AS LONG
DECLARE FUNCTION GetDC LIB "user32" ALIAS "GetDC" (BYVAL hwnd AS _
LONG) AS LONG
DECLARE FUNCTION StretchBlt LIB "gdi32" ALIAS "StretchBlt" _
(BYVAL hdc AS LONG, _
BYVAL x AS LONG, _
BYVAL y AS LONG, _
BYVAL nWidth AS LONG, _
BYVAL nHeight AS LONG, _
BYVAL hSrcDC AS LONG, _
BYVAL xSrc AS LONG, _
BYVAL ySrc AS LONG, _
BYVAL nSrcWidth AS LONG, _
BYVAL nSrcHeight AS LONG, _
BYVAL dwRop AS LONG) AS LONG
CONST SRCCOPY = &HCC0020
CONST SRCAND = &H8800C6
CONST SRCINVERT = &H660046
DIM Bitmap AS QBITMAP
Bitmap.Width = Screen.Width
Bitmap.Height = Screen.Height
Bitmap.PixelFormat = pf24bit
DECLARE SUB Form_Load (Form AS QFORM)
DECLARE SUB Form_Paint (Sender AS QFORM)
DECLARE SUB Form_KeyDown
CREATE form AS QFORM
Width = Screen.Width
Height = Screen.Height
BorderStyle=bsNone
Hint = "Press a Key to exit"
ShowHint = True
OnShow = Form_Load
OnPaint = Form_Paint
OnKeyDown = Form_KeyDown
Center
CREATE Image AS QIMAGE
Width=Form.ClientWidth
Height=Form.ClientHeight
AutoSize=1
Stretch = True
BMP=Image.BMP
END CREATE
SHOWMODAL
END CREATE
SUB Form_Load
DIM a AS LONG
DIM b AS LONG
a = GetDesktopWindow()
b = GetDC(a)
StretchBlt(Bitmap.Handle, 0, 0, Screen.Width, Screen.Height, b, 0, _
Screen.Height, Screen.Width, -Screen.Height, SRCCOPY)
Image.BMP=Bitmap.BMP
END SUB
SUB Form_Paint
DIM R AS QRECT
R.Left = Image.Left
R.Top = Image.Top
R.Right = Image.Width
R.Bottom = Image.Height
Sender.StretchDraw(R, Image.BMP)
END SUB
SUB Form_KeyDown(KeyCode AS INTEGER, Shift AS INTEGER)
END
END SUB
|