DECLARE FUNCTION LoadLibrary LIB "KERNEL32" ALIAS "LoadLibraryA" _
(LibFileName AS STRING) AS LONG
DECLARE FUNCTION FreeLibrary LIB "KERNEL32" ALIAS "FreeLibrary" _
(hInst AS LONG) AS LONG
DECLARE FUNCTION CreateWindowEx LIB "USER32" ALIAS "CreateWindowExA" _
(ExStyle&, ClassName$, WindowName$, Style&, X&, Y&, _
Width&, Height&, WndParent&, hMenu&, hInstance&, Param&) 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 ES_LEFT = 0
CONST ES_AUTOHSCROLL = &H80
CONST ES_MULTILINE = &H4
CONST WM_COMMAND = &H111
DECLARE FUNCTION GetModuleHandle LIB "KERNEL32" ALIAS "GetModuleHandleA" _
(ModuleName AS STRING) AS LONG
DECLARE FUNCTION SetWindowText LIB "USER32" ALIAS "SetWindowTextA" _
(Hwnd AS INTEGER, Text AS STRING) AS LONG
DECLARE SUB FormWndProc (Handle AS INTEGER, uMsg AS LONG, wParam AS LONG,lParam AS LONG)
hInst = LoadLibrary("RICHED32.DLL")
DIM Form AS QFORM
Form.Center
Form.Width = 640
Form.Height =480
DIM EditHandle AS HWND
DIM ButtonHandle AS HWND
EditHandle = CreateWindowEx( _
WS_EX_CLIENTEDGE, "RichEdit", "RichEdit Program", _
WS_CHILD OR WS_VISIBLE OR WS_BORDER OR ES_LEFT OR _
ES_AUTOHSCROLL OR ES_MULTILINE, _
10,10,500,425, _
_
Form.Handle, _
_
5, GetModuleHandle("API_RichEdid.EXE"), 1 )
Form.CAPTION = "Api RichEdit"
Form.SHOWMODAL
SUB FormWndProc (Handle AS INTEGER, uMsg AS DWORD, wParam AS LONG, lParam AS LONG)
END SUB
|