CONST WM_USER=&H400
CONST EM_SETPARAFORMAT=WM_USER+71
CONST PFM_TABSTOPS=&H10
TYPE _paraformat
cbSize AS SHORT
wPad1 AS SHORT
dwMask AS DWORD
wNumbering AS WORD
wReserved AS WORD
dxStartIndent AS LONG
dxRightIndent AS LONG
dxOffset AS LONG
wAlignment AS WORD
cTabCount AS SHORT
rgxTabs(31) AS LONG
END TYPE
DECLARE FUNCTION SendMessageA LIB "user32" ALIAS "SendMessageA" (hwnd _
AS LONG, wMsg AS LONG, wParam AS LONG, pf AS LONG) AS LONG
DECLARE SUB SetTabs
CREATE Form AS QFORM
Center
CREATE Edit AS QEDIT
Align=1
Text=".5"
END CREATE
CREATE Button AS QBUTTON
Align=1
CAPTION="Set Tabs"
OnClick=SetTabs
END CREATE
CREATE RichEdit AS QRICHEDIT
Align=5
WordWrap=0
WantTabs=1
ScrollBars=3
END CREATE
SHOWMODAL
END CREATE
SUB SetTabs
DIM Mem AS QMEMORYSTREAM
DIM pf AS _paraformat
Mem.Position=0
Mem.WriteUdt pf
pf.cbSize=Mem.Size
pf.dwMask=PFM_TABSTOPS
pf.cTabCount=32
TabSpace=VAL(Edit.Text)*1440
FOR x=0 TO 31
pf.rgxTabs(x)=TabSpace*x
NEXT x
Mem.Position=0
Mem.WriteUdt pf
SendMessageA(RichEdit.Handle, EM_SETPARAFORMAT, 0, Mem.Pointer)
Mem.CLOSE
END SUB
|