X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6f65e33794fca0c936227235515a40e7df5c56e3..73fb82f3f3c1e722ad874d487c85249f6e866fbf:/src/msw/utils.cpp diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 2b159bb6f1..b97c5f8575 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -10,8 +10,9 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ -#pragma implementation -#pragma implementation "utils.h" +// Note: this is done in utilscmn.cpp now. +// #pragma implementation +// #pragma implementation "utils.h" #endif // For compilers that support precompilation, includes "wx.h". @@ -188,8 +189,8 @@ bool wxGetUserName(char *buf, int maxSize) // } #else #if !defined(__WATCOMC__) && !defined(__GNUWIN32__) && USE_PENWINDOWS - extern HANDLE hPenWin; // PenWindows Running? - if (hPenWin) + extern HANDLE g_hPenWin; // PenWindows Running? + if (g_hPenWin) { // PenWindows Does have a user concept! // Get the current owner of the recognizer @@ -207,97 +208,6 @@ bool wxGetUserName(char *buf, int maxSize) #endif } -// Execute a command (e.g. another program) in a -// system-independent manner. - -long wxExecute(char **argv, bool sync) -{ - if (*argv == NULL) - return 0; - - char command[1024]; - command[0] = '\0'; - - int argc; - for (argc = 0; argv[argc]; argc++) - { - if (argc) - strcat(command, " "); - strcat(command, argv[argc]); - } - - return wxExecute((char *)command, sync); -} - -long wxExecute(const wxString& command, bool sync) -{ - if (command == "") - return 0; - -#ifdef __WIN32__ - char * cl; - char * argp; - int clen; - HINSTANCE result; - DWORD dresult; - - // copy the command line - clen = command.Length(); - if (!clen) return -1; - cl = (char *) calloc( 1, 256); - if (!cl) return -1; - strcpy( cl, WXSTRINGCAST command); - - // isolate command and arguments - argp = strchr( cl, ' '); - if (argp) - *argp++ = '\0'; - - // execute the command -#ifdef __GNUWIN32__ - result = ShellExecute( (HWND) (wxTheApp->GetTopWindow() ? (HWND) wxTheApp->GetTopWindow()->GetHWND() : NULL), - (const wchar_t) "open", (const wchar_t) cl, (const wchar_t) argp, (const wchar_t) NULL, SW_SHOWNORMAL); -#else - result = ShellExecute( (HWND) (wxTheApp->GetTopWindow() ? wxTheApp->GetTopWindow()->GetHWND() : NULL), - "open", cl, argp, NULL, SW_SHOWNORMAL); -#endif - - if (((long)result) <= 32) { - free(cl); - return 0; - } - - if (!sync) - { - free(cl); - return dresult; - } - - // waiting until command executed - do { - wxYield(); - dresult = GetModuleFileName( result, cl, 256); - } while( dresult); - - /* long lastError = GetLastError(); */ - - free(cl); - return 0; -#else - long instanceID = WinExec((LPCSTR) WXSTRINGCAST command, SW_SHOW); - if (instanceID < 32) return(0); - - if (sync) { - int running; - do { - wxYield(); - running = GetModuleUsage((HANDLE)instanceID); - } while (running); - } - return(instanceID); -#endif -} - int wxKill(long pid, int sig) { return 0; @@ -455,9 +365,9 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn) # ifdef __WINDOWS_386__ retValue = wxWIN386; # else -# if !defined(__WATCOMC__) && !defined(GNUWIN32) - extern HANDLE hPenWin; - retValue = hPenWin ? wxPENWINDOWS : wxWINDOWS ; +# if !defined(__WATCOMC__) && !defined(GNUWIN32) && USE_PENWINDOWS + extern HANDLE g_hPenWin; + retValue = g_hPenWin ? wxPENWINDOWS : wxWINDOWS ; # endif # endif // @@@@ To be completed. I don't have the manual here... @@ -650,7 +560,7 @@ bool wxCheckForInterrupt(wxWindow *wnd) // MSW only: get user-defined resource from the .res file. // Returns NULL or newly-allocated memory, so use delete[] to clean up. -#ifdef __WINDOWS__ +#ifdef __WXMSW__ char *wxLoadUserResource(const wxString& resourceName, const wxString& resourceType) { char *s = NULL;