m_tree.SetRedraw(FALSE); // turn drawing off regardless of list mode// // Update control //m_tree.SetRedraw(TRUE); // turn drawing back on and update the window// invalidate the entire control, force painting m_tree.Invalidate(); m_tree.UpdateWindow();
耗时在 数据插入到tree控件:
tree控件是绑定在主线程上的, 我现在已经单开线程插入数据, 但是由于传入的tree句柄是绑在主UI线程上的, 所以还是会卡。所以不把tree从主UI中分出来, 插入数据时候 总要往主UI线程里插, 即使是开单独线程. 这个怎么办?
同5楼。我再描述一遍.
CDialog //主线程
{
CTree m_tree;
}插入数据时候单开线程 _beginthread(xx,xx,xx,&m_tree)传入.
在线程里给m_tree插入大量数据。这样不成。因为虽然单独开线程了,,,但还是往主线程里插. 会影响主线程IE控件里网页视频的播放,变卡。
// Update control
//m_tree.SetRedraw(TRUE); // turn drawing back on and update the window// invalidate the entire control, force painting
m_tree.Invalidate();
m_tree.UpdateWindow();
1. 就问题用SetRedraw很好使:
{
我又试了一下 你们两位的SetRedraw相当好使。但是如果项目太多, 拖动滚动条有些卡。 <- 但是这个问题我想可以尽量控制用户只打开一个频道内节目, 像PPStream一样。
}新问题:
{
我还尝试了一下 两个UI线程, 这个能完全解决问题, 但是IE单放UI里没法设置Child了。所以移动最大最小化,是个问题.
}