Aggiunto meccanismo per eseguire piu' istanze di un' applicazione in Win95
git-svn-id: svn://10.65.10.50/trunk@1828 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4105a3beed
commit
d1c4ead9df
@ -15,6 +15,7 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
|
#include <utility.h>
|
||||||
#include <window.h>
|
#include <window.h>
|
||||||
|
|
||||||
// @doc EXTERNAL
|
// @doc EXTERNAL
|
||||||
@ -71,6 +72,26 @@ int TExternal_app::run(
|
|||||||
main_app().begin_wait();
|
main_app().begin_wait();
|
||||||
_exitcode = WinExec((char*)(const char*)path, SW_SHOW);
|
_exitcode = WinExec((char*)(const char*)path, SW_SHOW);
|
||||||
|
|
||||||
|
while (_exitcode == 16)
|
||||||
|
{
|
||||||
|
const int spc = path.find(' ');
|
||||||
|
TFilename name(path.left(spc)), oldname(name);
|
||||||
|
|
||||||
|
name.ext("");
|
||||||
|
if (isdigit(name.right(1)[0]))
|
||||||
|
name << 'a';
|
||||||
|
else
|
||||||
|
name[name.len() - 1]++;
|
||||||
|
name.ext("exe");
|
||||||
|
if (!fexist(name))
|
||||||
|
{
|
||||||
|
oldname.ext("exe");
|
||||||
|
fcopy(oldname, name);
|
||||||
|
}
|
||||||
|
name << path.mid(spc);
|
||||||
|
path = name;
|
||||||
|
_exitcode = WinExec((char*)(const char*)path, SW_SHOW);
|
||||||
|
}
|
||||||
if (_exitcode >= 32)
|
if (_exitcode >= 32)
|
||||||
{
|
{
|
||||||
if (!async)
|
if (!async)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user