SK
2006-12-28 12:36:06 UTC
Hello,
What is the signifance of using AttachThreadInput?
We have to display wait cursor in a Secondary UI thread. This UI thread
contains only Message Window. In this UI thread we need to display a Wait
cursor for some long operations. But if we use CWaitCursor in this UI
thread, cursor is not getting changed. Hence we used AttachThreadInput as
follows in secondary UI thread, this solves our problem.
AttachThreadInput(m_nWndThreadID, m_MainThreadID, TRUE);
/*m_nWndThreadID = Current thread ID, m_MainThreadID = Main thread ID*/
CWaitCursor wait;
// Long operation
AttachThreadInput(m_nWndThreadID, m_MainThreadID, FALSE);
Is this is a proper way of using AttachThreadInput? Or is there any other
way to solve this?
Regards
Khot
What is the signifance of using AttachThreadInput?
We have to display wait cursor in a Secondary UI thread. This UI thread
contains only Message Window. In this UI thread we need to display a Wait
cursor for some long operations. But if we use CWaitCursor in this UI
thread, cursor is not getting changed. Hence we used AttachThreadInput as
follows in secondary UI thread, this solves our problem.
AttachThreadInput(m_nWndThreadID, m_MainThreadID, TRUE);
/*m_nWndThreadID = Current thread ID, m_MainThreadID = Main thread ID*/
CWaitCursor wait;
// Long operation
AttachThreadInput(m_nWndThreadID, m_MainThreadID, FALSE);
Is this is a proper way of using AttachThreadInput? Or is there any other
way to solve this?
Regards
Khot