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:
41,518
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

Re: Disable dotted selection border - 5.02 beta

martin wrote:

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.

The problem is that once it's reactivated by the keyboard it stays activated for the lifetime the application is running.

You can still see the last item selected by the keyboard without focus rectangles as it's darker than the other items, Explorer also does this on Vista/7 if you want an example :wink:

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Disable dotted selection border - 5.02 beta

dmex wrote:

The problem is that once it's reactivated by the keyboard it stays activated for the lifetime the application is running.

You can still see the last item selected by the keyboard without focus rectangles as it's darker than the other items, Explorer also does this on Vista/7 if you want an example :wink:
I'm sorry, but I do not underastand. Can you post a screenshot?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Disable dotted selection border - 5.02 beta

dmex wrote:

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:
I've tried. But the flickering is even worse then. Would require more investigation. So I've postponed it.

Reply with quote

Advertisement

You can post new topics in this forum