WORDPAD 샘플: Windows 응용 프로그램

업데이트: 2007년 11월

WORDPAD는 Windows에 포함된 워드 프로세서 응용 프로그램이며, MFC로 작성되어 독립된 기능을 갖춘 워드 프로세서 응용 프로그램 예제입니다.

WORDPAD에는 사용자 인터페이스를 설명하는 도움말 파일이 포함되어 있습니다.

보안 정보:

이 샘플 코드는 개념을 보여 주기 위해 제공되며 가장 안전한 코드 작성 방법을 제시하지 않을 수 있으므로 응용 프로그램이나 웹 사이트에서 사용할 수 없습니다. Microsoft는 샘플 코드를 원래 용도 이외의 다른 용도로 사용하는 경우 발생하는 부수적이나 파생적인 손해에 대해 책임을 지지 않습니다.

샘플 및 이를 설치하기 위한 지침을 가져오려면

  • Visual Studio의 도움말 메뉴에서 샘플을 클릭합니다.

    자세한 내용은 샘플 파일 찾기를 참조하십시오.

  • 최신 버전 및 전체 샘플 목록은 Visual Studio 2008 Samples 페이지에서 온라인으로 사용할 수 있습니다.

  • 컴퓨터의 하드 디스크에서도 샘플을 찾을 수 있습니다. 기본적으로 샘플과 추가 정보 파일은 \Program Files\Visual Studio 9.0\Samples\ 아래의 폴더에 복사됩니다. Visual Studio Express Edition의 경우에는 모든 샘플이 온라인에 있습니다.

샘플 빌드 및 실행

WORDPAD 샘플을 빌드하고 실행하려면

  1. wordpad.sln 솔루션을 엽니다.

  2. 빌드 메뉴에서 빌드를 클릭합니다.

  3. 시스템에 WordPad 자체를 등록할 수 있도록 WordPad를 독립 실행형 응용 프로그램으로 실행합니다.

WORDPAD 기능

SUPERPAD 샘플에서는 CEditView 클래스를 기반으로 하는 기본 워드 프로세서를 설명합니다. 이와 달리 WORDPAD는 CRichEditView, CRichEditDocCRichEditCntrItem 클래스를 기반으로 하며 SUPERPAD에서 지원하는 기능을 지원할 뿐만 아니라 다음과 같은 기능도 보여 줍니다.

  • Word 파일 형식, .rtf(서식있는 텍스트) 형식 및 ASCII 텍스트 형식 등 여러 가지 파일 형식을 읽고, 쓰고, 서로 변환할 수 있는 기능을 사용할 수 있습니다.

  • 글꼴, 문자 서식(굵게, 기울임꼴, 밑줄), 색, 크기 사용 등의 텍스트 형식 지정. 이러한 특성은 형식 지정 도구 모음에서 사용할 수 있습니다.

  • 맞춤(왼쪽, 가운데 또는 오른쪽), 탭, 여백, 첫 줄 들여쓰기 등의 단락별 형식 지정. 이러한 특성은 눈금자 도구 모음에서도 사용할 수 있습니다.

  • 실행 취소 지원

  • ActiveX 구성 요소 지원. 컨테이너와 서버 모두 해당

키워드

이 샘플에서는 다음의 키워드를 보여 줍니다.

AfxBeginThread; AfxFormatString1; AfxFormatString2; AfxGetApp; AfxGetAppName; AfxGetInstanceHandle; AfxGetMainWnd; AfxMessageBox; AfxOleGetMessageFilter; AfxOleInit; AfxOleSetUserCtrl; AfxRegisterClass; AfxRegisterWndClass; AfxThrowFileException; AfxThrowNotSupportedException; AfxThrowResourceException; BitBlt; CArchive::Close; CArchive::Read; CArchive::Write; CBrush::CreateSolidBrush; CButton::DrawItem; CComboBox::AddString; CComboBox::CompareItem; CComboBox::Create; CComboBox::DrawItem; CComboBox::FindString; CComboBox::FindStringExact; CComboBox::GetCount; CComboBox::GetCurSel; CComboBox::GetDroppedState; CComboBox::GetItemData; CComboBox::GetItemHeight; CComboBox::GetLBText; CComboBox::InsertString; CComboBox::LimitText; CComboBox::MeasureItem; CComboBox::ResetContent; CComboBox::SetCurSel; CComboBox::SetItemData; CComboBox::SetItemHeight; CComboBox::ShowDropDown; CControlBar::EnableDocking; CDC::Attach; CDC::BitBlt; CDC::CreateCompatibleDC; CDC::CreateIC; CDC::Detach; CDC::DrawFocusRect; CDC::DrawText; CDC::ExtTextOut; CDC::FillRect; CDC::GetBkColor; CDC::GetDeviceCaps; CDC::GetTextColor; CDC::GetTextExtent; CDC::GetTextMetrics; CDC::LineTo; CDC::MoveTo; CDC::Rectangle; CDC::RestoreDC; CDC::SaveDC; CDC::SelectObject; CDC::SetBkMode; CDC::SetTextColor; CDC::SetViewportOrg; CDC::TextOut; CDialog::Create; CDialog::DoModal; CDialog::EndDialog; CDialog::GetDefID; CDialog::InitModalIndirect; CDialog::OnInitDialog; CDialog::OnOK; CDialog::SetDefID; CDocTemplate::GetDocString; CDocument::GetFirstViewPosition; CDocument::GetNextView; CFile::Abort; CFile::Close; CFile::Flush; CFile::GetLength; CFile::GetPosition; CFile::GetStatus; CFile::LockRange; CFile::Open; CFile::Read; CFile::Seek; CFile::SeekToBegin; CFile::SetLength; CFile::UnlockRange; CFile::Write; CFileDialog::DoModal; CFont::CreateFontIndirect; CFrameWnd::ActivateFrame; CFrameWnd::Create; CFrameWnd::DockControlBar; CFrameWnd::EnableDocking; CFrameWnd::GetActiveDocument; CFrameWnd::GetActiveView; CFrameWnd::RecalcLayout; CFrameWnd::SetMessageText; CGdiObject::Attach; CGdiObject::CreateStockObject; CListBox::AddString; CListBox::GetCurSel; CListBox::SetCurSel; CMenu::AppendMenu; CMenu::CreatePopupMenu; CMenu::DeleteMenu; CMenu::Detach; CMenu::DrawItem; CMenu::FromHandle; CMenu::GetMenuItemCount; CMenu::GetSubMenu; CMenu::LoadMenu; CMenu::MeasureItem; CMenu::RemoveMenu; CMenu::TrackPopupMenu; CObject::AssertValid; CObject::Dump; CObject::Serialize; COleDataObject::Attach; COleDataObject::IsDataAvailable; COleDataSource::CacheData; COleDropTarget::Register; COleIPFrameWnd::OnCreateControlBars; COleIPFrameWnd::RepositionFrame; COleMessageFilter::EnableBusyDialog; COleResizeBar::Create; COleServerItem::GetClipboardData; COleServerItem::GetDocument; COleServerItem::OnDraw; COleServerItem::OnDrawEx; COleServerItem::OnGetExtent; COleStreamFile::OpenStream; COleTemplateServer::ConnectTemplate; CPalette::GetPaletteEntries; CPoint::Offset; CRect::BottomRight; CRect::CopyRect; CRect::Height; CRect::IntersectRect; CRect::OffsetRect; CRect::PtInRect; CRect::SetRect; CRect::SetRectEmpty; CRect::Size; CRect::TopLeft; CRect::Width; CStatusBar::Create; CStatusBar::SetIndicators; CString::Collate; CString::Empty; CString::FindOneOf; CString::GetBuffer; CString::GetBufferSetLength; CString::GetLength; CString::IsEmpty; CString::LoadString; CString::MakeUpper; CString::ReleaseBuffer; CString::Right; CToolBar::CommandToIndex; CToolBar::Create; CToolBar::GetItemRect; CToolBar::LoadBitmap; CToolBar::SetButtonInfo; CToolBar::SetButtons; CToolBar::SetSizes; CWinApp::ExitInstance; CWinApp::GetProfileInt; CWinApp::InitInstance; CWinApp::LoadIcon; CWinApp::LoadStdProfileSettings; CWinApp::OnDDECommand; CWinApp::OnFileNew; CWinApp::OnFileOpen; CWinApp::OpenDocumentFile; CWinApp::PreTranslateMessage; CWinApp::SetRegistryKey; CWinApp::WinHelp; CWinApp::WriteProfileInt; CWnd::BringWindowToTop; CWnd::CalcWindowRect; CWnd::CenterWindow; CWnd::ClientToScreen; CWnd::Create; CWnd::DestroyWindow; CWnd::DoDataExchange; CWnd::EnableWindow; CWnd::FromHandle; CWnd::GetCapture; CWnd::GetClientRect; CWnd::GetDlgCtrlID; CWnd::GetDlgItem; CWnd::GetFocus; CWnd::GetNextDlgTabItem; CWnd::GetOwner; CWnd::GetParent; CWnd::GetParentFrame; CWnd::GetSafeHwnd; CWnd::GetScrollPos; CWnd::GetStyle; CWnd::GetWindowPlacement; CWnd::GetWindowRect; CWnd::GetWindowTextLength; CWnd::Invalidate; CWnd::InvalidateRect; CWnd::IsChild; CWnd::IsWindowEnabled; CWnd::MoveWindow; CWnd::OnCommand; CWnd::OnCreate; CWnd::OnDestroy; CWnd::OnDevModeChange; CWnd::OnDropFiles; CWnd::OnEnable; CWnd::OnEraseBkgnd; CWnd::OnFontChange; CWnd::OnLButtonDown; CWnd::OnLButtonUp; CWnd::OnMouseMove; CWnd::OnMove; CWnd::OnPaletteChanged; CWnd::OnQueryNewPalette; CWnd::OnShowWindow; CWnd::OnSize; CWnd::OnSysColorChange; CWnd::OnWindowPosChanged; CWnd::OnWindowPosChanging; CWnd::PreCreateWindow; CWnd::PreTranslateMessage; CWnd::ScreenToClient; CWnd::SendMessage; CWnd::SetCapture; CWnd::SetDlgItemText; CWnd::SetFocus; CWnd::SetOwner; CWnd::SetWindowPos; CWnd::SetWindowText; CWnd::ShowWindow; CWnd::SubclassDlgItem; CWnd::UpdateWindow; CloseHandle; CommDlgExtendedError; CreateEvent; CreateFontIndirect; CreateILockBytesOnHGlobal; CreatePen; CreateSolidBrush; DeleteAtom; DeleteObject; DragAcceptFiles; DragFinish; DragQueryFile; EnumDateFormats; EnumFontFamilies; EnumTimeFormats; EnumWindows; FORMATETC; FindResource; FindWindow; FormatMessage; FreeLibrary; GetClassInfo; GetClassName; GetClientRect; GetClipboardData; GetDC; GetDateFormat; GetDeviceCaps; GetDlgItem; GetKeyState; GetLocalTime; GetLocaleInfo; GetModuleFileName; GetModuleHandle; GetObject; GetProcAddress; GetProfileInt; GetShortPathName; GetStockObject; GetSysColor; GetSystemMetrics; GetTextMetrics; GetTimeFormat; GetUserDefaultLCID; GetVersion; GetWindow; GetWindowText; GlobalAddAtom; GlobalAlloc; GlobalFree; GlobalGetAtomName; GlobalLock; GlobalSize; GlobalUnlock; HIWORD; InvalidateRect; KillTimer; LOWORD; LineTo; LoadBitmap; LoadCursor; LoadIcon; LoadLibrary; LoadString; MAKEINTRESOURCE; MAKELPARAM; MessageBeep; MoveTo; MsgWaitForMultipleObjects; MulDiv; OleInitialize; OleUninitialize; OpenFile; PeekMessage; PtInRect; RGB; ReadClassStg; RegCloseKey; RegCreateKey; RegOpenKey; RegQueryValueEx; RegSetValueEx; RegisterClipboardFormat; ReleaseCapture; ReleaseDC; ReleaseStgMedium; ResetEvent; RestoreDC; RoundRect; STGMEDIUM; SaveDC; SelectObject; SendMessage; SendMessageTimeout; SetEvent; SetFocus; SetForegroundWindow; SetROP2; SetRect; SetTimer; SetWindowPos; SetWindowText; ShellAbout; ShowWindow; StgCreateDocfileOnILockBytes; StgOpenStorage; WinHelp; div; isspace; lstrcat; lstrcmp; lstrcmpi; lstrcpy; lstrlen; max; memcmp; memcpy; memmove; memset; min; strcpy_s; wsprintf

참고:

이 샘플을 비롯한 일부 샘플은 Visual C++ 마법사, 라이브러리 및 컴파일러의 변경 내용을 반영하도록 수정되지 않았지만 해당 작업의 수행 방법을 보여 줍니다.

참고 항목

기타 리소스

MFC 샘플