How to fix a window at the top?
-
Hi, When I create the dialog box (second dialog) in the first dialog box it stays always above the first one. I can push to a button in the first dialog box while the second one stays above it.But when I create them at the begining of the program in the main dialog box (main dialog box is different than the first dialog box) then if I touch to the first dialog box the second one goes below the first one.How can I fix the second dialog box above the first dialog box when I create them at the beginning of the program? Thanks ibrahim
-
Hi, When I create the dialog box (second dialog) in the first dialog box it stays always above the first one. I can push to a button in the first dialog box while the second one stays above it.But when I create them at the begining of the program in the main dialog box (main dialog box is different than the first dialog box) then if I touch to the first dialog box the second one goes below the first one.How can I fix the second dialog box above the first dialog box when I create them at the beginning of the program? Thanks ibrahim
-
Hi, When I create the dialog box (second dialog) in the first dialog box it stays always above the first one. I can push to a button in the first dialog box while the second one stays above it.But when I create them at the begining of the program in the main dialog box (main dialog box is different than the first dialog box) then if I touch to the first dialog box the second one goes below the first one.How can I fix the second dialog box above the first dialog box when I create them at the beginning of the program? Thanks ibrahim
If you use DoModal () to display the second dialog box, it will be fixed at the top until you close it. This is called a "modal" dialog box.
-
If you use DoModal () to display the second dialog box, it will be fixed at the top until you close it. This is called a "modal" dialog box.
-
But I want that I can push a button or write something to an editbox in the first dialog box while the second dialog is on the top.When I create the dialog box as modal I think that I cannot use the first dialog box?
That's correct. In that case, you should probably use led mike's suggestion instead of DoModal ().
-
You change the Z order[^] to Topmost.
led mike
-
As mike said, u can use SetWindowPos( m_hWnd, HWND_TOPMOST, Left, Top, Width, Height, SWP_SHOWWINDOW );
aks
That didn't solve my problem.I think it will be better if I write the code sample. Creating the dialogs as global.
pKeyboard = new CKeyboard;
pKeyboard->Create(IDD_KEYBOARD,this);
::SetWindowPos(pKeyboard->m_hWnd, HWND_TOPMOST,0,0,cxScreen,2*cyScreen/5, SWP_SHOWWINDOW );pPhoneEditor = new CPhoneEditor;
pPhoneEditor->Create(IDD_PHONEEDITOR,this);
pPhoneEditor->SetWindowPos(&wndTop,0,0,cxScreen,cyScreen,SWP_HIDEWINDOW);Is there a problem in this code?