Add wxProcess::Activate() and implement it for MSW.

When launching child processes it can be convenient to be able to switch to
them later, provide a method in wxProcess to do it.

Currently this is only implemented in wxMSW but could almost certainly be done
for wxOSX too (it can be done using Apple Script, so presumably there is a way
to do it programmatically as well) and could be also made to work at least
under some Unix systems by emulating what wmctrl does (or just launching it?).
This commit is contained in:
Vadim Zeitlin
2015-03-10 20:28:22 +01:00
parent d161a74f67
commit fe33cfc83f
5 changed files with 55 additions and 0 deletions

View File

@@ -176,6 +176,18 @@ bool wxProcess::Exists(int pid)
}
}
bool wxProcess::Activate() const
{
#ifdef __WINDOWS__
// This function is defined in src/msw/utils.cpp.
extern bool wxMSWActivatePID(long pid);
return wxMSWActivatePID(m_pid);
#else
return false;
#endif
}
void wxProcess::SetPriority(unsigned priority)
{
wxCHECK_RET( priority <= wxPRIORITY_MAX,