// 처음 이 함수를 부르면 윈도가 열린다. BOOL CWndCommand::Initialize( CWndBase* pWndParent, DWORD /*dwWndId*/ ) { CRect rectWindow = m_pWndRoot->GetWindowRect(); CRect rect( 0, 0, 150, 200 ); SetTitle( _T( "World" ) ); CWndBase::Create( WBS_TOPMOST | WBS_VSCROLL, rect, pWndParent, APP_COMMAND ); AdjustWndBase(); RestoreDeviceObjects(); return TRUE; }
void CWndNeuz::OnSize(UINT nType, int cx, int cy) { if(IsWndRoot()) return; if( m_bTile ) //m_strTexture.IsEmpty() == FALSE ) { CRect rectWnd = GetWndRect(); CSize size2( rectWnd.Width(), rectWnd.Height() ); CSize sizeDiv = size2; sizeDiv.cx %= 16; sizeDiv.cy %= 16; size2.cx /= 16; size2.cx *= 16; size2.cy /= 16; size2.cy *= 16; if( sizeDiv.cx ) size2.cx += 16; if( sizeDiv.cy ) size2.cy += 16; rectWnd.bottom = rectWnd.top + size2.cy; rectWnd.right = rectWnd.left + size2.cx; SetWndRect( rectWnd, FALSE ); } AdjustWndBase(); m_wndTitleBar.Replace(); CWndBase::OnSize( nType, cx, cy ); // if( rectOld.Width() != m_rectClient.Width() || rectOld.Height() != m_rectClient.Height() ) // 차일드 윈도우들의 사이즈를 조절 /* for(int i = 0; i < m_wndArray.GetSize(); i++) { CWndBase* pWnd = (CWndBase*)m_wndArray.GetAt(i); if(pWnd->IsWndStyle(WBS_DOCKED))// && pWnd->IsWndStyle(WBS_CHILD)) { CRect rect = pWnd->GetWindowRect(TRUE); rect.SetRect(0,0,cx,cy); pWnd->SetWndRect(rect); } } */ /* if(IsWndStyle(WBS_DOCKED))// && IsWndStyle(WBS_CHILD)) { m_wndTitleBar.m_wndMinimize.SetVisible(FALSE); m_wndTitleBar.m_wndMaximize.SetVisible(FALSE); } */ }
void CWndInfoNotice::OnInitialUpdate() { CWndNeuz::OnInitialUpdate(); // 여기에 코딩하세요 CWndButton* pWndCheck = (CWndButton*)GetDlgItem( WIDC_CHECK1 ); pWndCheck->SetCheck( !g_Option.m_bNotice ); CWndText* pWndText = (CWndText*)GetDlgItem( WIDC_TEXT1 ); #ifdef __YNOTICE_UNI1026 CString strnotice; strnotice = GetLangFileName( ::GetLanguage(), FILE_NOTICE ); CScript scanner; if( scanner.Load( "Client\\"+strnotice ) == FALSE ) return; pWndText->m_string.AddParsingString( scanner.m_pProg ); pWndText->ResetString(); #else //__YNOTICE_UNI1026 CFileStatus fileStatus; CString strnotice; strnotice = GetLangFileName( ::GetLanguage(), FILE_NOTICE ); if( CFile::GetStatus( "Client\\"+strnotice, fileStatus ) == TRUE ) { if( g_Option.m_tNoticeTime != fileStatus.m_mtime.GetTime() ) g_Option.m_tNoticeTime = static_cast< time_t >( fileStatus.m_mtime.GetTime() ); CFileIO file; strnotice = GetLangFileName( ::GetLanguage(), FILE_NOTICE ); if(::GetLanguage() == LANG_VTN) { if( file.Open( "Client\\"+strnotice, "rb" ) ) { int nLength = file.GetLength(); TCHAR* pChar = new TCHAR[ nLength + 2 ]; file.Read( pChar, nLength ); *(pChar + nLength ) = '\0'; *(pChar + nLength + 1 ) = '\0'; char* lpMultiByte = new char[ nLength + 2 ]; int nResult = WideCharToMultiByteEx( g_codePage, 0, (LPWSTR)(pChar+2), -1, lpMultiByte, nLength, NULL, NULL ); if( nResult > 0 ) { lpMultiByte[nResult-1] = 0; pWndText->m_string.AddParsingString( lpMultiByte ); pWndText->ResetString(); } safe_delete_array(pChar); safe_delete_array(lpMultiByte); } } else { if( file.Open( "Client\\"+strnotice, "rb" ) ) { int nLength = file.GetLength(); TCHAR* pChar = new TCHAR[ nLength + 1]; file.Read( pChar, nLength ); pChar[ nLength ] = 0; //pWndText->SetString( pChar ); pWndText->m_string.AddParsingString( pChar ); pWndText->ResetString(); safe_delete( pChar ); } } } #endif //__YNOTICE_UNI1026 // 윈도를 중앙으로 옮기는 부분. CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rectWindow = GetWindowRect(); CPoint point( rectRoot.right - rectWindow.Width(), 110 ); Move( point ); MoveParentCenter(); ///////////////////////////////////////////////////////////////////////////////////////// int nCount = 0; CScript script; if( script.Load(MakePath(DIR_THEME, "TexBannerList.inc" )) ) { int nLang; nLang = script.GetNumber(); do { if( nLang == ::GetLanguage() ) { script.GetToken(); nCount = atoi( script.token ); script.GetToken(); for( int i=0; i<nCount; i++ ) { CString addStr = script.token; m_vecStrBanner.push_back( addStr ); script.GetToken(); } if( nCount <= 0 ) { Error( "TexBannerList.inc의 갯수가 0이다" ); return; } break; } else script.GetLastFull(); nLang = script.GetNumber(); } while( script.tok != FINISHED ); } SAFE_DELETE( m_atexPannel ); if( nCount > 0 ) { m_atexPannel = new IMAGE; LoadImage( MakePath( DIR_THEME, m_vecStrBanner[xRandom(nCount)] ), m_atexPannel ); AdjustWndBase(); } ///////////////////////////////////////////////////////////////////////////////////////// }