diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-09-23 01:53:11 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-09-23 01:53:11 +0000 |
commit | afe61eb994377e25d60d0a0893510a693149c6be (patch) | |
tree | 80c6e33cd664e5c8b1c5f55c3b7b49c081dd590a /indra/newview/llappviewerwin32.cpp | |
parent | 2945882258ad1befe8e8094c0a1a655e4ddbcd30 (diff) |
QAR-849 merge maint-viewer-10-merge 96838-97237 -> release
Diffstat (limited to 'indra/newview/llappviewerwin32.cpp')
-rw-r--r-- | indra/newview/llappviewerwin32.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index bdffaeafb3..06b2a467de 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -64,7 +64,7 @@ #include "llcommandlineparser.h" -//*FIX:Mani - This hack is to fix a linker issue with libndofdev.lib +// *FIX:Mani - This hack is to fix a linker issue with libndofdev.lib // The lib was compiled under VS2005 - in VS2003 we need to remap assert #ifdef LL_DEBUG #ifdef LL_MSVC7 @@ -77,6 +77,8 @@ extern "C" { #endif #endif +const std::string LLAppViewerWin32::sWindowClass = "Second Life"; + LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop) { // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. @@ -478,6 +480,33 @@ void LLAppViewerWin32::handleCrashReporting() } } +//virtual +bool LLAppViewerWin32::sendURLToOtherInstance(const std::string& url) +{ + wchar_t window_class[256]; /* Flawfinder: ignore */ // Assume max length < 255 chars. + mbstowcs(window_class, sWindowClass.c_str(), 255); + window_class[255] = 0; + // Use the class instead of the window name. + HWND other_window = FindWindow(window_class, NULL); + + if (other_window != NULL) + { + lldebugs << "Found other window with the name '" << getWindowTitle() << "'" << llendl; + COPYDATASTRUCT cds; + const S32 SLURL_MESSAGE_TYPE = 0; + cds.dwData = SLURL_MESSAGE_TYPE; + cds.cbData = url.length() + 1; + cds.lpData = (void*)url.c_str(); + + LRESULT msg_result = SendMessage(other_window, WM_COPYDATA, NULL, (LPARAM)&cds); + lldebugs << "SendMessage(WM_COPYDATA) to other window '" + << getWindowTitle() << "' returned " << msg_result << llendl; + return true; + } + return false; +} + + std::string LLAppViewerWin32::generateSerialNumber() { char serial_md5[MD5HEX_STR_SIZE]; // Flawfinder: ignore |