Below is a small testbed program to remove the border around a LIST control
The hard work of figuring out which API calls to make was done by Dave Bratovich
PROGRAM
INCLUDE('svapi.INC'),ONCE
MAP
include('svapifnc.inc'),ONCE
RemoveBitMask (*LONG inoutValue, LONG xMask)
RemoveListBorder (LONG hwnd)
END
UI:View LONG(1)
LIST1:Queue QUEUE
Hi STRING(6)
There STRING(25)
END
Window WINDOW('Drop List Line Height'),AT(,,346,120),GRAY,SYSTEM,FONT('Segoe UI',8)
LIST,AT(30,18,150,16),USE(UI:View),CENTER,FONT(,16,,FONT:bold),DROP(4),FROM(|
'Show All|#1' & |
'|Show Openings|#2' & |
'|Show Verticals|#3' & |
'|Show Rebar|#4')
LIST,AT(30,39,208),USE(?LIST1),FLAT,FROM(LIST1:Queue),FORMAT(|
'44L(2)' & '|M' & '~Hi~' & '@S10@' |
& '20L(2)' & '|M' & '~There~' & '@S25@' |
)
BUTTON('Remove Border'),AT(261,39),USE(?RemoveBorder)
END
CODE
LOOP 10 TIMES
LIST1:Queue.Hi = ALL( CHR(64 + RECORDS(LIST1:Queue)) )
LIST1:Queue.There = ALL( CHR(96 + RECORDS(LIST1:Queue)) )
ADD(LIST1:Queue)
END
OPEN(Window)
ACCEPT
CASE ACCEPTED()
OF ?RemoveBorder; RemoveListBorder( ?List1{Prop:Handle} )
END
END
RemoveListBorder PROCEDURE(LONG hwnd)
!there are several equates used in this procedure, see SvAPI.inc for them
SWP_MySettings EQUATE( SWP_NOMOVE + SWP_NOSIZE + SWP_NOOWNERZORDER + SWP_NOZORDER + SWP_FRAMECHANGED )
NewStyle LONG,AUTO
CODE
NewStyle = GetWindowLong(hwnd,GWL_STYLE)
RemoveBitMask(NewStyle,WS_BORDER )
RemoveBitMask(NewStyle,WS_DLGFRAME )
RemoveBitMask(NewStyle,WS_THICKFRAME )
SetWindowLong(hwnd,GWL_STYLE,NewStyle)
NewStyle = GetWindowLong(hwnd, GWL_EXSTYLE)
RemoveBitMask(NewStyle,WS_EX_CLIENTEDGE)
RemoveBitMask(NewStyle,WS_EX_STATICEDGE)
RemoveBitMask(NewStyle,WS_EX_WINDOWEDGE)
SetWindowLong(hwnd,GWL_EXSTYLE,NewStyle)
SetWindowPos(hwnd,0,0,0,0,0, SWP_MySettings)
RemoveBitMask PROCEDURE(*LONG inoutValue, LONG xMask)
! note: this procedure assumes that the xMask only has exactly ONE BIT SET
CODE
IF BAND(inoutValue, xMask)
inoutValue = BXOR(inoutValue, xMask)
END