[MSPAINT][ATL] Encapsulation: mainWindow (#5178)

- Add DoCreate methods to CFullscreenWindow, CMiniatureWindow, and CMainWindow classes.
- Do encapsulation around mainWindow and _tWinMain.
- Add GetOpenFileName, GetSaveFileName, and ChooseColor helper methods to CMainWindow class.
- Move some code in WinMain into CMainWindow::OnCreate.
- Delay creation of CFullscreenWindow and CMiniatureWindow.
- Extend ATL CImage class as CImageDx in newly-created atlimagedx.h of mspaint.
CORE-18867
This commit is contained in:
Katayama Hirofumi MZ 2023-03-28 22:31:26 +09:00 committed by GitHub
parent 0569bbd4a7
commit 29e147beca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 549 additions and 360 deletions

View file

@ -28,7 +28,16 @@ public:
MESSAGE_HANDLER(WM_MOUSEWHEEL, OnMouseWheel)
END_MSG_MAP()
CMainWindow() : m_hMenu(NULL) { }
HWND DoCreate();
BOOL GetOpenFileName(IN OUT LPTSTR pszFile, INT cchMaxFile);
BOOL GetSaveFileName(IN OUT LPTSTR pszFile, INT cchMaxFile);
BOOL ChooseColor(IN OUT COLORREF *prgbColor);
private:
HMENU m_hMenu;
LRESULT OnDropFiles(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnDestroy(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);