X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c1cb41536a6106968b546cdba8d3d89805f802bc..9c9c3d7a8f6c4ee3481674e901d34714ee18915d:/src/msw/utils.cpp diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index d9fcbb0033..986e6602bf 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -48,7 +48,7 @@ #include "wx/timer.h" -#if !defined(__GNUWIN32__) && !defined(__WXWINE__) && !defined(__SALFORDC__) && !defined(__WXMICROWIN__) +#if !defined(__GNUWIN32__) && !defined(__SALFORDC__) && !defined(__WXMICROWIN__) #include #ifndef __MWERKS__ @@ -78,8 +78,10 @@ #include #endif // USE_NET_API -#if defined(__WIN32__) && !defined(__WXWINE__) && !defined(__WXMICROWIN__) - #include +#if defined(__WIN32__) && !defined(__WXMICROWIN__) + #ifndef __UNIX__ + #include + #endif #ifndef __GNUWIN32__ #include @@ -199,7 +201,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) if ( pHostEnt ) { - host = pHostEnt->h_name; + host = wxString::FromAscii(pHostEnt->h_name); } } } @@ -600,14 +602,16 @@ bool wxGetEnv(const wxString& var, wxString *value) { #ifdef __WIN16__ const wxChar* ret = wxGetenv(var); - if (ret) + if ( !ret ) + return FALSE; + + if ( value ) { *value = ret; - return TRUE; } - else - return FALSE; -#else + + return TRUE; +#else // Win32 // first get the size of the buffer DWORD dwRet = ::GetEnvironmentVariable(var, NULL, 0); if ( !dwRet ) @@ -623,7 +627,7 @@ bool wxGetEnv(const wxString& var, wxString *value) } return TRUE; -#endif +#endif // Win16/32 } bool wxSetEnv(const wxString& var, const wxChar *value) @@ -660,6 +664,8 @@ struct wxFindByPidParams // the PID we're looking from DWORD pid; + + DECLARE_NO_COPY_CLASS(wxFindByPidParams) }; // wxKill helper: EnumWindows() callback which is used to find the first (top @@ -867,7 +873,7 @@ bool wxShell(const wxString& command) cmd.Printf(wxT("%s /c %s"), shell, command.c_str()); } - return wxExecute(cmd, TRUE /* sync */) != 0; + return wxExecute(cmd, wxEXEC_SYNC) == 0; } // Shutdown or reboot the PC