i have found a way to make it work good using the SendMessage(WM_NCLBUTTONDOWN, HTCAPTION, 0); line of code in double click events..
Code:
void CTEST2Dlg::OnLButtonDblClk(UINT nFlags, CPoint point)
{
((CTESTDlg*)m_parent)->ShowWindow(SW_RESTORE);
((CTESTDlg*)m_parent)->SetCapture(); //solution <-
((CTESTDlg*)m_parent)->SendMessage(WM_NCLBUTTONDOWN, HTCAPTION, 0);
ReleaseCapture(); //solution <-
DestroyWindow();
CDialog::OnLButtonDblClk(nFlags, point);
}
please get the test project again to test my solution if you want.. please rename it to TEST.zip..
can there be any "side effects" by using my code?
also can there be a better way to do this? this problem seems to happen ONLY when you click the Close menu from the taskbar from the window when it is minimized, i just don't understand why.. i even handled WM_SYSCOMMAND looking for SC_CLOSE hiding the dialog from there.. and it still didn't solve anything..
you can also remove the 2 lines of code commented with "//solution <-" to see what happens without them..
thanks