Drawing in popup window..
Makarand Nalgirkar -- makarand@cadsi.com
Monday, March 24, 1997
Environment: Visual C++ 4.2-flat + NT 4.0
>From my SDI MFC application, I want to be able to open a new window to draw to. This window
should stay on top, but should let me interact with the existing parent window.
I tried making the new window a pop-up window, created using CWnd::CreateEx,
with the existing window the parent. This obviously ensures that the child
stays on top, but it locks up the parent window (i.e., I cannot interact with
it). Next,I tried using CWnd::Create instead of CreateEx, but that still has
my main window locked up. I tried passing both a pointer to the parent window
and a NULL for the parent argument to the Create & CreateEx calls.
How do I get this to work ?
Thanks in advance.
-- makarand@cadsi.com
Sreekant Sreedharan -- sreekant@india.deneb.com
Friday, March 28, 1997
Hi Makarand,
Makarand Nalgirkar wrote:
>
> Environment: Visual C++ 4.2-flat + NT 4.0
>
> >From my SDI MFC application, I want to be able to open a new window to draw to. This window
> should stay on top, but should let me interact with the existing parent window.
>
> I tried making the new window a pop-up window, created using CWnd::CreateEx,
> with the existing window the parent. This obviously ensures that the child
> stays on top, but it locks up the parent window (i.e., I cannot interact with
> it). Next,I tried using CWnd::Create instead of CreateEx, but that still has
> my main window locked up. I tried passing both a pointer to the parent window
> and a NULL for the parent argument to the Create & CreateEx calls.
>
> How do I get this to work ?
I gather your only problem is to fix the window in a position above all
other. You should use
CWnd::SetWindowPos( wndTopMost, 0, 0, 0, 0, SWP_NOMOVE, SWP_NOSIZE);
You should not make it a popup.
--
- From Sreekant Sreedharan
Makarand Nalgirkar -- makarand@cadsi.com
Saturday, March 29, 1997
Environment: Visual C++ 4.2-flat + NT 4.0
Sreekant Sreedharan wrote:
> I gather your only problem is to fix the window in a position above all
>other. You should use
> CWnd::SetWindowPos( wndTopMost, 0, 0, 0, 0, SWP_NOMOVE, SWP_NOSIZE);
>
> You should not make it a popup.
*************
in response my question below. This doesn't work. The new window just flashes
and disappears. I call Create to create it, and it is not a popup.
***************
>
> >From my SDI MFC application, I want to be able to open a new window to draw to. This window
> should stay on top, but should let me interact with the existing parent window.
>
> I tried making the new window a pop-up window, created using CWnd::CreateEx,
> with the existing window the parent. This obviously ensures that the child
> stays on top, but it locks up the parent window (i.e., I cannot interact with
> it). Next,I tried using CWnd::Create instead of CreateEx, but that still has
> my main window locked up. I tried passing both a pointer to the parent window
> and a NULL for the parent argument to the Create & CreateEx calls.
>
> How do I get this to work ?
Thanks
- Makarand
Daniel.Doman -- Daniel.Doman@AIG.com
Tuesday, April 01, 1997
[Mini-digest: 2 responses]
As an alternative - you could create a splitter Window. I did something
similar in an SDI application.
-----Original Message-----
From: sreekant@india.deneb.com-@-INE
Sent: Monday, March 31, 1997 9:47 AM
To: Doman, Daniel; mfc-l@netcom.com-@-INETGW
Subject: Re: Drawing in popup window..
Hi Makarand,
Makarand Nalgirkar wrote:
>
> Environment: Visual C++ 4.2-flat + NT 4.0
>
> >From my SDI MFC application, I want to be able to open a new window to
draw to. This window
> should stay on top, but should let me interact with the existing parent
window.
>
> I tried making the new window a pop-up window, created using
CWnd::CreateEx,
> with the existing window the parent. This obviously ensures that the
child
> stays on top, but it locks up the parent window (i.e., I cannot interact
with
> it). Next,I tried using CWnd::Create instead of CreateEx, but that still
has
> my main window locked up. I tried passing both a pointer to the parent
window
> and a NULL for the parent argument to the Create & CreateEx calls.
>
> How do I get this to work ?
I gather your only problem is to fix the window in a position above all
other. You should use
CWnd::SetWindowPos( wndTopMost, 0, 0, 0, 0, SWP_NOMOVE, SWP_NOSIZE);
You should not make it a popup.
--
- From Sreekant Sreedharan
-----From: Sreekant Sreedharan
Hi Makarand,
Makarand Nalgirkar wrote:
>
> Environment: Visual C++ 4.2-flat + NT 4.0
>
> Sreekant Sreedharan wrote:
>
> > I gather your only problem is to fix the window in a position above all
> >other. You should use
> > CWnd::SetWindowPos( wndTopMost, 0, 0, 0, 0, SWP_NOMOVE,
SWP_NOSIZE );
> >
> > You should not make it a popup.
>
> *************
> in response my question below. This doesn't work. The new window just flashes
> and disappears. I call Create to create it, and it is not a popup.
> ***************
>
I find it difficult to agree with you. Maybe I'd missed out something.
To begin with, create a window with CreateEx() setting the style to
WS_OVERLAPPEDWINDOW|WS_VISIBLE and parent HWND to NULL. This will ensure
that the window does not have a parent.
Now you are free to set the position of the window as I've mentioned
above. You may then use SetWindowPos().
--
- From Sreekant Sreedharan
Become an MFC-L member
| Вернуться в корень Архива
|