Does LVS_EX_DOUBLEBUFFER correctly not double buffer when running on a remote session?
-
14-10-2019 - |
문제
The ListView control has an extended style, LVS_EX_DOUBLEBUFFER
, which automatically double buffers the contents of the ListView.
Does one need to register to be notified on changes between local and remote sessions, and update this flag accordingly? Or does the ListView do this automatically?
해결책
The ListView does not automatically adjust itself to whether you're running remote or local. It respects the value of the extended style flags that you set when the control is created; if you set LVS_EX_DOUBLEBUFFER
then the display will be double buffered, and if you don't it won't. I'm sure Raymond Chen would agree that any other behavior would be a bug.
You can change the state of the flag at any time with LVM_SETEXTENDEDLISTVIEWSTYLE
:
SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_DOUBLEBUFFER, isRemote ? 0 : LVS_EX_DOUBLEBUFFER);
Tthe next article after your linked one shows how to get notified when the display changes between local and remote: http://blogs.msdn.com/b/oldnewthing/archive/2006/01/04/509194.aspx