- Merge from trunk up to r45543
[reactos.git] / base / shell / explorer / utility / utility.cpp
index fdb74c2..d20c73b 100644 (file)
@@ -13,7 +13,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 
@@ -158,7 +158,7 @@ String Context::getStackTrace() const
 
 BOOL time_to_filetime(const time_t* t, FILETIME* ftime)
 {
-#ifdef __STDC_WANT_SECURE_LIB__
+#if defined(__STDC_WANT_SECURE_LIB__) && defined(_MS_VER)
        SYSTEMTIME stime;
        struct tm tm_;
        struct tm* tm = &tm_;
@@ -382,10 +382,12 @@ BOOL RunDLL(HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT n
 
 BOOL launch_cpanel(HWND hwnd, LPCTSTR applet)
 {
-       //launch_file(_hwnd, applet, SW_SHOWNORMAL);    // This would be enough, but we want the to use the most direct and fastest call.
-       //launch_file(_hwnd, String(TEXT("rundll32.exe /d shell32.dll,Control_RunDLL "))+applet, SW_SHOWNORMAL);
+       TCHAR parameters[MAX_PATH];
+       
+       _tcscpy(parameters, TEXT("shell32.dll,Control_RunDLL "));
+       _tcscat(parameters, applet);
 
-       return RunDLL(hwnd, TEXT("shell32"), CONTROL_RUNDLL, applet, SW_SHOWNORMAL);
+       return ((int)ShellExecute(hwnd, TEXT("open"), TEXT("rundll32.exe"), parameters, NULL, SW_SHOWDEFAULT) > 32);
 }