MDI Child Window + top most
-
Hi all, How to make an MDI child window top most among all other children? Thanks in advance, Sarvan AL
MDIActivate(...)
Nibu thomas Software Developer
-
MDIActivate(...)
Nibu thomas Software Developer
-
Hi Nibu, Thanks for your reply. It (say WND-A) need not be active. If I select other child window (say WND-B), WND-A should be top most among them and WND-B should be active. How can we make it possible? Sarvan AL
Have you tried
SetWindowPos
. I am a bit tentative about this but you can try.
Nibu thomas Software Developer
-
Have you tried
SetWindowPos
. I am a bit tentative about this but you can try.
Nibu thomas Software Developer
-
Hi Nibu, I tried "SetWindowPos" in view::OnInitialUpdate, like, GetParent()->SetWindowPos(...). It doesn't work. Even I tried WS_EX_TOPMOST in CChildFrame::PreCreateWindow. What can we do now? Sarvan AL
Sarvan AL wrote:
GetParent()->SetWindowPos(...).
Why are you calling the parent's(GetParent())
SetWindowPos
. You want to make this child window top most right? So callSetWindowPos
for this child window. I guess it will make this child window the topmost in the parent window's child window hierarchy. Note: I haven't checked it.
Nibu thomas Software Developer
-
Sarvan AL wrote:
GetParent()->SetWindowPos(...).
Why are you calling the parent's(GetParent())
SetWindowPos
. You want to make this child window top most right? So callSetWindowPos
for this child window. I guess it will make this child window the topmost in the parent window's child window hierarchy. Note: I haven't checked it.
Nibu thomas Software Developer
Hi Nibu, Even this also, doesn't give desired results. void CMyView::OnInitialUpdate() { CFormView::OnInitialUpdate() ; ResizeParentToFit() ; SetWindowPos(&wndTopMost, 0, 0, 100, 100, SWP_NOMOVE | SWP_NOSIZE) ; } But I am not sure that, it is possible to make an MDI child top most. Kindly let know the properties (window styles), the CWnd derived class should have. Sarvan AL
-
Hi Nibu, Even this also, doesn't give desired results. void CMyView::OnInitialUpdate() { CFormView::OnInitialUpdate() ; ResizeParentToFit() ; SetWindowPos(&wndTopMost, 0, 0, 100, 100, SWP_NOMOVE | SWP_NOSIZE) ; } But I am not sure that, it is possible to make an MDI child top most. Kindly let know the properties (window styles), the CWnd derived class should have. Sarvan AL
I think that using
GetParent()
orGetParentFrame()
is better.void CMyView::OnInitialUpdate() { CFormView::OnInitialUpdate() ; ResizeParentToFit() ; GetParentFrame()->SetWindowPos(&wndTopMost, 0,0,0,0,SWP_NOMOVE|SWP_NOSIZE) ; }
Sarvan AL wrote:
But I am not sure that, it is possible to make an MDI child top most.
This could be the real problem!
-
I think that using
GetParent()
orGetParentFrame()
is better.void CMyView::OnInitialUpdate() { CFormView::OnInitialUpdate() ; ResizeParentToFit() ; GetParentFrame()->SetWindowPos(&wndTopMost, 0,0,0,0,SWP_NOMOVE|SWP_NOSIZE) ; }
Sarvan AL wrote:
But I am not sure that, it is possible to make an MDI child top most.
This could be the real problem!
Hi Russel and Nibu, Still the same prob. Let me explain the scenario briefly: I have 7 CFormView derived views. Those should be always topmost. I should have made those windows as MODELESS DIALOGS. But I made a mistake. I need to change the entire architecture of the application. It is painful. If is there any other alternative (to make an MDI child as MODELESS DIALOG), it would be a great solution. Kindly let me know your suggestion. Sarvan AL