WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Dialog Editor version 6.X
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Remove Border From ItemBox Control

 Keywords: Remove Bide Border  ItemBox Control SetWindowLongA  WS_BORDER WS_EX_CLIENTEDGE GWL_STYLE  GWL_EXSTYLE

Question:

I am trying to display an itembox in such a way that the list box blends with the background. I've changed the background of the listbox to the same color as background but still get the border. Is there a way to turn that off with a DLL call? I assume it is a 3D border and needs to be "Flat" like one can do with PushButtons? I've tried various things with dllcall(user32,long:"SetWindowLongA"....) but no joy so far.

Answer:

hWindow = DialogProcOptions(hDialog,1006, "ItemBox_1")  ; Whatever.
hUser32 = DllLoad(DirWindows(1):"USER32.DLL")

GWL_STYLE = -16
WS_BORDER = 8388608
dwStyle = DllCall(hUser32, long:"GetWindowLongA", long:hWindow, long:GWL_STYLE)
DllCall(hUser32, long:"SetWindowLongA", long:hWindow, long:GWL_STYLE, long:dwStyle&(~WS_BORDER))

GWL_EXSTYLE      = -20
 WS_EX_CLIENTEDGE = 512
dwStyle = DllCall(hUser32, long:"GetWindowLongA", long:hWindow, long:GWL_EXSTYLE)
DllCall(hUser32, long:"SetWindowLongA", long:hWindow, long:GWL_EXSTYLE, long:dwStyle&(~WS_EX_CLIENTEDGE))

DllFree(hUser32)



Article ID:   W17773
Filename:   Remove Border From ItemBox Control.txt
File Created: 2011:12:08:15:17:02
Last Updated: 2011:12:08:15:17:02