Exemplo n.º 1
0
int APIENTRY wWinMain(HINSTANCE hInstance,
                      HINSTANCE hPrevInstance,
                      LPTSTR    lpCmdLine,
                      int       nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);
    breakpad_init();
    setUserPWD();

    CefSettings settings;

#ifdef NDEBUG
    settings.log_severity = LOGSEVERITY_ERROR;
#endif

#ifdef TEST_SINGLE_THREADED_MESSAGE_LOOP
    settings.multi_threaded_message_loop = false;
#else
    settings.multi_threaded_message_loop = true;
#endif
    if(!WindowsVersionOK()) {
        MessageBox(NULL,L"Pea Search only support Window XP, Vista and Win7 .", L"Pea Search Warn",MB_OK);
        return 0;
    }
    CefInitialize(settings);
    InitSchemeTest();
    InitPlugin();
    MyRegisterClass(hInstance);
    if (!InitInstance (hInstance, nCmdShow)) return FALSE;

    if(OleInitialize(NULL)!=S_OK) MessageBox(NULL,L"warn",L"ole init failed.",MB_OK);
    connect_named_pipe();
    SetForegroundWindow(hMainWin);
    SetFocus(hMainWin);
    MSG msg;
    while (GetMessage(&msg, NULL, 0, 0)) {
#ifdef TEST_SINGLE_THREADED_MESSAGE_LOOP
        // Allow the CEF to do its message loop processing.
        CefDoMessageLoopWork();
#endif
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
    close_named_pipe();
    OleUninitialize();
    CefShutdown();
    return (int) msg.wParam;
}
Exemplo n.º 2
0
		SReadWriteChannel CHANNEL_PUBLIC connect_duplex_named_pipe(const char* name)
		{
			return SReadWriteChannel(connect_named_pipe(name,GENERIC_READ | GENERIC_WRITE));
		}