======ATL/WTL====== * MSVS 2019 기준 * 기본 정보 : [[https://sourceforge.net/projects/wtl/]] WTL for MFC Programmers, Part I - ATL GUI Classes * [[https://www.codeproject.com/Articles/3841/WTL-for-MFC-Programmers-Part-I-ATL-GUI-Classes]] CWindowImpl * [[https://docs.microsoft.com/ko-kr/cpp/atl/reference/cwindowimpl-class?view=msvc-160]] 창을 만드는 설명 * [[https://docs.microsoft.com/ko-kr/cpp/atl/implementing-a-window-with-cwindowimpl?view=msvc-160]] Using the ATL Windowing Classes * [[https://www.codeguru.com/cpp/com-tech/atl/article.php/c3605/Using-the-ATL-Windowing-Classes.htm]] 빈 윈도우 만들기 * Win32 데스크톱용 위저드로 만들어서, 정리. #include "targetver.h" #define WIN32_LEAN_AND_MEAN #include #include #include #include #include #include #include #include "resource.h" class MainWindow : public CWindowImpl { public: DECLARE_WND_CLASS(_T("210424_A")); BEGIN_MSG_MAP(MainWindow); //MESSAGE_HANDLER(WM_PAINT, OnPaint) MESSAGE_HANDLER(WM_DESTROY, OnDestroy) END_MSG_MAP(); LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { PostQuitMessage(0); return 0; } }; int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { MainWindow _wnd; RECT _rc = { 0, 0, 200, 200 }; _wnd.Create(0, /*CWindow::rcDefault*/_rc, _T("Wnd"), WS_OVERLAPPEDWINDOW, 0, (UINT)NULL); _wnd.CenterWindow(); if(!_wnd) return -1; _wnd.ShowWindow(nCmdShow); _wnd.UpdateWindow(); HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_HANENGCURSOR)); MSG msg; while(GetMessage(&msg, nullptr, 0, 0)) { if(!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return 0; }