The default handling for WM_PAINT
will be fine. It will do nothing, which is what you want. However, you don't really want a visual control here. What you want, I suspect, is a message only window. That's created by passing HWND_MESSAGE
to the hWndParent
of CreateWindowEx
. I'm not sure if Qt offers such functionality, quite possibly not.
You can carry on using QWidget
but it does seem a little over-the-top to me. And if you do continue with QWidget
then you ought at the very least hide it.
Note that I am assuming that your winEvent
implementation is correct. You've not shown it all. Specifically you've not shown the code that returns false
for the messages that you want to receive default handling.
It looks like my assumption was wrong. You were failing to return a value from your winEvent
. Your compiler will warn about that provided that you enable warnings. You must do this, and then heed the warnings. Your winEvent
should be:
bool MainWindow::winEvent(MSG *message, long *result)
{
switch(message->message)
{
case BUFFER_DONE:
qDebug()<<"***---BUFFER_DONE---***";
return false;
}
return false;
}