Author: janderwald
Date: Thu Feb 7 14:23:38 2008
New Revision: 32184
URL:
http://svn.reactos.org/svn/reactos?rev=32184&view=rev
Log:
- change cmd "control" to "control.exe"
- fix over-translated strings
- acquire full path for the traget executable and directly invoke CreateProcess
- zero initialize param szTemp to fix a possible buffer overflow
- fixes bug 3027
Modified:
trunk/reactos/base/applications/msconfig/lang/bg-BG.rc
trunk/reactos/base/applications/msconfig/lang/ca-ES.rc
trunk/reactos/base/applications/msconfig/lang/cs-CZ.rc
trunk/reactos/base/applications/msconfig/lang/de-DE.rc
trunk/reactos/base/applications/msconfig/lang/el-GR.rc
trunk/reactos/base/applications/msconfig/lang/en-US.rc
trunk/reactos/base/applications/msconfig/lang/fr-FR.rc
trunk/reactos/base/applications/msconfig/lang/hu-HU.rc
trunk/reactos/base/applications/msconfig/lang/id-ID.rc
trunk/reactos/base/applications/msconfig/lang/it-IT.rc
trunk/reactos/base/applications/msconfig/lang/nb-NO.rc
trunk/reactos/base/applications/msconfig/lang/nl-NL.rc
trunk/reactos/base/applications/msconfig/lang/pl-PL.rc
trunk/reactos/base/applications/msconfig/lang/pt-BR.rc
trunk/reactos/base/applications/msconfig/lang/ru-RU.rc
trunk/reactos/base/applications/msconfig/lang/th-TH.rc
trunk/reactos/base/applications/msconfig/lang/uk-UA.rc
trunk/reactos/base/applications/msconfig/lang/zh-CN.rc
trunk/reactos/base/applications/msconfig/msconfig.rbuild
trunk/reactos/base/applications/msconfig/precomp.h
trunk/reactos/base/applications/msconfig/toolspage.c
Modified: trunk/reactos/base/applications/msconfig/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/bg-BG.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/bg-BG.rc Thu Feb 7 14:23:38 2008
@@ -158,7 +158,7 @@
IDS_TOOLS_SYSDM_NAME "Ñâîéñòâà íà ñèñòåìàòà"
IDS_TOOLS_SYSDM_DESCR "Äàâà ñâåäåíèÿ çàêîìïþòúðà."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Ïðåäìåò"
Modified: trunk/reactos/base/applications/msconfig/lang/ca-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/ca-ES.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/ca-ES.rc Thu Feb 7 14:23:38 2008
@@ -157,7 +157,7 @@
IDS_TOOLS_SYSDM_NAME "Propietats del sistema"
IDS_TOOLS_SYSDM_DESCR "Mostra la informacio d'aquest ordinador."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Element"
Modified: trunk/reactos/base/applications/msconfig/lang/cs-CZ.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/cs-CZ.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/cs-CZ.rc Thu Feb 7 14:23:38 2008
@@ -157,7 +157,7 @@
IDS_TOOLS_SYSDM_NAME "Systém"
IDS_TOOLS_SYSDM_DESCR "Zobrazí informace o systému."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Poloka"
Modified: trunk/reactos/base/applications/msconfig/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/de-DE.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/de-DE.rc Thu Feb 7 14:23:38 2008
@@ -158,7 +158,7 @@
IDS_TOOLS_SYSDM_NAME "Systemeigenschaften"
IDS_TOOLS_SYSDM_DESCR "Zeigt Informationen über diesen Rechner an."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Element"
Modified: trunk/reactos/base/applications/msconfig/lang/el-GR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/el-GR.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/el-GR.rc Thu Feb 7 14:23:38 2008
@@ -157,7 +157,7 @@
IDS_TOOLS_SYSDM_NAME "Éäéüôçôåò óõóôÞìáôïò"
IDS_TOOLS_SYSDM_DESCR "Åìöáíßæåé ðëçñïöïñßåò ãéá áõôüí ôïí õðïëïãéóôÞ."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Element"
Modified: trunk/reactos/base/applications/msconfig/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/en-US.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/en-US.rc Thu Feb 7 14:23:38 2008
@@ -157,7 +157,7 @@
IDS_TOOLS_SYSDM_NAME "System properties"
IDS_TOOLS_SYSDM_DESCR "Shows information about this computer."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Element"
Modified: trunk/reactos/base/applications/msconfig/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/fr-FR.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/fr-FR.rc Thu Feb 7 14:23:38 2008
@@ -157,7 +157,7 @@
IDS_TOOLS_SYSDM_NAME "Propriétés système"
IDS_TOOLS_SYSDM_DESCR "Affiche/modifie des information à propos de
l'ordinateur."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Elément"
Modified: trunk/reactos/base/applications/msconfig/lang/hu-HU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/hu-HU.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/hu-HU.rc Thu Feb 7 14:23:38 2008
@@ -159,7 +159,7 @@
IDS_TOOLS_SYSDM_NAME "Rendszertulajdonságok"
IDS_TOOLS_SYSDM_DESCR "Megjeleníti a számítógép információkat."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Element"
Modified: trunk/reactos/base/applications/msconfig/lang/id-ID.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/id-ID.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/id-ID.rc Thu Feb 7 14:23:38 2008
@@ -157,7 +157,7 @@
IDS_TOOLS_SYSDM_NAME "Properti Sistem"
IDS_TOOLS_SYSDM_DESCR "Menampilkan informasi mengenai komputer ini."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Elemen"
Modified: trunk/reactos/base/applications/msconfig/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/it-IT.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/it-IT.rc Thu Feb 7 14:23:38 2008
@@ -157,7 +157,7 @@
IDS_TOOLS_SYSDM_NAME "Proprietà del sistema"
IDS_TOOLS_SYSDM_DESCR "Mostra informazioni su questo pc."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Elemento"
Modified: trunk/reactos/base/applications/msconfig/lang/nb-NO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/nb-NO.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/nb-NO.rc Thu Feb 7 14:23:38 2008
@@ -157,7 +157,7 @@
IDS_TOOLS_SYSDM_NAME "System egenskaper"
IDS_TOOLS_SYSDM_DESCR "Vis informasjon om denne datamaskinen."
- IDS_TOOLS_SYSDM_CMD "kontroll"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Element"
Modified: trunk/reactos/base/applications/msconfig/lang/nl-NL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/nl-NL.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/nl-NL.rc Thu Feb 7 14:23:38 2008
@@ -177,7 +177,7 @@
IDS_TOOLS_SYSDM_NAME "Systeemeigenschappen"
IDS_TOOLS_SYSDM_DESCR "Toont informatie over deze computer"
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Element"
Modified: trunk/reactos/base/applications/msconfig/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/pl-PL.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/pl-PL.rc Thu Feb 7 14:23:38 2008
@@ -163,7 +163,7 @@
IDS_TOOLS_SYSDM_NAME "W³aciwoci systemu"
IDS_TOOLS_SYSDM_DESCR "Pokazuje informacje o tym komputerze."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Element"
Modified: trunk/reactos/base/applications/msconfig/lang/pt-BR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/pt-BR.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/pt-BR.rc Thu Feb 7 14:23:38 2008
@@ -163,7 +163,7 @@
IDS_TOOLS_SYSDM_NAME "Propriedades do sistema"
IDS_TOOLS_SYSDM_DESCR "Mostra informações sobre este computador."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Item de inicialização"
Modified: trunk/reactos/base/applications/msconfig/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/ru-RU.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/ru-RU.rc Thu Feb 7 14:23:38 2008
@@ -159,7 +159,7 @@
IDS_TOOLS_SYSDM_NAME "Íàñòðîéêè ñèñòåìû"
IDS_TOOLS_SYSDM_DESCR "Ïîêàçàòü èíôîðìàöèþ îá ýòîì êîìïüþòåðå."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Ýëåìåíò"
Modified: trunk/reactos/base/applications/msconfig/lang/th-TH.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/th-TH.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/th-TH.rc Thu Feb 7 14:23:38 2008
@@ -177,7 +177,7 @@
IDS_TOOLS_SYSDM_NAME "¤Ø³ÊÁºÑµÔ¢Í§Ãкº"
IDS_TOOLS_SYSDM_DESCR "áÊ´§¢éÍÁÙÅà¡ÕèÂǡѺ¤ÍÁ¾ÔÇàµÍÃì¹Õé"
- IDS_TOOLS_SYSDM_CMD "Êèǹ¤Çº¤ØÁ"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Êèǹ»ÃСͺ"
Modified: trunk/reactos/base/applications/msconfig/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/uk-UA.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/uk-UA.rc Thu Feb 7 14:23:38 2008
@@ -165,7 +165,7 @@
IDS_TOOLS_SYSDM_NAME "Âëàñòèâîñò³ ñèñòåìè"
IDS_TOOLS_SYSDM_DESCR "Ïîêàçóº ³íôîðìàö³þ ïðî êîìï'þòåð."
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Åëåìåíò"
Modified: trunk/reactos/base/applications/msconfig/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/lang/zh-CN.rc (original)
+++ trunk/reactos/base/applications/msconfig/lang/zh-CN.rc Thu Feb 7 14:23:38 2008
@@ -177,7 +177,7 @@
IDS_TOOLS_SYSDM_NAME "ϵͳÊôÐÔ"
IDS_TOOLS_SYSDM_DESCR "ÏÔʾÕą̂¼ÆËã»úµÄÊôÐÔ"
- IDS_TOOLS_SYSDM_CMD "control"
+ IDS_TOOLS_SYSDM_CMD "control.exe"
IDS_TOOLS_SYSDM_PARAM "sysdm.cpl"
IDS_STARTUP_COLUMN_ELEMENT "Æô¶¯ÏîÄ¿"
Modified: trunk/reactos/base/applications/msconfig/msconfig.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/msconfig.rbuild (original)
+++ trunk/reactos/base/applications/msconfig/msconfig.rbuild Thu Feb 7 14:23:38 2008
@@ -12,6 +12,7 @@
<library>version</library>
<library>comctl32</library>
<library>shell32</library>
+ <library>shlwapi</library>
<compilationunit name="unit.c">
<file>toolspage.c</file>
<file>srvpage.c</file>
Modified: trunk/reactos/base/applications/msconfig/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/precomp.h (original)
+++ trunk/reactos/base/applications/msconfig/precomp.h Thu Feb 7 14:23:38 2008
@@ -4,6 +4,8 @@
#include <winuser.h>
#include <tchar.h>
#include <stdio.h>
+#include <shlwapi.h>
+#include <shlobj.h>
#include "resource.h"
#include "msconfig.h"
Modified: trunk/reactos/base/applications/msconfig/toolspage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig/toolspage.c (original)
+++ trunk/reactos/base/applications/msconfig/toolspage.c Thu Feb 7 14:23:38 2008
@@ -13,13 +13,14 @@
HWND hToolsListCtrl;
HWND hToolsDialog;
-void AddItem ( DWORD, DWORD, DWORD, DWORD );
+void AddItem ( DWORD, DWORD, DWORD, DWORD, int );
void FillListView ( void );
DWORD ListItems_Cmds[20];
DWORD ListItems_Params[20];
+DWORD ListItems_Locations[20];
-void AddItem ( DWORD name_id, DWORD descr_id, DWORD cmd_id , DWORD param_id ) {
+void AddItem ( DWORD name_id, DWORD descr_id, DWORD cmd_id , DWORD param_id, int csidl )
{
TCHAR szTemp[256];
LV_ITEM item;
@@ -34,6 +35,7 @@
ListItems_Cmds[item.iItem] = cmd_id;
ListItems_Params[item.iItem] = param_id;
+ ListItems_Locations[item.iItem] = csidl;
LoadString(hInst, descr_id, szTemp, 256);
item.pszText = szTemp;
@@ -42,21 +44,24 @@
}
void FillListView ( void ) {
- AddItem(IDS_TOOLS_CMD_NAME, IDS_TOOLS_CMD_DESCR, IDS_TOOLS_CMD_CMD,
IDS_TOOLS_CMD_PARAM);
- AddItem(IDS_TOOLS_REGEDIT_NAME, IDS_TOOLS_REGEDIT_DESCR,
IDS_TOOLS_REGEDIT_CMD,IDS_TOOLS_REGEDIT_PARAM);
- AddItem(IDS_TOOLS_SYSDM_NAME, IDS_TOOLS_SYSDM_DESCR, IDS_TOOLS_SYSDM_CMD,
IDS_TOOLS_SYSDM_PARAM);
- AddItem(IDS_TOOLS_INFO_NAME, IDS_TOOLS_INFO_DESCR, IDS_TOOLS_INFO_CMD,
IDS_TOOLS_INFO_PARAM);
+ AddItem(IDS_TOOLS_CMD_NAME, IDS_TOOLS_CMD_DESCR, IDS_TOOLS_CMD_CMD,
IDS_TOOLS_CMD_PARAM, CSIDL_SYSTEM);
+ AddItem(IDS_TOOLS_REGEDIT_NAME, IDS_TOOLS_REGEDIT_DESCR,
IDS_TOOLS_REGEDIT_CMD,IDS_TOOLS_REGEDIT_PARAM, CSIDL_WINDOWS);
+ AddItem(IDS_TOOLS_SYSDM_NAME, IDS_TOOLS_SYSDM_DESCR, IDS_TOOLS_SYSDM_CMD,
IDS_TOOLS_SYSDM_PARAM, CSIDL_SYSTEM);
+ AddItem(IDS_TOOLS_INFO_NAME, IDS_TOOLS_INFO_DESCR, IDS_TOOLS_INFO_CMD,
IDS_TOOLS_INFO_PARAM, CSIDL_SYSTEM);
}
INT_PTR CALLBACK
ToolsPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
LV_COLUMN column;
- TCHAR szTemp[256];
+ TCHAR szTemp[MAX_PATH*2];
TCHAR szTemp2[256];
+ TCHAR * Ptr = NULL;
LPNMITEMACTIVATE lpnmitem;
LPNMHDR nmh;
DWORD dwStyle;
+ PROCESS_INFORMATION pi;
+ STARTUPINFO si;
switch (message)
{
@@ -96,9 +101,27 @@
{
if (ListView_GetSelectionMark(hToolsListCtrl) != -1)
{
- LoadString(hInst,
ListItems_Cmds[ListView_GetSelectionMark(hToolsListCtrl)], szTemp, 256);
+ if (SHGetSpecialFolderPath(NULL, szTemp,
ListItems_Locations[ListView_GetSelectionMark(hToolsListCtrl)], FALSE))
+ Ptr = PathAddBackslash(szTemp);
+
+ if (!Ptr)
+ Ptr = szTemp;
+
+ szTemp2[0] = _T('\0');
+ LoadString(hInst,
ListItems_Cmds[ListView_GetSelectionMark(hToolsListCtrl)], Ptr, 256);
LoadString(hInst,
ListItems_Params[ListView_GetSelectionMark(hToolsListCtrl)], szTemp2, 256);
- ShellExecute(0, _T("open"), szTemp, szTemp2,
_T(""), SW_NORMAL);
+ if (_tcslen(szTemp2))
+ {
+ _tcscat(szTemp, _T(" "));
+ _tcscat(Ptr, szTemp2);
+ }
+ ZeroMemory(&si, sizeof(STARTUPINFO));
+ si.cb = sizeof(STARTUPINFO);
+ if (CreateProcess(NULL, szTemp, NULL, NULL, FALSE, 0, NULL, NULL,
&si, &pi))
+ {
+ CloseHandle(pi.hThread);
+ CloseHandle(pi.hProcess);
+ }
}
}
}
@@ -117,6 +140,7 @@
if (lpnmitem->iItem > -1)
{
LoadString(hInst, ListItems_Cmds[lpnmitem->iItem], szTemp,
256);
+ szTemp2[0] = _T('\0');
LoadString(hInst, ListItems_Params[lpnmitem->iItem],
szTemp2, 256);
_tcscat(szTemp, _T(" "));
_tcscat(szTemp, szTemp2);
@@ -129,9 +153,27 @@
lpnmitem = (LPNMITEMACTIVATE) lParam;
if (lpnmitem->iItem > -1)
{
- LoadString(hInst, ListItems_Cmds[lpnmitem->iItem], szTemp,
256);
+ if (SHGetSpecialFolderPath(NULL, szTemp,
ListItems_Locations[ListView_GetSelectionMark(hToolsListCtrl)], FALSE))
+ Ptr = PathAddBackslash(szTemp);
+
+ if (!Ptr)
+ Ptr = szTemp;
+
+ szTemp2[0] = _T('\0');
+ LoadString(hInst, ListItems_Cmds[lpnmitem->iItem], Ptr,
256);
LoadString(hInst, ListItems_Params[lpnmitem->iItem],
szTemp2, 256);
- ShellExecute(0, _T("open"), szTemp, szTemp2,
_T(""), SW_NORMAL);
+ if (_tcslen(szTemp2))
+ {
+ _tcscat(szTemp, _T(" "));
+ _tcscat(Ptr, szTemp2);
+ }
+ ZeroMemory(&si, sizeof(STARTUPINFO));
+ si.cb = sizeof(STARTUPINFO);
+ if (CreateProcess(NULL, szTemp, NULL, NULL, FALSE, 0, NULL,
NULL, &si, &pi))
+ {
+ CloseHandle(pi.hThread);
+ CloseHandle(pi.hProcess);
+ }
}
break;
}