// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
wxLogLastError(_T("PeekNamedPipe"));
}
- // don't try to continue reading from a pipe if an error occured or if
+ // don't try to continue reading from a pipe if an error occurred or if
// it had been closed
::CloseHandle(m_hInput);
: wxSTREAM_READ_ERROR;
}
- // bytesRead is set to 0, as desired, if an error occured
+ // bytesRead is set to 0, as desired, if an error occurred
return bytesRead;
}
#if wxUSE_IPC
// connect to the given server via DDE and ask it to execute the command
-static bool wxExecuteDDE(const wxString& ddeServer,
- const wxString& ddeTopic,
- const wxString& ddeCommand)
+bool
+wxExecuteDDE(const wxString& ddeServer,
+ const wxString& ddeTopic,
+ const wxString& ddeCommand)
{
bool ok wxDUMMY_INITIALIZE(false);
wxDDEClient client;
- wxConnectionBase *conn = client.MakeConnection(wxEmptyString,
- ddeServer,
- ddeTopic);
+ wxConnectionBase *
+ conn = client.MakeConnection(wxEmptyString, ddeServer, ddeTopic);
if ( !conn )
{
ok = false;
long wxExecute(const wxString& cmd, int flags, wxProcess *handler)
{
- wxCHECK_MSG( !cmd.IsEmpty(), 0, wxT("empty command in wxExecute") );
+ wxCHECK_MSG( !cmd.empty(), 0, wxT("empty command in wxExecute") );
#if wxUSE_THREADS
// for many reasons, the code below breaks down if it's called from another
wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
wxCHECK_MSG( traits, -1, _T("no wxAppTraits in wxExecute()?") );
- // disable all app windows while waiting for the child process to finish
- void *cookie = traits->BeforeChildWaitLoop();
+ void *cookie = NULL;
+ if ( !(flags & wxEXEC_NODISABLE) )
+ {
+ // disable all app windows while waiting for the child process to finish
+ cookie = traits->BeforeChildWaitLoop();
+ }
// wait until the child process terminates
while ( data->state )
traits->AlwaysYield();
}
- traits->AfterChildWaitLoop(cookie);
+ if ( !(flags & wxEXEC_NODISABLE) )
+ {
+ // reenable disabled windows back
+ traits->AfterChildWaitLoop(cookie);
+ }
DWORD dwExitCode = data->dwExitCode;
delete data;