Sha256: bc48c0fab22d378bfed758bd53c84ed9ef88129af577d1cfea42e8ee7f9fe6c4
Contents?: true
Size: 1.36 KB
Versions: 17
Compression:
Stored size: 1.36 KB
Contents
#include <Windows.h> #include "RhoPort.h" #include "RhoStd.h" #include "common/RhoFilePath.h" #include "common/StringConverter.h" #include "common/RhodesApp.h" #include "Intents.h" extern "C" const wchar_t* rho_wmimpl_get_window_nameW(); namespace { HANDLE g_intentEvent; } namespace rho { void waitIntentEvent(const rho::String& appName) { common::CFilePath oPath(appName); rho::String appNamePath = oPath.getBaseName(); appNamePath.resize(appNamePath.length() - 4); rho::String eventName = appNamePath + ".MainWindow"; rho::StringW eventNameW = common::convertToStringW(eventName) + EVENTNAME_PREFIX; HANDLE anotherEvent = CreateEvent( NULL, false, false, eventNameW.c_str()); if (anotherEvent != NULL && GetLastError() == ERROR_ALREADY_EXISTS) { WaitForSingleObject(anotherEvent, INFINITE); } CloseHandle(anotherEvent); return; } bool createIntentEvent() { rho::String eventName = RHODESAPP().getAppName() + ".MainWindow";//rho_wmimpl_get_window_nameW(); rho::StringW eventNameW = common::convertToStringW(eventName) + EVENTNAME_PREFIX; g_intentEvent = CreateEvent( NULL, false, false, eventNameW.c_str() ); if (g_intentEvent != NULL && GetLastError() == ERROR_ALREADY_EXISTS) { return false; } return true; } // void fireIntentEvent() { SetEvent(g_intentEvent); } } //end of rho
Version data entries
17 entries across 17 versions & 2 rubygems