Disable dotted selection border - 5.02 beta

Advertisement

dmex
Joined:
Posts:
3

Disable dotted selection border - 5.02 beta

It's possible to disable the dotted selection border (focus rectangles) when the Explorer listview style is enabled by sending a WM_CHANGEUISTATE message at initialization of the Listview/Treeview.

More information is available here: https://devblogs.microsoft.com/oldnewthing/?p=35723

At initialization:
// Make sure focus rectangles are disabled.
SendMessage(ListViewHwnd, WM_CHANGEUISTATE, MAKELONG(UIS_SET, UISF_HIDEFOCUS), 0);

At Runtime in your WndProc callback to keep focus rectangles disabled if the user uses the keyboard to select items.
case WM_UPDATEUISTATE:
{
// Disable focus rectangles by setting or masking out the flag where appropriate.
switch (LOWORD(wParam))
{
case UIS_SET:
wParam |= UISF_HIDEFOCUS << 16;
break;
case UIS_CLEAR:
case UIS_INITIALIZE:
wParam &= ~(UISF_HIDEFOCUS << 16);
break;
}
}
break;

There is also some nastly flickering of the ListView controls while moving/hovering the mouse over items, Sending the control a LVS_EX_DOUBLEBUFFER message will allow the ListView controls to paint smoothly. :wink:

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
43,035
Location:
Prague, Czechia

Re: Disable dotted selection border - 5.02 beta

dmex wrote:

At Runtime in your WndProc callback to keep focus rectangles disabled if the user uses the keyboard to select items.
Well, I believe the focus rectangle should be there when using the keybord, shouldn't it? So that you know what item (out of many selected) has the focus.

There is also some nastly flickering of the ListView controls while moving/hovering the mouse over items, Sending the control a LVS_EX_DOUBLEBUFFER message will allow the ListView controls to paint smoothly. :wink:
Will check.

Reply with quote

dmex
Joined:
Posts:
3