HWND_TOP to make a dialog topmost???
-
Hi, i need some help to bring a dialog to top, but only for him parent dialog. I use this to set child dialog on the top, but he still on top for all applications:
::SetWindowPos(pWaitDlg->m_hWnd, HWND_TOP,0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
but i need it to be only for him's parent dialog on top, not for all, this is a small dialog with progressbar on it! Thanks for any help!! Arrin
-
Hi, i need some help to bring a dialog to top, but only for him parent dialog. I use this to set child dialog on the top, but he still on top for all applications:
::SetWindowPos(pWaitDlg->m_hWnd, HWND_TOP,0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
but i need it to be only for him's parent dialog on top, not for all, this is a small dialog with progressbar on it! Thanks for any help!! Arrin
I think you can try giving handle to the parent window instead of HWND_TOP as second parameter.
-
Hi, i need some help to bring a dialog to top, but only for him parent dialog. I use this to set child dialog on the top, but he still on top for all applications:
::SetWindowPos(pWaitDlg->m_hWnd, HWND_TOP,0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
but i need it to be only for him's parent dialog on top, not for all, this is a small dialog with progressbar on it! Thanks for any help!! Arrin
From the msdn page for SetWindowPos: http://msdn.microsoft.com/en-us/library/ms633545(VS.85).aspx, HWND_NOTOPMOST Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window. This sounds a lot like what you want. Iain.
I have now moved to Sweden for love (awwww).
-
I think you can try giving handle to the parent window instead of HWND_TOP as second parameter.
Hi, thanks for answer, that is! Only one issue is there :), first here is code:
CProgressDlg dlgProgress; // simple dialog with progressbar
dlgProgress.Create(CProgressDlg::IDD, GetDesktopWindow());
this->EnableWindow(FALSE); // disable parent window to make him unclickable
::SetWindowPos(dlgProgress.m_hWnd, this->m_hWnd,0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
dlgProgress.ShowWindow(SW_SHOW); // show new dialog
dlgProgress.CenterWindow(); // center him
dlgProgress.BringWindowToTop(); // bring it to top, because after create they is in the background of the parent dialog, don't know why!!?There is only one thing that is not ok, i can switch between this two dialogs if i click they icons in the taskbar, in this case is this little "dlgProgress"(simple Dialog with progressbar) Dialog in the background of hims parent(if i click on parent icon), and that is what i need to avoid! This little dlgProgress must be on top of hims parent until the process is finish! :( Thanks for help! Arrin
-
From the msdn page for SetWindowPos: http://msdn.microsoft.com/en-us/library/ms633545(VS.85).aspx, HWND_NOTOPMOST Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window. This sounds a lot like what you want. Iain.
I have now moved to Sweden for love (awwww).
-
Arrin wrote:
Still need help!
Then I need a question to help with! Did my answer not solve your problem? Did you realise you asked the wrong question? Was my answer complete rubbish? Iain.
I have now moved to Sweden for love (awwww).
-
Hi, thanks for answer, that is! Only one issue is there :), first here is code:
CProgressDlg dlgProgress; // simple dialog with progressbar
dlgProgress.Create(CProgressDlg::IDD, GetDesktopWindow());
this->EnableWindow(FALSE); // disable parent window to make him unclickable
::SetWindowPos(dlgProgress.m_hWnd, this->m_hWnd,0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
dlgProgress.ShowWindow(SW_SHOW); // show new dialog
dlgProgress.CenterWindow(); // center him
dlgProgress.BringWindowToTop(); // bring it to top, because after create they is in the background of the parent dialog, don't know why!!?There is only one thing that is not ok, i can switch between this two dialogs if i click they icons in the taskbar, in this case is this little "dlgProgress"(simple Dialog with progressbar) Dialog in the background of hims parent(if i click on parent icon), and that is what i need to avoid! This little dlgProgress must be on top of hims parent until the process is finish! :( Thanks for help! Arrin
May be you can remove the call to GetDesktopWindow(). I think
dlgProgress.Create(CProgressDlg::IDD)
would be enough. In addition to that, I suppose dlgProgress has to be a member of the parent dialog.