Topic "Disable dotted selection border - 5.02 beta"

Author Message
dmex
[View user's profile]

Joined: 2011-10-11
Posts: 2
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: http://blogs.msdn.com/b/oldnewthing/archive/2005/05/03/414317.aspx

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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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.

Quote:
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.
_________________
Martin Prikryl
dmex
[View user's profile]

Joined: 2011-10-11
Posts: 2
prikryl 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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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?
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License