mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 06:03:26 +02:00
Send hifi command line url to other instance
This commit is contained in:
parent
ab758648c7
commit
9e34b36839
2 changed files with 16 additions and 0 deletions
|
@ -166,6 +166,13 @@ public:
|
|||
if (message->message == WM_SHOWWINDOW) {
|
||||
Application::getInstance()->getWindow()->showNormal();
|
||||
}
|
||||
if (message->message == WM_COPYDATA) {
|
||||
COPYDATASTRUCT* pcds = (COPYDATASTRUCT*)(message->lParam);
|
||||
QUrl url = QUrl((const char*)(pcds->lpData));
|
||||
if (url.isValid() && url.scheme() == HIFI_URL_SCHEME) {
|
||||
DependencyManager::get<AddressManager>()->handleLookupString(url.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include <SharedUtil.h>
|
||||
|
||||
#include "AddressManager.h"
|
||||
#include "Application.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
@ -48,6 +49,14 @@ int main(int argc, const char * argv[]) {
|
|||
if (otherInstance) {
|
||||
ShowWindow(otherInstance, SW_RESTORE);
|
||||
SetForegroundWindow(otherInstance);
|
||||
|
||||
QUrl url = QUrl(argv[1]);
|
||||
if (url.isValid() && url.scheme() == HIFI_URL_SCHEME) {
|
||||
COPYDATASTRUCT cds;
|
||||
cds.cbData = strlen(argv[1]) + 1;
|
||||
cds.lpData = (PVOID)argv[1];
|
||||
SendMessage(otherInstance, WM_COPYDATA, 0, (LPARAM)&cds);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue