15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


view full screen

Lawrence_Chan@pcmailgw.ml.com
Wednesday, July 03, 1996

     NT3.51 VC4.0
     
     How do I make the main frame extend beyond the screen limit? Like the 
     view|Full Screen option in MSDEV?
     
     I tried to modify some of the values in lpMMI on GETMINMAXINFO but the 
     maximum size I can get is still 800x600, i.e. I could not set it to 
     something beyond that size on my current display(800x600).
     Anyone has any ideas? This should be an easy one.




Thomas Drolshagen -- drolshagen@deos.ch
Monday, July 08, 1996

[Mini-digest: 5 responses]

Hi Lawrence
Just take a look at the mfc professional page:
http://www.visionx.com/mfcpro/index.htp

There is a section called: "Tips of the week" where you can find code
for your problem.

HTH
Thomas


>----------
>From:
>	Lawrence_Chan@pcmailgw.ml.com[SMTP:Lawrence_Chan@pcmailgw.ml.com]
>Sent: 	Mittwoch, 3. Juli 1996 15:52
>To: 	mfc-l@netcom.com
>Subject: 	view full screen
>
>     NT3.51 VC4.0
>     
>     How do I make the main frame extend beyond the screen limit? Like
>the 
>     view|Full Screen option in MSDEV?
>     
>     I tried to modify some of the values in lpMMI on GETMINMAXINFO but
>the 
>     maximum size I can get is still 800x600, i.e. I could not set it
>to 
>     something beyond that size on my current display(800x600).
>     Anyone has any ideas? This should be an easy one.
>
-----From: David.Lowndes@bj.co.uk

There are different aproaches to this, you could alter your main frame window style
so that it doesn't have any borders or a menu, or you can re-size the window so
that its borders & menu are off screen.

You chould be able to do the latter by using GetSystemMetrics with
SM_CXFULLSCREEN & SM_CYFULLSCREEN to get the full screens dimensions.
Then use AdjustWindowRect to calculate an expanded rectangle for the frame
window. Finally use SetWindowPos to move the frame window off-screen.

Dave Lowndes
-----From: pjn@indigo.ie (pjn)

Try creating the Window which is full screen, nut without a caption. I
remember reading in MSJ that this was how MS Word did it.
                             '''	   
                             @ @
+========================ooO-(_)-Ooo=================================+
|                                           PJ Naughter              |
| Software Developer                     email:  pjn@indigo.ie       |
| Softech Telecom                          Tel:    +353-1-2958384    |
|                                          Fax:    +353-1-2956290    |
|                                                                    |
|                                                                    |
|                        Addr: 7 Woodford, Brewery Road, Blackrock,  |
|                              Co. Dublin, Republic of Ireland       |
+====================================================================+
-----From: "Stew: Rob Stewart" 

Why not just remove the menu, toolbar(s), and frame and redraw the window at 
full screen?

Robert Stewart      | My opinions are usually my own.
Datalytics, Inc.    | stew@datalytics.com
               | http://www.datalytics.com
-----From: Bill Campbell 

Lawrence,

    I tackled this problem..unfortunately it is complex. You must hide =
all the windows except that of your document. The way I implemented this =
was to 'steal' the print preview code in MFC. With some minor changes =
you can incorporate this into your app.
Hope this will give you some ideas.

Bill




Lawrence_Chan@pcmailgw.ml.com
Friday, July 12, 1996

     
Thanks for the responses.
I tried some of the suggestions but still couldn't get it to work.

        SetWindowPos, SetWindowPlacement failed
        OnGetMINMAXInfo failed
        (I have not tried 'stealing the preview code' though)
        
Some of you suggested creating a window with no captions. But if you use spy to 
check MSDEV mainframe window messages and class info, you will discover that the
full screen window is the same frame except it has a rectangle extend beyond the
screen limit and the menu handle has changed. All other styles are the same.

Finally I discovered I could use OnNcCalcSize to make the window grow beyond the
screen limit. However, I also get all sorts of werid problems such as the window
does not repaint correctly, the menu pops out in the client area, etc.

I searched the knowledge base on www. No articles talk about WM_NCCALCSIZE.
Anyone out there care to research further on this?




Niels Ull Jacobsen -- nuj@kruger.dk
Tuesday, July 16, 1996

[Mini-digest: 3 responses]

Lawrence Chan wrote:
>    =20
>Thanks for the responses.
>I tried some of the suggestions but still couldn't get it to work.
>
>        SetWindowPos, SetWindowPlacement failed
>        OnGetMINMAXInfo failed
>        (I have not tried 'stealing the preview code' though)
>       =20
>Some of you suggested creating a window with no captions. But if you use
spy to=20
>check MSDEV mainframe window messages and class info, you will discover
that the
>full screen window is the same frame except it has a rectangle extend
beyond the
>screen limit and the menu handle has changed. All other styles are the s=
ame.
>
>Finally I discovered I could use OnNcCalcSize to make the window grow
beyond the
>screen limit. However, I also get all sorts of werid problems such as th=
e
window
>does not repaint correctly, the menu pops out in the client area, etc.
>
>I searched the knowledge base on www. No articles talk about WM_NCCALCSI=
ZE.
>Anyone out there care to research further on this?

Take a look at the MSDN article "Creating Programs Without a Standard Win=
dows=20
User Interface Using Visual C++ and MFC" (Tech articles/Windows articles/
User Interface/Window management)
and the notes in MSJ aug. 1995 (vol 10 no 8) C++ column (the BIGWIN sampl=
e).

They might prove useful - I don't think they're 32-bit oriented, though.


>
>
>
>
Niels Ull Jacobsen, Kr=FCger A/S (nuj@kruger.dk)
Everything stated herein is THE OFFICIAL POLICY of the entire Kruger=20
group and should be taken as legally binding in every respect.=20
Pigs will grow wings and fly.

-----From: Dan Liliedahl 

Did you try simply resizing the window with a client area equal to the desktop.
(eg something like (-10, -10, 645, 485 ir at 680x480))?

Dan Liliedahl                            Phone# (508)937-3700 X632
Adra Systems, Inc.                   Fax#   (508)453-2462
Two Executive Drive                EMAIL: dan.liliedahl@adra.com
Chelmsford, MA. 01824

-----From: Dan Kirby 

Here is someone quick code that I whipped out which should give you an idea 
of how to do it. I didn't spend much time with it so there may be an easier 
way but the main thing is that appears to work fine.  Just take an 
AppWizard application and add the code:

void CMainFrame::OnWindowFullScreen()
{
  // need to hide all status bars
    m_bFullScreen=TRUE;
   m_wndStatusBar.ShowWindow(SW_HIDE);
m_wndToolBar.ShowWindow(SW_HIDE);


	// We'll need these to restore the original state.
	GetWindowPlacement (&m_wpPrev);

	// NT 3.51 sets the length field wrong sometimes.
	m_wpPrev.length = sizeof m_wpPrev;

	RECT rectDesktop;
	::GetWindowRect ( ::GetDesktopWindow(), &rectDesktop );
	::AdjustWindowRectEx(&rectDesktop, GetStyle(), TRUE, GetExStyle());


	// Remember this so that OnGetMinMaxInfo() can set the correct
	// window max sizes.
	m_FullScreenWindowRect = rectDesktop;

	// Now we make the change.
	WINDOWPLACEMENT wpNew = m_wpPrev;
	wpNew.showCmd =  SW_SHOWNORMAL;
	wpNew.rcNormalPosition = rectDesktop;
	SetWindowPlacement ( &wpNew );
	
}

void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
    if (IsFullScreen())
    {
        lpMMI->ptMaxSize.y = m_FullScreenWindowRect.Height();
	    lpMMI->ptMaxTrackSize.y = lpMMI->ptMaxSize.y;
	    lpMMI->ptMaxSize.x = m_FullScreenWindowRect.Width();
	    lpMMI->ptMaxTrackSize.x = lpMMI->ptMaxSize.x;
    }

}

--dan



Timothy Purves -- tpurves@ix.netcom.com
Saturday, July 20, 1996

At 08:53 AM 7/16/96 +0200, you wrote:

	// We'll need these to restore the original state.
	GetWindowPlacement (&m_wpPrev);
	// NT 3.51 sets the length field wrong sometimes.
	m_wpPrev.length izeof m_wpPrev;>[Mini-digest: 3 responses]

This comment is wrong, and the example is incorrect, with a lot of the new
API's you must fill in the length field _before_ the call. If you do not,
the call may fail (or worse).

*************************************************************************
>From the help file.

Before calling GetWindowPlacement, set the length member of the
WINDOWPLACEMENT structure to sizeof(WINDOWPLACEMENT). 
GetWindowPlacement fails if lpwndpl->length is not set correctly.

*************************************************************************


-tim

Timothy Purves 
Manager of Application Technology Specialists
Henry Ford Health System





| Вернуться в корень Архива |