/////////////////////////////////////////////////////////////////////////////
#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".
// }
#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
#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;
# 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...
// 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;