Index: src/ch/MainWnd.cpp =================================================================== diff -u -r07a3be49b0c7e5599eb89c2f9da9a9272cc1558a -r59c39dd19e2c42f33189ee07274f0488d54d7ed0 --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 07a3be49b0c7e5599eb89c2f9da9a9272cc1558a) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 59c39dd19e2c42f33189ee07274f0488d54d7ed0) @@ -41,6 +41,8 @@ static char THIS_FILE[] = __FILE__; #endif +#define CH_WNDCLASS_NAME _T("Copy Handler Wnd Class") + #define WM_ICON_NOTIFY WM_USER+4 #define WM_SHOWMINIVIEW WM_USER+3 #define WM_IDENTIFY WM_USER+11 @@ -78,7 +80,7 @@ } // registers main window class -ATOM CMainWnd::RegisterClass() +BOOL CMainWnd::RegisterClass() { WNDCLASS wc; @@ -91,17 +93,19 @@ wc.hCursor = ::LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.lpszMenuName = NULL; - wc.lpszClassName = _T("Copy Handler Wnd Class"); + wc.lpszClassName = CH_WNDCLASS_NAME; - return ::RegisterClass(&wc); + return ::AfxRegisterClass(&wc); } // creates this window BOOL CMainWnd::Create() { - ATOM at=RegisterClass(); + BOOL bReg = RegisterClass(); + if(!bReg) + return FALSE; - return CreateEx(WS_EX_TOOLWINDOW, (LPCTSTR)at, _T("Copy Handler"), WS_OVERLAPPED, 10, 10, 10, 10, NULL, (HMENU)NULL, NULL); + return CreateEx(WS_EX_TOOLWINDOW, CH_WNDCLASS_NAME, _T("Copy Handler"), WS_OVERLAPPED, 10, 10, 10, 10, NULL, (HMENU)NULL, NULL); } int CMainWnd::ShowTrayIcon() Index: src/ch/MainWnd.h =================================================================== diff -u -rbfe720fda9529e7a77b4fb6410b4d4945b69188b -r59c39dd19e2c42f33189ee07274f0488d54d7ed0 --- src/ch/MainWnd.h (.../MainWnd.h) (revision bfe720fda9529e7a77b4fb6410b4d4945b69188b) +++ src/ch/MainWnd.h (.../MainWnd.h) (revision 59c39dd19e2c42f33189ee07274f0488d54d7ed0) @@ -64,7 +64,7 @@ // Generated message map functions protected: - ATOM RegisterClass(); + BOOL RegisterClass(); int ShowTrayIcon(); void ShowStatusWindow(const CTask* pSelect=NULL); void PrepareToExit();