수안이의 컴퓨터 연구실

  • Mainpage
  • About Me
  • Tags
  • Metapage
  • Notice
  • Location
  • Keywords
  • Guestbook
  • Admin
  • Write an Article
  • Total | 1694862
  • Today | 607
  • Yesterday | 606

Programming/MFC2007/04/05 09:39

Adding a Full Screen Feature to an MFC Application

Link : http://support.microsoft.com/kb/q164162/

SUMMARY
The FSCRN sample includes code that you can use to add a Full Screen feature to a Visual C++ 4.x MFC Application. This is similar to what you see when you select the Full Screen menu item in Microsoft Developer Studio. The code shows which functions must be created and demonstrates how you can create a floating toolbar, which you can click to undo the Full Screen mode.

The following files are available for download from the Microsoft Download Center:

http://download.microsoft.com/download/vc40pro/sample5/1/nt4/en-us/fscrn.exe

MORE INFORMATION
The sample code below has been added to the CMainFrame class of the AppWizard-generated application. Here is a list of the four functions and what they accomplish:

1. OnViewFullScreen - Handler for the Full Screen menu item.
2. OnGetMinMaxInfo - Traps the WM_GETMINMAXINFO message to allow you to increase the size of the window.
3. IsFullScreen- Tests whether the application is in full screen mode.
4. OnUpdateViewFullScreen - Checks or unchecks the Full Screen menu item depending on the mode the application is in.


Sample code


void CMainFrame::OnViewFullScreen()
{
   RECT rectDesktop;
   WINDOWPLACEMENT wpNew;

   if (!IsFullScreen())
   {
       // need to hide all status bars
       m_wndStatusBar.ShowWindow(SW_HIDE);
       m_wndToolBar.ShowWindow(SW_HIDE);

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

       m_wpPrev.length = sizeof m_wpPrev;

       //Adjust RECT to new size of window
       ::GetWindowRect ( ::GetDesktopWindow(), &rectDesktop );
       ::AdjustWindowRectEx(&rectDesktop, GetStyle(), TRUE,
       GetExStyle());

       // Remember this for OnGetMinMaxInfo()
       m_FullScreenWindowRect = rectDesktop;

       wpNew = m_wpPrev;
       wpNew.showCmd = SW_SHOWNORMAL;
       wpNew.rcNormalPosition = rectDesktop;

       m_pwndFullScrnBar=new CToolBar;

       if(!m_pwndFullScrnBar->Create(this, CBRS_SIZE_DYNAMIC|CBRS_FLOATING) || !m_pwndFullScrnBar->LoadToolBar(IDR_FULLSCREEN))
       {
           TRACE0("Failed to create toolbar\n");
           return;     // fail to create
       }

       //don't allow the toolbar to dock
       m_pwndFullScrnBar->EnableDocking(0);
       m_pwndFullScrnBar->SetWindowPos(0,100,100,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_SHOWWINDOW);
       m_pwndFullScrnBar->SetWindowText(_T("Full Screen"));
       FloatControlBar(m_pwndFullScrnBar, CPoint(100,100));
       m_bFullScreen=TRUE;
   }
   else
   {
       m_pwndFullScrnBar->DestroyWindow();
       delete m_pwndFullScrnBar;

       m_bFullScreen=FALSE;

       m_wndStatusBar.ShowWindow(SW_SHOWNORMAL);
       m_wndToolBar.ShowWindow(SW_SHOWNORMAL);
       wpNew = m_wpPrev;
   }

   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;
   }
}

BOOL CMainFrame::IsFullScreen()
{
   return m_bFullScreen;
}

void CMainFrame::OnUpdateViewFullScreen(CCmdUI* pCmdUI)
{
   pCmdUI->Enable();

   if (IsFullScreen())
   pCmdUI->SetCheck();
   else
   pCmdUI->SetCheck(0);
}
"MFC" 카테고리의 다른 글
  • XML using MFC (0)2007/04/05
  • Exception class (0)2007/04/05
  • Adding a Full Screen Feature to an MFC Application (0)2007/04/05
  • CreateDirectory 디렉토리, 폴더 (0)2007/04/05
  • MDI 다른 개체를 참고하는 방법 (0)2007/04/05
2007/04/05 09:39 2007/04/05 09:39
Posted by webdizen
No Trackback No Comment

Trackback URL : http://www.webdizen.net/blog/trackback/2788

Leave your greetings.

[로그인][오픈아이디란?]

«Prev  1 ... 461 462 463 464 465 466 467 468 469 ... 3009  Next»

RSS HanRSS
Blog Image
webdizen
이곳은 컴퓨터에 대해 연구하고, 공유하고, 소통하기 위한 연구실입니다. 개인적으로는 OLAP, Data Mining, Semantic Web, Data Modeling에 대해서 연구하고 있습니다.

Categories

전체 (3009)
Webdizen (141)
Life (6)
Diary (16)
Blog (9)
IDEA (2)
Travel (10)
Book (16)
Photo (7)
Movie (8)
Music (14)
Leisure Sports (10)
Funny (6)
Hardware (121)
Software (120)
Windows (5)
Unix & Linux (120)
Installation (5)
Kernel (10)
System (34)
Develop (22)
X-Window (0)
Applicaton (31)
Security (4)
Framework (2)
Hadoop (2)
Programming (804)
Algorithm & Data Structure (1)
Assembly (38)
UNIX/Linux C (95)
C++ (128)
STL (4)
Java (38)
Win32 API (92)
ATL/COM (44)
MFC (151)
.NET (26)
WCF/WPF (4)
C# (28)
Network Programming (17)
Database Programming (12)
OpenGL / DirectX (13)
Multimedia Programming (0)
Game Programming (21)
Parallel Distributed Progra... (0)
Reverse Engineering (0)
Debugging (9)
Python (1)
Ruby (1)
Ruby on Rails (1)
QT (4)
GTK (0)
JSP (0)
PHP (6)
ASP.NET (6)
ASP (2)
Development (28)
Useful Library (2)
Data Modeling (0)
Database (105)
Oracle (4)
MSSQL (41)
MySQL (2)
Data Warehouse (2)
Data Mining (4)
Network (66)
Web (79)
DHTML (4)
XHTML (1)
Javascript (1)
CSS (1)
AJAX (9)
XML (11)
Flex (1)
Silverlight (3)
Security (91)
DoS (1)
Kernel (10)
Scanning (3)
Sniffing (0)
Spoofing (4)
Overflow (28)
Web (11)
Shell (10)
Format String (14)
Window (2)
Embedded (70)
Multimedia (27)
Mobile (14)
Graphic (24)
Management (633)
Knowledge (581)
Hadoop (0)

Notice

  • 메타 블로그 사이트에 등록
  • 새해 맞이 블로그의 변화
  • 블로그 명칭 변경
  • 도메인(www.webdizen.net) 구...
  • TEXTCUBE 1.6.1로 업그레이드...

Tags

  • RPM
  • stty
  • 짐빔 화이트
  • 객체 삽입
  • 망각곡선
  • 헤네지 XO
  • Safari2
  • Database Server
  • XML 인덱싱
  • CView
  • Coding
  • 데이타 바인딩
  • 마주앙 로젤
  • 성능 모니터
  • Apache
  • mount
  • 버전 관리
  • 강대라이크
  • 메타 블로그
  • 두뇌

Recent Articles

  • 트위터(Twitter)의 시작!.
  • 청년 리더의 조건.
  • 애플의 타블렛 PC - 아이패드....
  • 미래의 인터페이스 - 육감 기....
  • 기초발성법 동영상 강좌.

Recent Comments

  • 경청... 너무나 중요한데.......
    webdizen 14:59
  • 학교 과제물중 쓰레드에 대하....
    장진혁 03/17
  • 관리자만 볼 수 있는 댓글입....
    비밀방문자 03/12
  • 상대방의 이야기를 열심히 경....
    DoNuts 03/03
  • 좋은글 잘 보고 갑니다..
    Und_hacker 01/08

Recent Trackbacks

  • printf,scanf를 이용한 형식....
    yundream의 프로그래밍 이야기 03/10
  • 파일 열기/저장하기 CFileDialog.
    은마군의 나태블록 2009
  • World IT Show 2008.
    상우 :: Oranzie's BLOG 2008
  • cvs서버 설치하기.
    3인3색 2008
  • 속속 공개되는 Google Chart....
    PHP와 Web 2.0 2007

Archive

  • 2010/02 (1)
  • 2010/01 (6)
  • 2009/12 (5)
  • 2009/09 (3)
  • 2009/08 (1)

Calendar

«   2010/03   »
일 월 화 수 목 금 토
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Bookmarks

    • Administration
      • IIS.NET
      • NTFAQ
      • OS의 모든 것
      • 리눅스포털
    • Database
      • SQL Server Central
      • SQL Team
    • Development
      • .NET Heaven
      • ASP Alliance
      • ASP.NET 2.0
      • Bullog.net
      • C# Corner
      • C++ (C PlusPlus.com)
      • C++ Reference
      • CodeGuru
      • CodePlex
      • DebugLab
      • Dev Articles
      • Devpia
      • DotNet Junkies
      • DotNet Zone
      • Driver Online
      • GOSU.NET
      • HOONS 닷넷
      • Joinc 팀블로그
      • KOSR
      • MSDN Home Page
      • OSR Online
      • Sky.ph - 개발자 커뮤니...
      • TAEYO.NET
      • The Code Project
      • WindowsClient.net
      • 김상욱의 개발자 Side
      • 조인시 위키
    • Human Networks
      • belief21c's e-space
      • I think I can
      • Invisible Rover's Blog :D
      • Polarux - Linuxing
      • Rodman®
      • 까만 나비
      • 나를 가꾸는 시간.
      • 단녕
      • 상우 :: Oranzie's BLOG
    • Information Technology
      • Microsoft TechNet
      • 지디넷코리아 - 글로벌...
    • Security
      • FoundStone
      • milw0rm
      • NewOrder
      • OpenRCE
      • Phrack.org
      • Reverse Engineering b1...
      • Reverse Engineering Team
      • RootKit
      • SecurityFocus
      • SecurityXploded by Nag...
      • Wow Hacker
      • Zone-H
Textcube
Louice Studio Inc.
Powered by Textcube. Original designed by Tistory.