fix indentation

svn path=/trunk/; revision=23769
This commit is contained in:
Christoph von Wittich 2006-08-29 13:01:47 +00:00
parent 4b05210f15
commit 3a3cd44034
7 changed files with 214 additions and 200 deletions

View file

@ -21,9 +21,8 @@ FreeLdrPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
switch (message) {
case WM_INITDIALOG:
hFreeLdrDialog = hDlg;
SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
return TRUE;
}
return 0;
SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
return TRUE;
}
return 0;
}

View file

@ -21,9 +21,8 @@ GeneralPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
switch (message) {
case WM_INITDIALOG:
hGeneralDialog = hDlg;
SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
return TRUE;
}
return 0;
SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
return TRUE;
}
return 0;
}

View file

@ -17,10 +17,10 @@ void MsConfig_OnTabWndSelChange(void);
BOOL OnCreate(HWND hWnd)
{
TCHAR szTemp[256];
TCITEM item;
TCHAR szTemp[256];
TCITEM item;
hTabWnd = GetDlgItem(hWnd, IDC_TAB);
hTabWnd = GetDlgItem(hWnd, IDC_TAB);
hGeneralPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_GENERAL_PAGE), hWnd, (DLGPROC) GeneralPageWndProc);
hSystemPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SYSTEM_PAGE), hWnd, (DLGPROC) SystemPageWndProc);
hFreeLdrPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_FREELDR_PAGE), hWnd, (DLGPROC) FreeLdrPageWndProc);
@ -31,38 +31,38 @@ BOOL OnCreate(HWND hWnd)
LoadString(hInst, IDS_MSCONFIG, szTemp, 256);
SetWindowText(hWnd, szTemp);
// Insert Tab Pages
LoadString(hInst, IDS_TAB_GENERAL, szTemp, 256);
// Insert Tab Pages
LoadString(hInst, IDS_TAB_GENERAL, szTemp, 256);
memset(&item, 0, sizeof(TCITEM));
item.mask = TCIF_TEXT;
item.pszText = szTemp;
(void)TabCtrl_InsertItem(hTabWnd, 0, &item);
LoadString(hInst, IDS_TAB_SYSTEM, szTemp, 256);
LoadString(hInst, IDS_TAB_SYSTEM, szTemp, 256);
memset(&item, 0, sizeof(TCITEM));
item.mask = TCIF_TEXT;
item.pszText = szTemp;
(void)TabCtrl_InsertItem(hTabWnd, 1, &item);
LoadString(hInst, IDS_TAB_FREELDR, szTemp, 256);
LoadString(hInst, IDS_TAB_FREELDR, szTemp, 256);
memset(&item, 0, sizeof(TCITEM));
item.mask = TCIF_TEXT;
item.pszText = szTemp;
(void)TabCtrl_InsertItem(hTabWnd, 2, &item);
LoadString(hInst, IDS_TAB_SERVICES, szTemp, 256);
LoadString(hInst, IDS_TAB_SERVICES, szTemp, 256);
memset(&item, 0, sizeof(TCITEM));
item.mask = TCIF_TEXT;
item.pszText = szTemp;
(void)TabCtrl_InsertItem(hTabWnd, 3, &item);
LoadString(hInst, IDS_TAB_STARTUP, szTemp, 256);
LoadString(hInst, IDS_TAB_STARTUP, szTemp, 256);
memset(&item, 0, sizeof(TCITEM));
item.mask = TCIF_TEXT;
item.pszText = szTemp;
(void)TabCtrl_InsertItem(hTabWnd, 4, &item);
LoadString(hInst, IDS_TAB_TOOLS, szTemp, 256);
LoadString(hInst, IDS_TAB_TOOLS, szTemp, 256);
memset(&item, 0, sizeof(TCITEM));
item.mask = TCIF_TEXT;
item.pszText = szTemp;
@ -70,7 +70,7 @@ BOOL OnCreate(HWND hWnd)
MsConfig_OnTabWndSelChange();
return TRUE;
return TRUE;
}
@ -80,58 +80,58 @@ void MsConfig_OnTabWndSelChange(void)
case 0: //General
ShowWindow(hGeneralPage, SW_SHOW);
ShowWindow(hSystemPage, SW_HIDE);
ShowWindow(hFreeLdrPage, SW_HIDE);
ShowWindow(hServicesPage, SW_HIDE);
ShowWindow(hStartupPage, SW_HIDE);
ShowWindow(hFreeLdrPage, SW_HIDE);
ShowWindow(hServicesPage, SW_HIDE);
ShowWindow(hStartupPage, SW_HIDE);
ShowWindow(hToolsPage, SW_HIDE);
BringWindowToTop(hGeneralPage);
break;
break;
case 1: //SYSTEM.INI
ShowWindow(hGeneralPage, SW_HIDE);
ShowWindow(hSystemPage, SW_SHOW);
ShowWindow(hToolsPage, SW_HIDE);
ShowWindow(hStartupPage, SW_HIDE);
ShowWindow(hFreeLdrPage, SW_HIDE);
ShowWindow(hServicesPage, SW_HIDE);
ShowWindow(hStartupPage, SW_HIDE);
ShowWindow(hFreeLdrPage, SW_HIDE);
ShowWindow(hServicesPage, SW_HIDE);
BringWindowToTop(hSystemPage);
break;
case 2: //Freeldr
ShowWindow(hGeneralPage, SW_HIDE);
ShowWindow(hSystemPage, SW_HIDE);
ShowWindow(hFreeLdrPage, SW_SHOW);
ShowWindow(hServicesPage, SW_HIDE);
ShowWindow(hStartupPage, SW_HIDE);
ShowWindow(hFreeLdrPage, SW_SHOW);
ShowWindow(hServicesPage, SW_HIDE);
ShowWindow(hStartupPage, SW_HIDE);
ShowWindow(hToolsPage, SW_HIDE);
BringWindowToTop(hFreeLdrPage);
break;
break;
case 3: //Services
ShowWindow(hGeneralPage, SW_HIDE);
ShowWindow(hSystemPage, SW_HIDE);
ShowWindow(hFreeLdrPage, SW_HIDE);
ShowWindow(hServicesPage, SW_SHOW);
ShowWindow(hStartupPage, SW_HIDE);
ShowWindow(hFreeLdrPage, SW_HIDE);
ShowWindow(hServicesPage, SW_SHOW);
ShowWindow(hStartupPage, SW_HIDE);
ShowWindow(hToolsPage, SW_HIDE);
BringWindowToTop(hServicesPage);
break;
break;
case 4: //startup
ShowWindow(hGeneralPage, SW_HIDE);
ShowWindow(hSystemPage, SW_HIDE);
ShowWindow(hFreeLdrPage, SW_HIDE);
ShowWindow(hServicesPage, SW_HIDE);
ShowWindow(hStartupPage, SW_SHOW);
ShowWindow(hFreeLdrPage, SW_HIDE);
ShowWindow(hServicesPage, SW_HIDE);
ShowWindow(hStartupPage, SW_SHOW);
ShowWindow(hToolsPage, SW_HIDE);
BringWindowToTop(hStartupPage);
break;
case 5: //Tools
break;
case 5: //Tools
ShowWindow(hGeneralPage, SW_HIDE);
ShowWindow(hSystemPage, SW_HIDE);
ShowWindow(hFreeLdrPage, SW_HIDE);
ShowWindow(hServicesPage, SW_HIDE);
ShowWindow(hStartupPage, SW_HIDE);
ShowWindow(hFreeLdrPage, SW_HIDE);
ShowWindow(hServicesPage, SW_HIDE);
ShowWindow(hStartupPage, SW_HIDE);
ShowWindow(hToolsPage, SW_SHOW);
BringWindowToTop(hToolsPage);
break;
}
break;
}
}
@ -142,43 +142,44 @@ MsConfigWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
int idctrl;
LPNMHDR pnmh;
switch (message) {
case WM_INITDIALOG:
hMainWnd = hDlg;
return OnCreate(hDlg);
switch (message)
{
case WM_INITDIALOG:
hMainWnd = hDlg;
return OnCreate(hDlg);
case WM_COMMAND:
case WM_COMMAND:
if (LOWORD(wParam) == IDOK) {
//MsConfig_OnSaveChanges();
}
if (LOWORD(wParam) == IDOK)
{
//MsConfig_OnSaveChanges();
}
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
case WM_NOTIFY:
idctrl = (int)wParam;
pnmh = (LPNMHDR)lParam;
if ((pnmh->hwndFrom == hTabWnd) &&
(pnmh->idFrom == IDC_TAB) &&
(pnmh->code == TCN_SELCHANGE))
{
MsConfig_OnTabWndSelChange();
}
break;
case WM_DESTROY:
DestroyWindow(hToolsPage);
DestroyWindow(hGeneralPage);
DestroyWindow(hServicesPage);
DestroyWindow(hStartupPage);
DestroyWindow(hFreeLdrPage);
DestroyWindow(hSystemPage);
return DefWindowProc(hDlg, message, wParam, lParam);
case WM_NOTIFY:
idctrl = (int)wParam;
pnmh = (LPNMHDR)lParam;
if ((pnmh->hwndFrom == hTabWnd) &&
(pnmh->idFrom == IDC_TAB) &&
(pnmh->code == TCN_SELCHANGE))
{
MsConfig_OnTabWndSelChange();
}
break;
case WM_DESTROY:
DestroyWindow(hToolsPage);
DestroyWindow(hGeneralPage);
DestroyWindow(hServicesPage);
DestroyWindow(hStartupPage);
DestroyWindow(hFreeLdrPage);
DestroyWindow(hSystemPage);
return DefWindowProc(hDlg, message, wParam, lParam);
}
return 0;

View file

@ -18,9 +18,9 @@ void GetServices ( void );
INT_PTR CALLBACK
ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
LV_COLUMN column;
TCHAR szTemp[256];
DWORD dwStyle;
LV_COLUMN column;
TCHAR szTemp[256];
DWORD dwStyle;
UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(wParam);
@ -35,7 +35,7 @@ ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
dwStyle = dwStyle | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES;
SendMessage(hServicesListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);
SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
// Initialize the application page's controls
column.mask = LVCF_TEXT | LVCF_WIDTH;
@ -64,10 +64,10 @@ ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
(void)ListView_InsertColumn(hServicesListCtrl, 3, &column);
GetServices();
return TRUE;
}
return TRUE;
}
return 0;
return 0;
}
void
@ -106,7 +106,7 @@ GetServices ( void )
/* reserve memory for service info array */
pServiceStatus = (ENUM_SERVICE_STATUS_PROCESS *) HeapAlloc(GetProcessHeap(), 0, BytesNeeded);
if (!pServiceStatus)
return;
return;
/* fill array with service info */
if (EnumServicesStatusEx(ScHandle, SC_ENUM_PROCESS_INFO, SERVICE_WIN32, SERVICE_STATE_ALL, (LPBYTE)pServiceStatus, BytesNeeded, &BytesNeeded, &NumServices, &ResumeHandle, 0) == 0)
@ -146,7 +146,7 @@ GetServices ( void )
{
pServiceFailureActions = (LPSERVICE_FAILURE_ACTIONS) HeapAlloc(GetProcessHeap(), 0, BytesNeeded);
if (pServiceFailureActions == NULL)
return;
return;
if (!QueryServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS, (LPBYTE)pServiceFailureActions, BytesNeeded, &BytesNeeded))
{
@ -170,11 +170,11 @@ GetServices ( void )
}
}
if (pServiceFailureActions != NULL)
{
HeapFree(GetProcessHeap(), 0, pServiceFailureActions);
pServiceFailureActions = NULL;
}
if (pServiceFailureActions != NULL)
{
HeapFree(GetProcessHeap(), 0, pServiceFailureActions);
pServiceFailureActions = NULL;
}
/* get vendor of service binary */
BytesNeeded = 0;
@ -184,7 +184,7 @@ GetServices ( void )
{
pServiceConfig = (LPQUERY_SERVICE_CONFIG) HeapAlloc(GetProcessHeap(), 0, BytesNeeded);
if (pServiceConfig == NULL)
return;
return;
if (!QueryServiceConfig(hService, pServiceConfig, BytesNeeded, &BytesNeeded))
{
@ -208,20 +208,21 @@ GetServices ( void )
_tcscpy(FileName, pServiceConfig->lpBinaryPathName);
}
HeapFree(GetProcessHeap(), 0, pServiceConfig);
pServiceConfig = NULL;
HeapFree(GetProcessHeap(), 0, pServiceConfig);
pServiceConfig = NULL;
dwLen = GetFileVersionInfoSize(FileName, &dwHandle);
dwLen = GetFileVersionInfoSize(FileName, &dwHandle);
if (dwLen)
{
lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen);
if (lpData == NULL)
return;
return;
if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData)) {
HeapFree(GetProcessHeap(), 0, lpData);
return;
}
if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData))
{
HeapFree(GetProcessHeap(), 0, lpData);
return;
}
if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"), &pvData, (PUINT) &BufLen))
{
@ -230,12 +231,13 @@ GetServices ( void )
wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"), wCodePage, wLangID);
}
if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen)) {
if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen))
{
item.pszText = lpBuffer;
item.iSubItem = 2;
SendMessage(hServicesListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
}
HeapFree(GetProcessHeap(), 0, lpData);
HeapFree(GetProcessHeap(), 0, lpData);
}
else
{
@ -259,5 +261,4 @@ GetServices ( void )
CloseServiceHandle(ScHandle);
}
}

View file

@ -60,8 +60,8 @@ StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
GetAutostartEntriesFromRegistry(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"));
GetAutostartEntriesFromRegistry(HKEY_CURRENT_USER, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"));
GetDisabledAutostartEntriesFromRegistry (_T("SOFTWARE\\Microsoft\\Shared Tools\\MSConfig\\startupreg"));
GetDisabledAutostartEntriesFromRegistry (_T("SOFTWARE\\Microsoft\\Shared Tools\\MSConfig\\startupfolder"));
GetDisabledAutostartEntriesFromRegistry (_T("SOFTWARE\\Microsoft\\Shared Tools\\MSConfig\\startupreg"));
GetDisabledAutostartEntriesFromRegistry (_T("SOFTWARE\\Microsoft\\Shared Tools\\MSConfig\\startupfolder"));
//FIXME: What about HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit
//FIXME: Common Startup (startmenu)
@ -181,7 +181,7 @@ GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName )
item.iItem = ListView_GetItemCount(hStartupListCtrl);
item.lParam = 0;
(void)ListView_InsertItem(hStartupListCtrl, &item);
ListView_SetCheckState(hStartupListCtrl, item.iItem, TRUE);
ListView_SetCheckState(hStartupListCtrl, item.iItem, TRUE);
if (dwType == REG_SZ)
{

View file

@ -17,11 +17,13 @@ SystemPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(wParam);
switch (message) {
case WM_INITDIALOG:
hSystemDialog = hDlg;
SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
return TRUE;
}
case WM_INITDIALOG:
{
hSystemDialog = hDlg;
SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
return TRUE;
}
}
return 0;
return 0;
}

View file

@ -20,11 +20,11 @@ DWORD ListItems_Cmds[20];
DWORD ListItems_Params[20];
void AddItem ( DWORD name_id, DWORD descr_id, DWORD cmd_id , DWORD param_id ) {
TCHAR szTemp[256];
TCHAR szTemp[256];
LV_ITEM item;
LoadString(hInst, name_id, szTemp, 256);
memset(&item, 0, sizeof(LV_ITEM));
LoadString(hInst, name_id, szTemp, 256);
memset(&item, 0, sizeof(LV_ITEM));
item.mask = LVIF_TEXT;
item.iImage = 0;
item.pszText = szTemp;
@ -32,102 +32,114 @@ void AddItem ( DWORD name_id, DWORD descr_id, DWORD cmd_id , DWORD param_id ) {
item.lParam = 0;
(void)ListView_InsertItem(hToolsListCtrl, &item);
ListItems_Cmds[item.iItem] = cmd_id;
ListItems_Params[item.iItem] = param_id;
ListItems_Cmds[item.iItem] = cmd_id;
ListItems_Params[item.iItem] = param_id;
LoadString(hInst, descr_id, szTemp, 256);
item.pszText = szTemp;
item.iSubItem = 1;
SendMessage(hToolsListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
LoadString(hInst, descr_id, szTemp, 256);
item.pszText = szTemp;
item.iSubItem = 1;
SendMessage(hToolsListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
}
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);
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);
}
INT_PTR CALLBACK
ToolsPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
LV_COLUMN column;
TCHAR szTemp[256];
TCHAR szTemp2[256];
LPNMITEMACTIVATE lpnmitem;
LPNMHDR nmh;
DWORD dwStyle;
LV_COLUMN column;
TCHAR szTemp[256];
TCHAR szTemp2[256];
LPNMITEMACTIVATE lpnmitem;
LPNMHDR nmh;
DWORD dwStyle;
switch (message) {
case WM_INITDIALOG:
hToolsListCtrl = GetDlgItem(hDlg, IDC_TOOLS_LIST);
hToolsDialog = hDlg;
dwStyle = (DWORD) SendMessage(hToolsListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
dwStyle = dwStyle | LVS_EX_FULLROWSELECT;
SendMessage(hToolsListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);
SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
// Initialize the application page's controls
column.mask = LVCF_TEXT | LVCF_WIDTH;
LoadString(hInst, IDS_TOOLS_COLUMN_NAME, szTemp, 256);
column.pszText = szTemp;
column.cx = 150;
(void)ListView_InsertColumn(hToolsListCtrl, 0, &column);
column.mask = LVCF_TEXT | LVCF_WIDTH;
LoadString(hInst, IDS_TOOLS_COLUMN_DESCR, szTemp, 256);
column.pszText = szTemp;
column.cx = 500;
(void)ListView_InsertColumn(hToolsListCtrl, 1, &column);
FillListView();
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam))
switch (message)
{
case WM_INITDIALOG:
{
case IDC_BTN_RUN:
if (ListView_GetSelectionMark(hToolsListCtrl) != -1) {
LoadString(hInst, ListItems_Cmds[ListView_GetSelectionMark(hToolsListCtrl)], szTemp, 256);
LoadString(hInst, ListItems_Params[ListView_GetSelectionMark(hToolsListCtrl)], szTemp2, 256);
ShellExecute(0, _T("open"), szTemp, szTemp2, _T(""), SW_NORMAL);
}
}
break;
hToolsListCtrl = GetDlgItem(hDlg, IDC_TOOLS_LIST);
hToolsDialog = hDlg;
case WM_NOTIFY:
nmh = (LPNMHDR) lParam;
if (nmh->hwndFrom == hToolsListCtrl)
{
switch (nmh->code)
{
case NM_CLICK:
lpnmitem = (LPNMITEMACTIVATE) lParam;
if (lpnmitem->iItem > -1) {
LoadString(hInst, ListItems_Cmds[lpnmitem->iItem], szTemp, 256);
LoadString(hInst, ListItems_Params[lpnmitem->iItem], szTemp2, 256);
_tcscat(szTemp, _T(" "));
_tcscat(szTemp, szTemp2);
SendDlgItemMessage(hToolsDialog, IDC_TOOLS_CMDLINE, WM_SETTEXT, 0, (LPARAM) szTemp);
}
break;
case NM_DBLCLK:
lpnmitem = (LPNMITEMACTIVATE) lParam;
if (lpnmitem->iItem > -1) {
LoadString(hInst, ListItems_Cmds[lpnmitem->iItem], szTemp, 256);
LoadString(hInst, ListItems_Params[lpnmitem->iItem], szTemp2, 256);
ShellExecute(0, _T("open"), szTemp, szTemp2, _T(""), SW_NORMAL);
}
break;
}
}
break;
}
dwStyle = (DWORD) SendMessage(hToolsListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
dwStyle = dwStyle | LVS_EX_FULLROWSELECT;
SendMessage(hToolsListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);
return 0;
SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
// Initialize the application page's controls
column.mask = LVCF_TEXT | LVCF_WIDTH;
LoadString(hInst, IDS_TOOLS_COLUMN_NAME, szTemp, 256);
column.pszText = szTemp;
column.cx = 150;
(void)ListView_InsertColumn(hToolsListCtrl, 0, &column);
column.mask = LVCF_TEXT | LVCF_WIDTH;
LoadString(hInst, IDS_TOOLS_COLUMN_DESCR, szTemp, 256);
column.pszText = szTemp;
column.cx = 500;
(void)ListView_InsertColumn(hToolsListCtrl, 1, &column);
FillListView();
return TRUE;
}
case WM_COMMAND:
{
switch (LOWORD(wParam))
{
case IDC_BTN_RUN:
{
if (ListView_GetSelectionMark(hToolsListCtrl) != -1)
{
LoadString(hInst, ListItems_Cmds[ListView_GetSelectionMark(hToolsListCtrl)], szTemp, 256);
LoadString(hInst, ListItems_Params[ListView_GetSelectionMark(hToolsListCtrl)], szTemp2, 256);
ShellExecute(0, _T("open"), szTemp, szTemp2, _T(""), SW_NORMAL);
}
}
}
break;
}
case WM_NOTIFY:
{
nmh = (LPNMHDR) lParam;
if (nmh->hwndFrom == hToolsListCtrl)
{
switch (nmh->code)
{
case NM_CLICK:
{
lpnmitem = (LPNMITEMACTIVATE) lParam;
if (lpnmitem->iItem > -1)
{
LoadString(hInst, ListItems_Cmds[lpnmitem->iItem], szTemp, 256);
LoadString(hInst, ListItems_Params[lpnmitem->iItem], szTemp2, 256);
_tcscat(szTemp, _T(" "));
_tcscat(szTemp, szTemp2);
SendDlgItemMessage(hToolsDialog, IDC_TOOLS_CMDLINE, WM_SETTEXT, 0, (LPARAM) szTemp);
}
break;
}
case NM_DBLCLK:
{
lpnmitem = (LPNMITEMACTIVATE) lParam;
if (lpnmitem->iItem > -1)
{
LoadString(hInst, ListItems_Cmds[lpnmitem->iItem], szTemp, 256);
LoadString(hInst, ListItems_Params[lpnmitem->iItem], szTemp2, 256);
ShellExecute(0, _T("open"), szTemp, szTemp2, _T(""), SW_NORMAL);
}
break;
}
}
}
}
break;
}
return 0;
}