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; }
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); if (GlobalSet::ForegroundPrevInstance()) return FALSE; if(FAILED(::OleInitialize(NULL))) return FALSE; if (!GlobalSet::InitGlobal()) return FALSE; { DuiLib::CPaintManagerUI::SetInstance(hInstance); DuiLib::CPaintManagerUI::SetResourcePath(DuiLib::CPaintManagerUI::GetInstancePath() + _T("skins\\skin1")); //CPaintManagerUI::SetResourceZip(CPaintManagerUI::GetInstancePath() + _T("skin\\skin1.zip")); CMainFrameWnd mainFrame; mainFrame.CreateX(NULL, UI_WNDSTYLE_FRAME, _T("mainframe.xml")); mainFrame.CenterWindow(); ::ShowWindow(mainFrame, SW_SHOW); DuiLib::CPaintManagerUI::MessageLoop(); } GlobalSet::UninitGlobal(); ::OleUninitialize(); return 0; }