James L. Williams
2008-06-14 08:56:46 UTC
Hello,
I would like to create a form that exists inside a Thread. I want this so
that the forms graphics updates are handled inside of a thread.
I do something like the following:
Thread::Execute()
{
MSG msg;
TmyForm * myForm = new TmyForm(NULL);
myForm->Parent = NULL;
myForm->ParentWindow = GetDesktopWindow();
myForm->Left = 10;
myForm->Top = 10;
myForm->Width = 500;
myForm->Height = 500;
myForm->Visible = true;
while(GetMessage(msg,NULL,0,0))
{
if(Terminated) break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
delete myForm;
}
Is this a good way to do it, or is there a better way?
Thanks,
James
I would like to create a form that exists inside a Thread. I want this so
that the forms graphics updates are handled inside of a thread.
I do something like the following:
Thread::Execute()
{
MSG msg;
TmyForm * myForm = new TmyForm(NULL);
myForm->Parent = NULL;
myForm->ParentWindow = GetDesktopWindow();
myForm->Left = 10;
myForm->Top = 10;
myForm->Width = 500;
myForm->Height = 500;
myForm->Visible = true;
while(GetMessage(msg,NULL,0,0))
{
if(Terminated) break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
delete myForm;
}
Is this a good way to do it, or is there a better way?
Thanks,
James