| 215 | } |
| 216 | |
| 217 | int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow) { |
| 218 | g_hSingleInstMutex = ::CreateMutex(nullptr, FALSE, L"WinArkSingleInstanceMutex"); |
| 219 | if (!::wcsstr(lpstrCmdLine, L"runas")) { |
| 220 | if (g_hSingleInstMutex) { |
| 221 | if (::GetLastError() == ERROR_ALREADY_EXISTS) { |
| 222 | MessageBox(nullptr, L"�����ظ�����!!!", L"Error", MB_ICONERROR); |
| 223 | return -1; |
| 224 | } |
| 225 | } |
| 226 | } |
| 227 | HRESULT hRes = ::CoInitializeEx(nullptr,COINIT_APARTMENTTHREADED|COINIT_DISABLE_OLE1DDE); |
| 228 | ATLASSERT(SUCCEEDED(hRes)); |
| 229 | // add flags to support other controls |
| 230 | AtlInitCommonControls(ICC_BAR_CLASSES | ICC_BAR_CLASSES | ICC_LISTVIEW_CLASSES | ICC_TREEVIEW_CLASSES); |
| 231 | |
| 232 | hRes = _Module.Init(NULL, hInstance); |
| 233 | ATLASSERT(SUCCEEDED(hRes)); |
| 234 | ::SetPriorityClass(::GetCurrentProcess(), HIGH_PRIORITY_CLASS); |
| 235 | ::SetThreadPriority(::GetCurrentThread(), THREAD_PRIORITY_HIGHEST); |
| 236 | ::SetUnhandledExceptionFilter(SelfUnhandledExceptionFilter); |
| 237 | |
| 238 | if (CheckInstall(lpstrCmdLine)) |
| 239 | return 0; |
| 240 | |
| 241 | int nRet = Run(lpstrCmdLine, nCmdShow); |
| 242 | |
| 243 | _Module.Term(); |
| 244 | ::CoUninitialize(); |
| 245 | ::CloseHandle(g_hSingleInstMutex); |
| 246 | |
| 247 | return nRet; |
| 248 | } |
| 249 |
nothing calls this directly
no test coverage detected