various arch modifications, mainly for file download support

This commit is contained in:
AJ Kelly
2010-12-15 19:15:53 -06:00
parent 6d70de3199
commit a4fe858757
15 changed files with 258 additions and 116 deletions
+16 -1
View File
@@ -92,7 +92,7 @@ RString ArchHooks_Win32::GetMachineId() const
return RString();
}
bool ArchHooks_Win32::CheckForMultipleInstances()
bool ArchHooks_Win32::CheckForMultipleInstances(int argc, char* argv[])
{
if( !g_bIsMultipleInstance )
return false;
@@ -117,6 +117,21 @@ bool ArchHooks_Win32::CheckForMultipleInstances()
SetForegroundWindow( data.hResult );
else
SetForegroundWindow( hWnd );
// Send the command line to the existing window.
vector<RString> vsArgs;
for( int i=0; i<argc; i++ )
vsArgs.push_back( argv[i] );
RString sAllArgs = join("|", vsArgs);
COPYDATASTRUCT cds;
cds.dwData = 0;
cds.cbData = sAllArgs.size();
cds.lpData = (void*)sAllArgs.data();
SendMessage(
(HWND)hWnd, // HWND hWnd = handle of destination window
WM_COPYDATA,
(WPARAM)NULL, // HANDLE OF SENDING WINDOW
(LPARAM)&cds ); // 2nd msg parameter = pointer to COPYDATASTRUCT
}
return true;