int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int nCmdShow) { CPaintManagerUI::SetInstance(hInstance); CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath()); HRESULT Hr = ::CoInitialize(NULL); if( FAILED(Hr) ) return 0; CMainFrameWnd* pFrame = new CMainFrameWnd(); if( pFrame == NULL ) return 0; pFrame->Create(NULL, _T("TradeClient"), UI_WNDSTYLE_FRAME, WS_EX_WINDOWEDGE | WS_EX_APPWINDOW); pFrame->CenterWindow(); ::ShowWindow(*pFrame, SW_SHOW); CPaintManagerUI::MessageLoop(); delete pFrame; ::CoUninitialize(); return 0; }
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int nCmdShow) { #if 0 /* avoid UAC */ TCHAR szFileName[_MAX_PATH] = {0}; GetModuleFileName(NULL, szFileName, _MAX_PATH); for (int i = sizeof(szFileName)-1; i>=0; i--) { if (szFileName[i]=='\\') { szFileName[i] = 0; SetCurrentDirectory(szFileName); break; } } #endif if (!w32initWinSock()) { printf("Winsock init error %d", WSAGetLastError()); exit(1); }; atexit((void(*)(void)) win32Cleanup); CPaintManagerUI::SetInstance(hInstance); HRESULT Hr = ::CoInitialize(NULL); if ( FAILED(Hr) ) return 0; CMainFrameWnd* pFrame = new CMainFrameWnd(); if ( pFrame == NULL ) return 0; pFrame->Create(NULL, _T("Redis Studio"), UI_WNDSTYLE_FRAME, 0L, 0, 0, 800, 572); pFrame->CenterWindow(); ::ShowWindow(*pFrame, SW_SHOW); CPaintManagerUI::MessageLoop(); ::CoUninitialize(); return 0; }