Exemple #1
0
VOID
ManagerStartMain(VOID * arg)
{
    BOOLEAN isService = (BOOLEAN) arg;
    CExt2MgrDlg* dlg = (CExt2MgrDlg*)theApp.m_pMainWnd;

    if (dlg) {

        if (!dlg->m_bQuiet) {
            CSplash* splash = new CSplash(IDB_ABOUT_SCREEN, RGB(128, 128, 128));
            splash->ShowSplash();
            dlg->m_splash = splash;
        }

        if (isService) {
            ManagerReportStatus(
                ServiceHandle,
                &ServiceStatus,
                SERVICE_RUNNING,
                NO_ERROR, 0   );
        }

        dlg->DoModal();
    }

    if (isService) {
        ManagerReportStatus(
            ServiceHandle,
            &ServiceStatus,
            SERVICE_STOPPED,
            NO_ERROR, 0   );
    }
}
Exemple #2
0
/*
MAIN - EINSTIEGSPUNKT
*/
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	HANDLE hMutex = CreateMutex(NULL, true, TRAINERNAME);

	if (GetLastError() == ERROR_ALREADY_EXISTS || hMutex == INVALID_HANDLE_VALUE)
		return FALSE;

	g_hInstance = hInstance;

	// "Software\\Nadeo\\TMUltraTrainer"
	Registration::SetSavePath("Software\\Nadeo\\TMUltraTrainer");

	if (!Registration::CheckRegistration())
	{
		DialogBox(GetDllModule(), MAKEINTRESOURCE(IDD_DIALOG3), NULL, Registration::RegistrationProc);
	}

	if (!Registration::IsRegistered())
		return FALSE;

	InitConsole();

	CSplash splash;
	splash.SetBitmap((HBITMAP)LoadImage(g_hInstance, MAKEINTRESOURCE(IDB_BITMAP1), IMAGE_BITMAP, NULL, NULL, NULL));
	splash.SetTransparentColor(RGB(255,255,255));
	splash.ShowSplash();

	g_hLowLevelKeyHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, GetModuleHandle(NULL), NULL);
	
	Sleep(2000);
	splash.CloseSplash();
	
	CreateDialog(hInstance,MAKEINTRESOURCE(IDD_DIALOG1), NULL, DialogProc);
	ShowWindow(g_hWindow, SW_SHOW);

	// Hauptnachrichtenschleife:
	MSG msg;
	while (GetMessage(&msg, NULL, 0, 0))
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}

	return (int) msg.wParam;
}