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:
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: