$TYPECHECK ON
CONST crlf = CHR$(13) + CHR$(10)
$DEFINE Bool INTEGER
CONST True = 1
CONST False = 0
$INCLUDE "Win32_constants.inc"
$INCLUDE "C_Constants.inc"
$INCLUDE "Functions.inc"
CONST White = 16777215
CONST Black = 0
CONST Blue = 16711680
CONST Red = 255
DIM apii AS LONG
DIM apiout AS LONG
DIM winhandle AS LONG
DECLARE FUNCTION CreateWindowEx LIB "USER32" ALIAS "CreateWindowExA" _
(ExStyle&, ClassName$, WindowName$, Style&, X&, Y&, _
Width&, Height&, WndParent&, hMenu&, hInstance&, Param&) AS LONG
DECLARE FUNCTION GetModuleHandle LIB "KERNEL32" ALIAS "GetModuleHandleA" _
(ModuleName AS STRING) AS LONG
DECLARE FUNCTION DestroyWindow LIB "user32" ALIAS "DestroyWindow" _
(BYVAL hwnd AS LONG) AS LONG
DECLARE FUNCTION SetParent LIB "user32" ALIAS "SetParent" _
(BYVAL hWndChild AS LONG, BYVAL hWndNewParent AS LONG) AS LONG
DECLARE FUNCTION FlashWindow LIB "user32" ALIAS "FlashWindow" _
(BYVAL hwnd AS LONG, BYVAL bInvert AS LONG) AS LONG
DECLARE FUNCTION ShowWindow LIB "user32" ALIAS "ShowWindow" _
(BYVAL hwnd AS LONG, BYVAL nCmdShow AS LONG) AS LONG
DECLARE FUNCTION SetWindowLong LIB "user32" ALIAS "SetWindowLongA" _
(BYVAL hwnd AS LONG, BYVAL nIndex AS LONG, BYVAL dwNewLong AS LONG) AS LONG
DECLARE SUB showwin
DECLARE SUB chiudi
DECLARE SUB resize
DIM Form AS QFORM
WITH form
.center
.width = 400
.onshow = Showwin
END WITH
Form.onresize = resize
Form.onclose = chiudi
Form.SHOWMODAL
SUB showwin
apii = CmUnregister()
apii = CMRegister(CM_VERSION)
winhandle = CreateWindowEx(0, _
"CodeSense", "", WS_VISIBLE OR WS_CHILD, _
40, 60, 200, 100, Form.handle, _
0, GetModuleHandle(COMMAND$(0)), 0)
ShowWindow(winhandle, 3)
DIM language AS STRING
RegisterRapidQLanguage
Cm_SetLanguage (winhandle, "RapidQ")
CM_EnableLeftMargin(winhandle, False)
CM_EnableColorSyntax (winhandle, 1)
DIM ColorSet AS CM_Colors
WITH Colorset
.crWindow = White
.crLeftMargin = 14079702
.crBookmark = 0
.crBookmarkBk = 0
.crText = Black
.crTextBk = -1
.crNumber = Red
.crNumberBk = White
.crKeyword = Blue
.crKeywordBk = -1
.crOperator = Red
.crOperatorBk = White
.crScopeKeyword = Red
.crScopeKeywordBk = White
.crComment = 11447982
.crCommentBk = White
.crString = 8421440
.crStringBk = White
.crTagText = 256
.crTagTextBk = White
.crTagEntity = 256
.crTagEntityBk = White
.crTagElementName = 256
.crTagElementNameBk = White
.crTagAttributeName = 256
.crTagAttributeNameBk = White
.crLineNumber = Black
.crLineNumberBk = .crLeftMargin
.crHDividerLines = 8421440
.crVDividerLines = 256
.crHighlightedLine = 256
END WITH
Cm_SetColors(winhandle, ColorSet)
DIM Fonts AS CM_FONTSTYLES
WITH Fonts
.byText = 0
.byNumber = 0
.byKeyword = 1
.byOperator = 1
.byScopeKeyword = 4
.byComment = 2
.byString = 2
.byTagText = 0
.byTagEntity = 0
.byTagElementName = 0
.byTagAttributeName = 0
.byLineNumber = 0
END WITH
Cm_SetFontStyles (winhandle, Fonts)
DIM LineNum AS CM_LINENUMBERING
WITH linenum
.bEnabled = True
.nStartAt = 1
.dwStyle = CM_DECIMAL
END WITH
Cm_SetLineNumbering(winhandle, Linenum)
END SUB
SUB chiudi
apii = CmUnregister
DestroyWindow(winhandle)
END SUB
SUB resize
Setparent(winhandle, form.handle)
ShowWindow(winhandle, 0)
ShowWindow(winhandle, 3)
END SUB
|