Quote Originally Posted by gstercken
Not sure what you really want. Without a worker thread, your GUI would wait for the operation to complete (and hence freeze). You normally introduce a worker thread so that your GUI does not have to wait. Now you say you want to wait - so why the thread? What do you mean by "waiting" without freezing? What exactly is the behaviour you are expecting?
Thank you for your answer:
This is what I'm trying to do in the button handler:

void CThreadDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CreateThread (0,1024*10,Acquire,this,0,&AcquireId);
while (!ThreadEnd)
Sleep(10);
}


The while (with sleep) causes the GUI to freeze. The window can not be moved.
What should I do ?