Skip to content

Instantly share code, notes, and snippets.

@domenic
Created November 6, 2012 22:23
Show Gist options
  • Select an option

  • Save domenic/4028057 to your computer and use it in GitHub Desktop.

Select an option

Save domenic/4028057 to your computer and use it in GitHub Desktop.

Revisions

  1. domenic revised this gist Nov 8, 2012. 1 changed file with 23 additions and 0 deletions.
    23 changes: 23 additions & 0 deletions runner.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8" />
    <title>runner</title>

    <!-- WinJS references -->
    <link href="//Microsoft.WinJS.1.0/css/ui-dark.css" rel="stylesheet" />
    <script src="//Microsoft.WinJS.1.0/js/base.js"></script>
    <script src="//Microsoft.WinJS.1.0/js/ui.js"></script>

    <script>
    WinJS.Application.start();

    // Somehow run the tests here?

    setTimeout(function () {
    window.close();
    }, 2000);
    </script>
    </head>
    <body></body>
    </html>
  2. domenic revised this gist Nov 6, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions launcher.cpp
    Original file line number Diff line number Diff line change
    @@ -10,8 +10,8 @@ int wmain(int argc, wchar_t* argv[])
    IApplicationActivationManager* aam = nullptr;

    HRESULT hr = CoCreateInstance(CLSID_ApplicationActivationManager, nullptr, CLSCTX_INPROC_SERVER,
    IID_PPV_ARGS(&aam));
    if(FAILED(hr)) {
    IID_PPV_ARGS(&aam));
    if (FAILED(hr)) {
    wprintf(L"Error creating ApplicationActivationManager");
    return 1;
    }
  3. domenic created this gist Nov 6, 2012.
    30 changes: 30 additions & 0 deletions launcher.cpp
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    #include <SDKDDKVer.h>
    #include <ShObjIdl.h>
    #include <tchar.h>

    int wmain(int argc, wchar_t* argv[])
    {
    const wchar_t* appId = L"WinningJS-test-runner_aw9cjjms6ptaw!App";

    CoInitialize(nullptr);
    IApplicationActivationManager* aam = nullptr;

    HRESULT hr = CoCreateInstance(CLSID_ApplicationActivationManager, nullptr, CLSCTX_INPROC_SERVER,
    IID_PPV_ARGS(&aam));
    if(FAILED(hr)) {
    wprintf(L"Error creating ApplicationActivationManager");
    return 1;
    }

    DWORD pid = 0;
    hr = aam->ActivateApplication(appId, nullptr, AO_NONE, &pid);
    if (FAILED(hr)) {
    wprintf(L"Error calling ActivateApplication");
    return 1;
    }

    aam->Release();
    CoUninitialize();

    return 0;
    }