-
August 15th, 2011, 04:20 AM
#1
Placing a window on top of another window
I have a window to be positioned on top pf another window.
I have the following code:
if (pWnd == NULL)
{
pWnd = FindWindow(NULL, L"Menu");
}
if (pWnd )
{
CRect lpR;
pWnd->GetWindowRect(&lpR);
SetWindowPos(&CWnd::wndTopMost,lpR.left,lpR.top+20,0,0,SWP_NOSIZE);
}
But it makes the window on top always(of all windows).
I just need to make it on top of a particular window(if it is visible/on foreground).
please help me regarding this
-
August 15th, 2011, 06:08 AM
#2
Re: Placing a window on top of another window
So check if that Window is Visible on the foreground?
-
August 15th, 2011, 08:02 PM
#3
Re: Placing a window on top of another window
Thanks for the reply
I tried checking IsWindowVisible() function for the Main window. It always return true even if it is not seen on the screen.
i tried using getForegroundWindow() also. It returns hadle to the topmost window. So it is not possible to determine if the Main window is visble in the screen.
Is there any way to set the Z-Order of the new window one above the ZOrder of the main window?
-
August 16th, 2011, 03:26 AM
#4
Re: Placing a window on top of another window
IsWindowVisible() returns true when it is showed somewhere on the screen, no matter on top.
Is that no what you want? GetForeGroundWindow() -> Draw your window-> Set the hwnd retrieved again on top of that?
Off course if there are more then window on top of you, it will fail.
-
August 16th, 2011, 08:43 PM
#5
Re: Placing a window on top of another window
Is there any way to find if the window is visible in the screen. Or else how can I find out the Z-Order of a window.
Please some one help me.
Thanks in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|