메뉴 바로가기

서브메뉴 바로가기

본문 바로가기

logo

C/C++/MFC

WINDOW 윈도우크기 관련 함수

2006.05.25 17:52

WhiteAT 조회 수:16052



--------------------------------------------------------------------------------

// 풀 스크린 full screen
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
             cs.style= WS_POPUP | WS_VISIBLE;
             cs.hMenu=NULL;
             cs.x = cs.y = 0;
             cs.cx = GetSystemMetrics(SM_CXSCREEN);
             cs.cy = GetSystemMetrics(SM_CYSCREEN);

// 전체 화면 으로 덮어진다. 작업표시줄까지 덮는다.



             if( !CFrameWnd::PreCreateWindow(cs) )

                           return FALSE;

             return TRUE;

}



 참고로 메인프래임의 포인터를 얻어와서 MoveWindow() 가능하다.

CMainFrame * pMainFrame = (CMainFrame *)AfxGetMainWnd();
pMainFrame->MoveWindow( ... );


아래는 관련된 도움말이다.


Mainframe 에서
MFC Library Reference

CWnd::ShowWindow

See Also

Sets the visibility state of the window.

BOOL ShowWindow(

   int nCmdShow

);

Parameters

nCmdShow

Specifies how the CWnd is to be shown. It must be one of the following values:

·         SW_HIDE   Hides this window and passes activation to another window.

·         SW_MINIMIZE   Minimizes the window and activates the top-level window in the system\'s list.

·         SW_RESTORE   Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position.

·         SW_SHOW   Activates the window and displays it in its current size and position.

·         SW_SHOWMAXIMIZED   Activates the window and displays it as a maximized window.

·         SW_SHOWMINIMIZED   Activates the window and displays it as an icon.

·         SW_SHOWMINNOACTIVE   Displays the window as an icon. The window that is currently active remains active.

·         SW_SHOWNA   Displays the window in its current state. The window that is currently active remains active.

·         SW_SHOWNOACTIVATE   Displays the window in its most recent size and position. The window that is currently active remains active.

·         SW_SHOWNORMAL   Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position.

Return Value

Nonzero if the window was previously visible; 0 if the CWnd was previously hidden.

Remarks

ShowWindow must be called only once per application for the main window with CWinApp::m_nCmdShow. Subsequent calls to ShowWindow must use one of the values listed above instead of the one specified by CWinApp::m_nCmdShow.

Example

See the example for CWnd::CalcWindowRect.

See Also

CWnd Overview | Class Members | Hierarchy Chart | ShowWindow | CWnd::OnShowWindow | CWnd::ShowOwnedPopups


--------------------------------------------------------------------------------