Created
November 6, 2012 22:23
-
-
Save domenic/4028057 to your computer and use it in GitHub Desktop.
Programmatically running a Windows 8 Metro app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment