$INCLUDE "Rapidq.inc"
$IFNDEF TRUE
$DEFINE True 1
$ENDIF
$IFNDEF FALSE
$DEFINE False 0
$ENDIF
$IFNDEF boolean
$DEFINE boolean INTEGER
$ENDIF
DECLARE FUNCTION LoadLibrary LIB "KERNEL32" ALIAS "LoadLibraryA" _
(LibFileName AS STRING) AS LONG
DIM hInst AS LONG
$DEFINE HWND INTEGER
CONST WS_EX_CLIENTEDGE = &H200
CONST WS_CHILD = &H40000000
CONST WS_VISIBLE = &H10000000
CONST WS_BORDER = &H800000
CONST SW_HIDE = 0
CONST SW_SHOW = 5
DECLARE FUNCTION CreateRichEdit LIB "USER32" ALIAS "CreateWindowExA" _
(ExStyle&, ClassName$, WindowName$, Style&, X&, Y&, _
Width&, Height&, WndParent&, hMenu&, hInstance&, Param&) AS LONG
DECLARE FUNCTION MoveRichEdit LIB "user32" ALIAS "MoveWindow" _
(hwnd AS LONG,x AS INTEGER,y AS INTEGER,nWidth AS INTEGER, _
nHeight AS INTEGER,bRepaint AS LONG) AS LONG
DECLARE FUNCTION ShowRichEdit LIB "user32" ALIAS "ShowWindow" _
(hwnd AS LONG,nCmdShow AS LONG) AS LONG
hInst = LoadLibrary("RICHED32.DLL")
TYPE QRichEdit_api EXTENDS QOBJECT
PUBLIC:
PARENT AS INTEGER PROPERTY SET SetParent
left AS SHORT PROPERTY SET SetLeft
Top AS SHORT PROPERTY SET SetTop
Width AS SHORT PROPERTY SET SetWidth
Height AS SHORT PROPERTY SET SetHeight
Visible AS boolean PROPERTY SET SetVisible
Handle AS INTEGER
PROPERTY SET SetVisible(visible AS boolean)
QRichedit_api.visible=visible
IF visible=0 THEN
ShowRichedit(QRichEdit_api.Handle,SW_HIDE)
ELSE
ShowRichedit(QRichEdit_api.Handle,SW_SHOW)
END IF
END PROPERTY
PROPERTY SET SetLeft(left AS SHORT)
QRichEdit_api.Left=left
MoveRichEdit(QRichEdit_api.Handle,QRichEdit_api.Left,QRichEdit_api.Top,QRichEdit_api.Width,QRichEdit_api.Height,true)
END PROPERTY
PROPERTY SET SetTop(top AS SHORT)
QRichEdit_api.Top=top
MoveRichEdit(QRichEdit_api.Handle,QRichEdit_api.Left,QRichEdit_api.Top,QRichEdit_api.Width,QRichEdit_api.Height,true)
END PROPERTY
PROPERTY SET SetWidth(width AS SHORT)
QRichEdit_api.Width=width
MoveRichEdit(QRichEdit_api.Handle,QRichEdit_api.Left,QRichEdit_api.Top,QRichEdit_api.Width,QRichEdit_api.Height,true)
END PROPERTY
PROPERTY SET SetHeight(height AS SHORT)
QRichEdit_api.Height=height
MoveRichEdit(QRichEdit_api.Handle,QRichEdit_api.Left,QRichEdit_api.Top,QRichEdit_api.Width,QRichEdit_api.Height,true)
END PROPERTY
PROPERTY SET SetParent(PARENT AS INTEGER)
QRichEdit_api.PARENT = PARENT
QRichEdit_api.Handle =CreateRichEdit(WS_EX_CLIENTEDGE,"RichEdit","RichEdit_API", _
WS_CHILD OR WS_VISIBLE OR WS_BORDER, _
QRichEdit_api.left, QRichEdit_api.top, QRichEdit_api.width,QRichEdit_api.height, _
QRichEdit_api.PARENT, 0, Application.hInstance,0)
QRichEdit_api.visible=0
END PROPERTY
CONSTRUCTOR
Left=65
Top=5
Width=200
Height=100
END CONSTRUCTOR
END TYPE
CREATE Form AS QFORM
CAPTION = "Form1"
top=300
Width = 300
Height = 200
END CREATE
DIM RichEdit1 AS QRICHEDIT_api
RichEdit1.PARENT=form.handle
PRINT RichEdit1.handle
Form.SHOWMODAL
|
|