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

Version Path
rhodes-7.6.0 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-7.5.1 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-7.4.1 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-7.1.17 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-6.2.0 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-6.0.11 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-5.5.18 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-5.5.17 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-5.5.15 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-5.5.0.22 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-5.5.2 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-5.5.0.7 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-5.5.0.3 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
rhodes-5.5.0 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
tauplatform-1.0.3 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
tauplatform-1.0.2 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp
tauplatform-1.0.1 lib/commonAPI/coreapi/ext/platform/wm/src/Intents.cpp