Changeset 201 for trunk/src/helpers/apps.c
- Timestamp:
- Aug 11, 2002, 7:07:59 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/apps.c
r196 r201 39 39 40 40 #define INCL_WINPROGRAMLIST // needed for PROGDETAILS, wppgm.h 41 #define INCL_WINSHELLDATA 41 42 #define INCL_WINERRORS 42 43 #define INCL_SHLERRORS … … 1146 1147 *@@added V0.9.18 (2002-03-27) [umoeller] 1147 1148 *@@changed V0.9.19 (2002-03-28) [umoeller]: now allocating contiguous buffer 1149 *@@changed V0.9.20 (2002-07-03) [umoeller]: fixed Win-OS/2 full screen breakage 1150 *@@changed V0.9.20 (2002-07-03) [umoeller]: fixed broken bat and cmd files when PROG_DEFAULT was set 1148 1151 */ 1149 1152 … … 1163 1166 1164 1167 if (!pcProgDetails && !ppDetails) 1165 return (ERROR_INVALID_PARAMETER);1168 return ERROR_INVALID_PARAMETER; 1166 1169 1167 1170 /* … … 1386 1389 { 1387 1390 if ( (ulIsWinApp) 1388 && ( ( Details.pszEnvironment == NULL)1389 || (! strlen(Details.pszEnvironment))1391 && ( (!(Details.pszEnvironment)) 1392 || (!(*Details.pszEnvironment)) 1390 1393 ) 1391 1394 ) … … 1729 1732 1730 1733 if (!pcProgDetails) 1731 return (ERROR_INVALID_PARAMETER);1734 return ERROR_INVALID_PARAMETER; 1732 1735 1733 1736 if (pszFailingName) … … 1933 1936 1934 1937 if (!phapp) 1935 return (ERROR_INVALID_PARAMETER);1938 return ERROR_INVALID_PARAMETER; 1936 1939 1937 1940 if (!(arc = appBuildProgDetails(&pDetails, … … 2015 2018 /* 2016 2019 *@@ appQuickStartApp: 2017 * shortcut for simply starting an app and 2018 * waiting until it's finished. 2020 * shortcut for simply starting an app. 2019 2021 * 2020 2022 * On errors, NULLHANDLE is returned. 2021 2023 * 2022 * If pulReturnCode != NULL, it receives the 2023 * return code of the app. 2024 * Only if pulExitCode != NULL, we wait for 2025 * the app to complete and return the 2026 * exit code. 2024 2027 * 2025 2028 *@@added V0.9.16 (2001-10-19) [umoeller] 2029 *@@changed V0.9.20 (2002-08-10) [umoeller]: fixed missing destroy window, made wait optional 2030 *@@changed V0.9.20 (2002-08-10) [umoeller]: added pcszWorkingDir 2026 2031 */ 2027 2032 2028 2033 HAPP appQuickStartApp(const char *pcszFile, 2029 ULONG ulProgType, // e.g. PROG_PM 2030 const char *pcszArgs, 2031 PULONG pulExitCode) 2034 ULONG ulProgType, // e.g. PROG_PM 2035 const char *pcszArgs, // in: arguments (can be NULL) 2036 const char *pcszWorkingDir, // in: working dir (can be NULL) 2037 PULONG pulExitCode) // out: exit code; if ptr is NULL, we don't wait 2032 2038 { 2033 2039 PROGDETAILS pd = {0}; … … 2043 2049 pd.pszExecutable = (PSZ)pcszFile; 2044 2050 pd.pszParameters = (PSZ)pcszArgs; 2045 if (p = strrchr(pcszFile, '\\')) 2051 2052 if ( (!(pd.pszStartupDir = (PSZ)pcszWorkingDir)) 2053 && (p = strrchr(pcszFile, '\\')) 2054 ) 2046 2055 { 2047 2056 strhncpy0(szDir, … … 2060 2069 ) 2061 2070 { 2062 if (appWaitForApp(hwndObject, 2071 if (pulExitCode) 2072 appWaitForApp(hwndObject, 2063 2073 happ, 2064 pulExitCode)) 2065 happReturn = happ; 2074 pulExitCode); 2075 2076 happReturn = happ; 2077 2078 WinDestroyWindow(hwndObject); // was missing V0.9.20 (2002-08-10) [umoeller] 2066 2079 } 2067 2080 2068 2081 return happReturn; 2069 2082 } 2083 2084 /* 2085 *@@ appOpenURL: 2086 * opens the system default browser with the given 2087 * URL. 2088 * 2089 *@@added V0.9.20 (2002-08-10) [umoeller] 2090 */ 2091 2092 BOOL appOpenURL(PCSZ pcszURL) 2093 { 2094 BOOL brc = FALSE; 2095 2096 CHAR szBrowser[CCHMAXPATH], 2097 szStartupDir[CCHMAXPATH]; 2098 XSTRING strParameters; 2099 2100 xstrInit(&strParameters, 0); 2101 2102 if (PrfQueryProfileString(HINI_USER, 2103 "WPURLDEFAULTSETTINGS", 2104 "DefaultBrowserExe", 2105 "NETSCAPE.EXE", 2106 szBrowser, 2107 sizeof(szBrowser))) 2108 { 2109 PSZ pszDefParams; 2110 2111 if (pszDefParams = prfhQueryProfileData(HINI_USER, 2112 "WPURLDEFAULTSETTINGS", 2113 "DefaultParameters", 2114 NULL)) 2115 { 2116 xstrcpy(&strParameters, pszDefParams, 0); 2117 xstrcatc(&strParameters, ' '); 2118 free(pszDefParams); 2119 } 2120 2121 xstrcat(&strParameters, pcszURL, 0); 2122 2123 PrfQueryProfileString(HINI_USER, 2124 "WPURLDEFAULTSETTINGS", 2125 "DefaultWorkingDir", 2126 "", 2127 szStartupDir, 2128 sizeof(szStartupDir)); 2129 2130 2131 brc = !!appQuickStartApp(szBrowser, 2132 PROG_DEFAULT, 2133 strParameters.psz, 2134 szStartupDir, 2135 NULL); // don't wait 2136 } 2137 2138 xstrClear(&strParameters); 2139 2140 return brc; 2141 }
Note:
See TracChangeset
for help on using the changeset viewer.