문제

One is supposed to use double buffering when running locally, but to not use double buffering when the window is on a remote session, if one wants to have the best performance of each mode.

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top