I have a idea which is nearly working:
if I put this into my main function:
DragAcceptFiles(GetActiveWindow(), TRUE);
MSG messages;
MessageBox(NULL, "DragAndDropThread", "", NULL);
while (GetMessage(&messages, NULL, 0, 0))
{
MessageBox(NULL, "GetMessage", "", NULL);
TranslateMessage(&messages);
DispatchMessage(&messages);
}
it works buggy, but my main-window gets blocked and only paints black, since
it needs to return something to work in the other threads somehow.
thatswhy I tried the following:
BOOL WINAPI MessageNULLLoopThread(LPVOID lpParameter)
{
HWND curWindow = (HWND)lpParameter;
DragAcceptFiles(curWindow, TRUE);
MSG messages;
MessageBox(NULL, "DragAndDropThread", "", NULL);
while (GetMessage(&messages, NULL, 0, 0))
{
MessageBox(NULL, "GetMessage", "", NULL);
TranslateMessage(&messages);
DispatchMessage(&messages);
}
return TRUE;
}
And I've put the following into my main function:
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)MessageNULLLoopThread, GetActiveWindow(), 0, 0);
Its not blocking my main window from rendering then, but in that thread
GetActiveWindow() does not work, so i need to pass it down by lParam...
And the GetMessage loop does not work in the new thread, the debug-messagebox
does not get called once inside the loop.
This is getting realy crazy right now -.-
Why does GetActiveWindow() not work in another thread ? Why is the loop not working
if i put it into a thread ?
But most important: how do I fix this ?