EDIT: I’ve used the following code to draw a push button at the non client area (the title bar) of my window. So my question is: Is possible to handle mouse click event from this button?
bool MainWindow::winEvent(MSG *pMessage, long *result)
{
UINT m = pMessage->message;
if(m == WM_NCPAINT || m == WM_ACTIVATE)
{
HWND id = winId();
HDC hDeviceContext = GetWindowDC(id);
RECT rc = {10, 10, 65, 25};
DrawFrameControl(hDeviceContext, &rc, DFC_BUTTON, DFCS_BUTTONPUSH);
ReleaseDC(id, hDeviceContext);
return true;
}
return QWidget::winEvent(pMessage, result);
}