Author: fireball
Date: Fri Oct 12 14:12:52 2007
New Revision: 29532
URL:
http://svn.reactos.org/svn/reactos?rev=29532&view=rev
Log:
Dmitry Chapyshev <lentind(a)yandex.ru>
- Make the "Information" tab work.
- Improve overall applet's behavior (more correct and more "smart").
- Fixed a bug when switching between tabs.
- Small improvements in the UI, other small fixes.
- If no apps or no updates are installed, then the controls in the respective tabs will be
grayed out, and a respective information message will be shown instead of the empty list.
Modified:
trunk/reactos/dll/cpl/appwiz/appwiz.h
trunk/reactos/dll/cpl/appwiz/lang/en-US.rc
trunk/reactos/dll/cpl/appwiz/remove.c
trunk/reactos/dll/cpl/appwiz/resource.h
trunk/reactos/dll/cpl/appwiz/updates.c
Modified: trunk/reactos/dll/cpl/appwiz/appwiz.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/appwiz.h?re…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/appwiz.h (original)
+++ trunk/reactos/dll/cpl/appwiz/appwiz.h Fri Oct 12 14:12:52 2007
@@ -44,32 +44,35 @@
INT_PTR CALLBACK
RemovePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK
-InfoPropDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
-
VOID
AddListColumn(HWND hList, LPTSTR Caption);
VOID
-FillSoftwareList(HWND hwndDlg, BOOL bShowUpdates);
+FillSoftwareList(HWND hwndDlg, BOOL bShowUpdates, UINT Control);
VOID
-AddItemsToViewControl(HWND hwndDlg);
+AddItemsToViewControl(HWND hwndDlg, UINT Control);
VOID
-FindItems(HWND hwndDlg);
+FindItems(HWND hwndDlg, UINT ListControl, UINT EditControl, UINT RemBtn, UINT InfoBtn);
VOID
-CallUninstall(HWND hwndDlg, UINT Control, BOOL isUpdate);
+CallUninstall(HWND hwndDlg, UINT Control, UINT RemBtn, UINT InfoBtn, BOOL isUpdate);
VOID
-GetCurrentView(HWND hwndDlg);
+GetCurrentView(HWND hwndDlg, UINT ViewControl, UINT ListControl);
VOID
-CallInformation(HWND hwndDlg);
+CallInformation(HWND hwndDlg, HWND infDlg, UINT Control);
VOID
-ShowPopupMenu(HWND hwndDlg, UINT ResMenu, INT xPos, INT yPos);
+ShowPopupMenu(HWND hwndDlg, UINT ResMenu, INT xPos, INT yPos, UINT Control);
+
+BOOL
+IsItemSelected(HWND hwndDlg, UINT Control);
+
+VOID
+ButtonStatus(HWND hwndDlg, BOOL Status, UINT RemBtn, UINT InfoBtn);
/* add.c */
INT_PTR CALLBACK
Modified: trunk/reactos/dll/cpl/appwiz/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/lang/en-US.…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/lang/en-US.rc (original)
+++ trunk/reactos/dll/cpl/appwiz/lang/en-US.rc Fri Oct 12 14:12:52 2007
@@ -24,10 +24,10 @@
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
ICON IDI_CPLSYSTEM,-1,PROPSHEETPADDING,6,16,16
- LTEXT "The following Software can be automatically removed. To remove a program or
to modify its installed components, select it from the list and click
Modify/Remove.",-1,36,7,PROPSHEETWIDTH-48,32
- LTEXT "Find:",-1,PROPSHEETPADDING,33,50,14
+ LTEXT "The following Software can be automatically removed. To remove a program or
to modify its installed components, select it from the list and click
Modify/Remove.",-1,36,7,PROPSHEETWIDTH-48,22
+ LTEXT "Find:",-1,PROPSHEETPADDING,33,30,8
EDITTEXT IDC_FIND_EDIT, PROPSHEETPADDING+30, 30, 180, 14, WS_VISIBLE | WS_TABSTOP
- LTEXT "View:",-1,250,33,40,8
+ LTEXT "View:",-1,250,33,30,8
COMBOBOX IDC_VIEW_COMBO, 280, 30, 94, 80, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE |
WS_TABSTOP | WS_VSCROLL
CONTROL "", IDC_SOFTWARELIST, "SysListView32", LVS_REPORT |
LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL, PROPSHEETPADDING, 50,
PROPSHEETWIDTH-12, 155, WS_EX_CLIENTEDGE
PUSHBUTTON "Modify/&Remove", IDC_ADDREMOVE, PROPSHEETPADDING, 210, 80, 14,
WS_DISABLED
@@ -40,14 +40,14 @@
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
ICON IDI_UPDATES,-1,PROPSHEETPADDING,6,16,16
- LTEXT "The following Updates can be automatically removed. To remove a update,
select it from the list and click Remove.",-1,36,7,PROPSHEETWIDTH-48,32
- LTEXT "Find:",-1,PROPSHEETPADDING,33,50,14
- EDITTEXT IDC_FIND_EDIT, PROPSHEETPADDING+30, 30, 180, 14, WS_VISIBLE | WS_TABSTOP
- LTEXT "View:",-1,250,33,40,8
- COMBOBOX IDC_VIEW_COMBO, 280, 30, 94, 80, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE |
WS_TABSTOP | WS_VSCROLL
- CONTROL "", IDC_SOFTWARELIST, "SysListView32", LVS_REPORT |
LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL, PROPSHEETPADDING, 50,
PROPSHEETWIDTH-12, 155, WS_EX_CLIENTEDGE
- PUSHBUTTON "&Remove", IDC_ADDREMOVE, PROPSHEETPADDING, 210, 80, 14,
WS_DISABLED
- PUSHBUTTON "&Information", IDC_INFO_BUTTON, PROPSHEETPADDING+85, 210, 80,
14, WS_DISABLED
+ LTEXT "The following Updates can be automatically removed. To remove a update,
select it from the list and click Remove.",-1,36,7,PROPSHEETWIDTH-48,22
+ LTEXT "Find:",-1,PROPSHEETPADDING,33,30,8
+ EDITTEXT IDC_UPD_FIND_EDIT, PROPSHEETPADDING+30, 30, 180, 14, WS_VISIBLE | WS_TABSTOP
+ LTEXT "View:",-1,250,33,30,8
+ COMBOBOX IDC_UPD_VIEW_COMBO, 280, 30, 94, 80, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE |
WS_TABSTOP | WS_VSCROLL
+ CONTROL "", IDC_UPDATESLIST, "SysListView32", LVS_REPORT |
LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL, PROPSHEETPADDING, 50,
PROPSHEETWIDTH-12, 155, WS_EX_CLIENTEDGE
+ PUSHBUTTON "&Remove", IDC_UPD_REMOVE, PROPSHEETPADDING, 210, 80, 14,
WS_DISABLED
+ PUSHBUTTON "&Information", IDC_UPD_INFO_BUTTON, PROPSHEETPADDING+85, 210,
80, 14, WS_DISABLED
END
IDD_PROPPAGEADD DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
@@ -75,7 +75,7 @@
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
ICON IDI_REACTOS,-1,PROPSHEETPADDING,6,16,16
- LTEXT "",-1,36,7,PROPSHEETWIDTH-48,32
+ LTEXT "",-1,36,7,PROPSHEETWIDTH-48,22
END
IDD_FIRSTPAGE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
@@ -119,40 +119,39 @@
LTEXT "Click Finish to create the shortcut.", -1, 120, 50, 150, 10
END
-IDD_INFORMATION DIALOG 5, 100, 269, 200
+IDD_INFORMATION DIALOG 5, 100, 269, 218
STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP |
WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
CAPTION "Information"
FONT 8, "MS Shell Dlg"
BEGIN
- LTEXT "DisplayName", IDS_INFO_DISPNAME, PROPSHEETPADDING, 8, 160, 24
- LTEXT "Registered Owner:", -1, PROPSHEETPADDING, 25, 160, 17
- LTEXT "", IDS_INFO_REGOWNER, PROPSHEETPADDING+75, 25, 160, 17
- LTEXT "Product ID:", -1, PROPSHEETPADDING, 40, 160, 17
- LTEXT "", IDS_INFO_PRODUCTID, PROPSHEETPADDING+75, 40, 160, 17
- LTEXT "Publisher:", -1, PROPSHEETPADDING, 55, 160, 17
- LTEXT "", IDS_INFO_PUBLISHER, PROPSHEETPADDING+75, 55, 160, 17
- LTEXT "Version:", -1, PROPSHEETPADDING, 70, 160, 17
- LTEXT "", IDS_INFO_VERSION, PROPSHEETPADDING+75, 70, 160, 17
- LTEXT "Contact:", -1, PROPSHEETPADDING, 85, 160, 17
- LTEXT "", IDS_INFO_CONTACT, PROPSHEETPADDING+75, 85, 160, 17
- LTEXT "Support Information:", -1, PROPSHEETPADDING, 100, 160, 17
- LTEXT "", IDS_INFO_SUPPORTINFO, PROPSHEETPADDING+75, 100, 160, 17
- LTEXT "Support Telephone:", -1, PROPSHEETPADDING, 115, 160, 17
- LTEXT "", IDS_INFO_SUPPORTPHONE, PROPSHEETPADDING+75, 115, 160, 17
- LTEXT "Product Updates:", -1, PROPSHEETPADDING, 130, 160, 17
- LTEXT "", IDS_INFO_PRODUCT_UPDATES, PROPSHEETPADDING+75, 130, 160, 17
- LTEXT "Readme:", -1, PROPSHEETPADDING, 145, 160, 17
- LTEXT "", IDS_INFO_README, PROPSHEETPADDING+75, 145, 160, 17
- LTEXT "Comments:", -1, PROPSHEETPADDING, 160, 160, 17
- LTEXT "", IDS_INFO_COMMENTS, PROPSHEETPADDING+75, 160, 160, 17
- PUSHBUTTON "&Close", IDCANCEL, 212, 180, 50, 14
+ EDITTEXT IDS_INFO_DISPNAME, PROPSHEETPADDING, 6, 258, 15, ES_READONLY | WS_CHILD |
WS_VISIBLE | WS_GROUP
+ LTEXT "Registered Owner:", -1, PROPSHEETPADDING, 27, 97, 8
+ EDITTEXT IDS_INFO_REGOWNER, PROPSHEETPADDING+97, 25, 160, 14, ES_READONLY | WS_CHILD |
WS_VISIBLE | WS_GROUP
+ LTEXT "Product ID:", -1, PROPSHEETPADDING, 44, 97, 8
+ EDITTEXT IDS_INFO_PRODUCTID, PROPSHEETPADDING+97, 42, 160, 14, ES_READONLY | WS_CHILD |
WS_VISIBLE | WS_GROUP
+ LTEXT "Publisher:", -1, PROPSHEETPADDING, 61, 97, 8
+ EDITTEXT IDS_INFO_PUBLISHER, PROPSHEETPADDING+97, 59, 160, 14, ES_READONLY | WS_CHILD |
WS_VISIBLE | WS_GROUP
+ LTEXT "Version:", -1, PROPSHEETPADDING, 78, 97, 8
+ EDITTEXT IDS_INFO_VERSION, PROPSHEETPADDING+97, 76, 160, 14, ES_READONLY | WS_CHILD |
WS_VISIBLE | WS_GROUP
+ LTEXT "Contact:", -1, PROPSHEETPADDING, 95, 97, 8
+ EDITTEXT IDS_INFO_CONTACT, PROPSHEETPADDING+97, 93, 160, 14, ES_READONLY | WS_CHILD |
WS_VISIBLE | WS_GROUP
+ LTEXT "Support Information:", -1, PROPSHEETPADDING, 112, 97, 8
+ EDITTEXT IDS_INFO_SUPPORTINFO, PROPSHEETPADDING+97, 110, 160, 14, ES_READONLY | WS_CHILD
| WS_VISIBLE | WS_GROUP
+ LTEXT "Support Telephone:", -1, PROPSHEETPADDING, 129, 97, 8
+ EDITTEXT IDS_INFO_SUPPORTPHONE, PROPSHEETPADDING+97, 127, 160, 14, ES_READONLY |
WS_CHILD | WS_VISIBLE | WS_GROUP
+ LTEXT "Product Updates:", -1, PROPSHEETPADDING, 146, 97, 8
+ EDITTEXT IDS_INFO_PRODUCT_UPDATES, PROPSHEETPADDING+97, 144, 160, 14, ES_READONLY |
WS_CHILD | WS_VISIBLE | WS_GROUP
+ LTEXT "Readme:", -1, PROPSHEETPADDING, 163, 97, 8
+ EDITTEXT IDS_INFO_README, PROPSHEETPADDING+97, 161, 160, 14, ES_READONLY | WS_CHILD |
WS_VISIBLE | WS_GROUP
+ LTEXT "Comments:", -1, PROPSHEETPADDING, 180, 97, 8
+ EDITTEXT IDS_INFO_COMMENTS, PROPSHEETPADDING+97, 178, 160, 14, ES_READONLY | WS_CHILD |
WS_VISIBLE | WS_GROUP
+ PUSHBUTTON "&Close", IDCANCEL, 212, 198, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Add/Remove Programs"
IDS_CPLSYSTEMDESCRIPTION "Sets up programs and creates shortcuts."
- IDS_NOITEM_SELECTED "No item selected!"
IDS_ERROR "Error"
IDS_UNABLEREAD_UNINSTSTR "Unable to read UninstallString. This entry is invalid or
has been created by an MSI installer."
IDS_UNABLEOPEN_UNINSTKEY "Unable to open Uninstall Key"
@@ -163,4 +162,8 @@
IDS_DETAILS "Details"
IDS_CREATE_SHORTCUT "Create Shortcut"
IDS_ERROR_NOT_FOUND "The file %s was not found."
+ IDS_UNABLEREAD_INFORMATION "Unable to open Information Keys"
+ IDS_NO_INFORMATION "No information"
+ IDS_NONE_APP "There are no installed applications."
+ IDS_NONE_UPD "There are no installed updates."
END
Modified: trunk/reactos/dll/cpl/appwiz/remove.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/remove.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/remove.c (original)
+++ trunk/reactos/dll/cpl/appwiz/remove.c Fri Oct 12 14:12:52 2007
@@ -30,14 +30,77 @@
#include "appwiz.h"
-VOID
-CallInformation(HWND hwndDlg)
-{
-
-}
-
-VOID
-CallUninstall(HWND hwndDlg, UINT Control, BOOL isUpdate)
+HWND InfoDialog;
+
+BOOL
+GetInfoItem(HWND hwndDlg, HKEY hKey, LPCTSTR RegName, UINT Control)
+{
+ DWORD dwSize = 1024;
+ TCHAR pszInfoString[1024];
+
+ if (RegQueryValueEx(hKey,
+ RegName,
+ NULL,
+ NULL,
+ (LPBYTE)pszInfoString,
+ &dwSize) == ERROR_SUCCESS)
+ {
+ SendMessage(GetDlgItem(hwndDlg, Control), WM_SETTEXT, -1, (LPARAM)pszInfoString);
+ return TRUE;
+ }
+ else
+ {
+ dwSize = 1024;
+ LoadString(hApplet, IDS_NO_INFORMATION, pszInfoString, sizeof(pszInfoString) /
sizeof(TCHAR));
+ SendMessage(GetDlgItem(hwndDlg, Control), WM_SETTEXT, -1, (LPARAM)pszInfoString);
+ return FALSE;
+ }
+}
+
+VOID
+CallInformation(HWND hwndDlg, HWND infDlg, UINT Control)
+{
+ INT nIndex;
+ HKEY hKey;
+ TCHAR Buf[256],Title[256];
+
+ nIndex = (INT)SendMessage(GetDlgItem(infDlg, Control),LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ if (nIndex != -1)
+ {
+ LVITEM item;
+
+ ZeroMemory(&item, sizeof(LVITEM));
+ item.mask = LVIF_PARAM;
+ item.iItem = nIndex;
+ (void)ListView_GetItem(GetDlgItem(infDlg,Control),&item);
+ hKey = (HKEY)item.lParam;
+
+ if (!GetInfoItem(hwndDlg, hKey, L"DisplayName", IDS_INFO_DISPNAME))
+ {
+ LoadString(hApplet, IDS_UNABLEREAD_INFORMATION, Buf, sizeof(Buf) / sizeof(TCHAR));
+ LoadString(hApplet, IDS_ERROR, Title, sizeof(Title) / sizeof(TCHAR));
+ MessageBox(hwndDlg,
+ Buf,
+ Title,
+ MB_ICONSTOP);
+ return;
+ }
+
+ (void)GetInfoItem(hwndDlg, hKey, L"RegOwner", IDS_INFO_REGOWNER);
+ (void)GetInfoItem(hwndDlg, hKey, L"ProductID", IDS_INFO_PRODUCTID);
+ (void)GetInfoItem(hwndDlg, hKey, L"Publisher", IDS_INFO_PUBLISHER);
+ (void)GetInfoItem(hwndDlg, hKey, L"DisplayVersion", IDS_INFO_VERSION);
+ (void)GetInfoItem(hwndDlg, hKey, L"Contact", IDS_INFO_CONTACT);
+ (void)GetInfoItem(hwndDlg, hKey, L"HelpLink", IDS_INFO_SUPPORTINFO);
+ (void)GetInfoItem(hwndDlg, hKey, L"HelpTelephone", IDS_INFO_SUPPORTPHONE);
+ (void)GetInfoItem(hwndDlg, hKey, L"URLUpdateInfo",
IDS_INFO_PRODUCT_UPDATES);
+ (void)GetInfoItem(hwndDlg, hKey, L"Readme", IDS_INFO_README);
+ (void)GetInfoItem(hwndDlg, hKey, L"Comments", IDS_INFO_COMMENTS);
+ }
+}
+
+VOID
+CallUninstall(HWND hwndDlg, UINT Control, UINT RemBtn, UINT InfoBtn, BOOL isUpdate)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
@@ -49,23 +112,14 @@
TCHAR Buf[256],Title[256];
nIndex = (INT)SendMessage(GetDlgItem(hwndDlg,
Control),LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- if (nIndex == -1)
- {
- LoadString(hApplet, IDS_NOITEM_SELECTED, Buf, sizeof(Buf) / sizeof(TCHAR));
- LoadString(hApplet, IDS_CPLSYSTEMNAME, Title, sizeof(Title) / sizeof(TCHAR));
- MessageBox(hwndDlg,
- Buf,
- Title,
- MB_ICONINFORMATION);
- }
- else
+ if (nIndex != -1)
{
LVITEM item;
ZeroMemory(&item, sizeof(LVITEM));
item.mask = LVIF_PARAM;
item.iItem = nIndex;
- (void)ListView_GetItem(GetDlgItem(hwndDlg,IDC_SOFTWARELIST),&item);
+ (void)ListView_GetItem(GetDlgItem(hwndDlg,Control),&item);
hKey = (HKEY)item.lParam;
dwType = REG_SZ;
@@ -82,12 +136,13 @@
si.wShowWindow = SW_SHOW;
if
(CreateProcess(NULL,pszUninstallString,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi))
{
+ ButtonStatus(hwndDlg, FALSE, RemBtn, InfoBtn);
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
// Update software list
- (void)ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_SOFTWARELIST));
- FillSoftwareList(hwndDlg, isUpdate);
+ (void)ListView_DeleteAllItems(GetDlgItem(hwndDlg, Control));
+ FillSoftwareList(hwndDlg, isUpdate, Control);
}
}
else
@@ -118,7 +173,7 @@
}
static VOID
-AddItemToList(HWND hwndDlg, LPARAM hSubKey, LPTSTR pszDisplayName, INT ItemIndex)
+AddItemToList(HWND hwndDlg, LPARAM hSubKey, LPTSTR pszDisplayName, INT ItemIndex, UINT
Control)
{
int index;
HIMAGELIST hImgListSmall;
@@ -153,7 +208,7 @@
ImageList_AddIcon(hImgListLarge,hIcon);
DestroyIcon(hIcon);
- hList = GetDlgItem(hwndDlg, IDC_SOFTWARELIST);
+ hList = GetDlgItem(hwndDlg, Control);
ZeroMemory(&listItem, sizeof(LV_ITEM));
listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;
@@ -163,12 +218,35 @@
listItem.iImage = index;
(void)ListView_InsertItem(hList, &listItem);
- (void)ListView_SetImageList(GetDlgItem(hwndDlg,
IDC_SOFTWARELIST),hImgListSmall,LVSIL_SMALL);
- (void)ListView_SetImageList(GetDlgItem(hwndDlg,
IDC_SOFTWARELIST),hImgListLarge,LVSIL_NORMAL);
-}
-
-VOID
-FillSoftwareList(HWND hwndDlg, BOOL bShowUpdates)
+ (void)ListView_SetImageList(hList,hImgListSmall,LVSIL_SMALL);
+ (void)ListView_SetImageList(hList,hImgListLarge,LVSIL_NORMAL);
+}
+
+VOID
+SetNoneAppMsg(HWND hwndDlg, BOOL IsUpdates)
+{
+ TCHAR Buf[256];
+
+ if (IsUpdates)
+ {
+ LoadString(hApplet, IDS_NONE_UPD, Buf, sizeof(Buf) / sizeof(TCHAR));
+ AddItemToList(hwndDlg, -1, (LPTSTR)Buf, 0, IDC_UPDATESLIST);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_UPD_FIND_EDIT),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_UPD_VIEW_COMBO),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATESLIST),FALSE);
+ }
+ else
+ {
+ LoadString(hApplet, IDS_NONE_APP, Buf, sizeof(Buf) / sizeof(TCHAR));
+ AddItemToList(hwndDlg, -1, (LPTSTR)Buf, 0, IDC_SOFTWARELIST);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FIND_EDIT),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_VIEW_COMBO),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),FALSE);
+ }
+}
+
+VOID
+FillSoftwareList(HWND hwndDlg, BOOL bShowUpdates, UINT Control)
{
TCHAR pszName[MAX_PATH];
TCHAR pszDisplayName[MAX_PATH];
@@ -183,6 +261,7 @@
BOOL bIsSystemComponent = FALSE;
INT ItemIndex = 0;
TCHAR Buf[256],Title[256];
+ BOOL IsAdd = FALSE;
if (RegOpenKey(HKEY_LOCAL_MACHINE,
TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"),
@@ -237,11 +316,13 @@
{
if ((!bIsUpdate) && (!bIsSystemComponent) &&
(!bShowUpdates))
{
- AddItemToList(hwndDlg, (LPARAM)hSubKey, (LPTSTR)pszDisplayName, ItemIndex);
+ AddItemToList(hwndDlg, (LPARAM)hSubKey, (LPTSTR)pszDisplayName, ItemIndex,
Control);
+ IsAdd = TRUE;
}
else if (bIsUpdate && bShowUpdates)
{
- AddItemToList(hwndDlg, (LPARAM)hSubKey, (LPTSTR)pszDisplayName, ItemIndex);
+ AddItemToList(hwndDlg, (LPARAM)hSubKey, (LPTSTR)pszDisplayName, ItemIndex,
Control);
+ IsAdd = TRUE;
}
}
}
@@ -251,16 +332,19 @@
}
RegCloseKey(hKey);
-}
-
-VOID
-AddItemsToViewControl(HWND hwndDlg)
+
+ if (!IsAdd) SetNoneAppMsg(hwndDlg, bShowUpdates);
+
+}
+
+VOID
+AddItemsToViewControl(HWND hwndDlg, UINT Control)
{
TCHAR Buf[256];
int Index;
HWND hList;
- hList = GetDlgItem(hwndDlg, IDC_VIEW_COMBO);
+ hList = GetDlgItem(hwndDlg, Control);
// Large Icons
LoadString(hApplet, IDS_LARGEICONS, Buf, sizeof(Buf) / sizeof(TCHAR));
Index = (int)SendMessage(hList,
@@ -300,7 +384,7 @@
}
VOID
-FindItems(HWND hwndDlg)
+FindItems(HWND hwndDlg, UINT ListControl, UINT EditControl, UINT RemBtn, UINT InfoBtn)
{
HWND hList;
HWND hEdit;
@@ -310,8 +394,8 @@
LV_ITEM listItem;
BOOL comp = TRUE;
- hList = GetDlgItem(hwndDlg, IDC_SOFTWARELIST);
- hEdit = GetDlgItem(hwndDlg, IDC_FIND_EDIT);
+ hList = GetDlgItem(hwndDlg, ListControl);
+ hEdit = GetDlgItem(hwndDlg, EditControl);
SendMessage(hEdit, WM_GETTEXT, 128, (LPARAM)szText);
@@ -330,45 +414,41 @@
}
ListView_SetItemState(hList, Index, LVIS_SELECTED | LVIS_FOCUSED, -1);
if (comp)
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),TRUE);
- }
+ ButtonStatus(hwndDlg, TRUE, RemBtn, InfoBtn);
else
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),FALSE);
- }
-}
-
-VOID
-GetCurrentView(HWND hwndDlg)
+ ButtonStatus(hwndDlg, FALSE, RemBtn, InfoBtn);
+}
+
+VOID
+GetCurrentView(HWND hwndDlg, UINT ViewControl, UINT ListControl)
{
int nCurrSel;
- nCurrSel = (int)SendMessage(GetDlgItem(hwndDlg, IDC_VIEW_COMBO),
+ nCurrSel = (int)SendMessage(GetDlgItem(hwndDlg, ViewControl),
CB_GETCURSEL,
(WPARAM)0,
(LPARAM)0);
switch (nCurrSel)
{
case 0:
- SetWindowLong(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),
+ SetWindowLong(GetDlgItem(hwndDlg, ListControl),
GWL_STYLE, LVS_ICON | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL |
WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP);
break;
case 1:
- SetWindowLong(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),
+ SetWindowLong(GetDlgItem(hwndDlg, ListControl),
GWL_STYLE,LVS_LIST | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL |
WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP);
break;
case 2:
- SetWindowLong(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),
+ SetWindowLong(GetDlgItem(hwndDlg, ListControl),
GWL_STYLE,LVS_REPORT | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL |
WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP);
break;
}
}
VOID
-ShowPopupMenu(HWND hwndDlg, UINT ResMenu, INT xPos, INT yPos)
+ShowPopupMenu(HWND hwndDlg, UINT ResMenu, INT xPos, INT yPos, UINT Control)
{
INT nIndex;
- nIndex = (INT)SendMessage(GetDlgItem(hwndDlg,
IDC_SOFTWARELIST),LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ nIndex = (INT)SendMessage(GetDlgItem(hwndDlg,
Control),LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
if ( nIndex != -1)
{
POINT pt;
@@ -377,7 +457,7 @@
GetCursorPos(&pt);
- GetWindowRect(GetDlgItem(hwndDlg, IDC_SOFTWARELIST), &lvRect);
+ GetWindowRect(GetDlgItem(hwndDlg, Control), &lvRect);
if (PtInRect(&lvRect, pt))
{
hMenu = GetSubMenu(LoadMenu(hApplet, MAKEINTRESOURCE(ResMenu)),0);
@@ -392,6 +472,7 @@
}
}
+static
INT_PTR CALLBACK
InfoPropDlgProc(HWND hDlg,
UINT message,
@@ -404,15 +485,12 @@
{
case WM_INITDIALOG:
{
-
+ CallInformation(hDlg, InfoDialog, IDC_SOFTWARELIST);
}
case WM_COMMAND:
{
switch (LOWORD(wParam))
{
- case IDOK:
-
- break;
case IDCANCEL:
EndDialog(hDlg,LOWORD(wParam));
break;
@@ -424,6 +502,22 @@
return FALSE;
}
+BOOL
+IsItemSelected(HWND hwndDlg, UINT Control)
+{
+ INT nIndex;
+ nIndex = (INT)SendMessage(GetDlgItem(hwndDlg,
Control),LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ if (nIndex != -1) return TRUE;
+ return FALSE;
+}
+
+VOID
+ButtonStatus(HWND hwndDlg, BOOL Status, UINT RemBtn, UINT InfoBtn)
+{
+ EnableWindow(GetDlgItem(hwndDlg, RemBtn),Status);
+ EnableWindow(GetDlgItem(hwndDlg, InfoBtn),Status);
+}
+
/* Property page dialog callback */
INT_PTR CALLBACK
RemovePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -434,10 +528,11 @@
switch (uMsg)
{
case WM_INITDIALOG:
- AddItemsToViewControl(hwndDlg);
+ AddItemsToViewControl(hwndDlg, IDC_VIEW_COMBO);
LoadString(hApplet, IDS_APPLIST, Buf, sizeof(Buf) / sizeof(TCHAR));
AddListColumn(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),Buf);
- FillSoftwareList(hwndDlg, FALSE);
+ FillSoftwareList(hwndDlg, FALSE, IDC_SOFTWARELIST);
+ InfoDialog = hwndDlg;
break;
case WM_COMMAND:
@@ -446,25 +541,26 @@
case IDC_FIND_EDIT:
if (HIWORD(wParam) == EN_CHANGE)
{
- FindItems(hwndDlg);
+
FindItems(hwndDlg,IDC_SOFTWARELIST,IDC_FIND_EDIT,IDC_ADDREMOVE,IDC_INFO_BUTTON);
}
break;
case ID_APP_MODIFYREMOVE:
case IDC_ADDREMOVE:
- CallUninstall(hwndDlg, IDC_SOFTWARELIST, FALSE);
+ CallUninstall(hwndDlg, IDC_SOFTWARELIST, IDC_ADDREMOVE,
IDC_INFO_BUTTON, FALSE);
break;
case ID_APP_INFORMATION:
case IDC_INFO_BUTTON:
+ {
+ if (IsItemSelected(hwndDlg, IDC_SOFTWARELIST))
DialogBox(hApplet,
MAKEINTRESOURCE(IDD_INFORMATION),
hwndDlg,
InfoPropDlgProc);
+ }
break;
case IDC_VIEW_COMBO:
if (HIWORD(wParam) == CBN_SELCHANGE)
- {
- GetCurrentView(hwndDlg);
- }
+ GetCurrentView(hwndDlg, IDC_VIEW_COMBO, IDC_SOFTWARELIST);
break;
}
break;
@@ -476,33 +572,18 @@
switch (((LPNMHDR)lParam)->code)
{
case NM_DBLCLK:
- CallUninstall(hwndDlg, IDC_SOFTWARELIST, FALSE);
+ CallUninstall(hwndDlg, IDC_SOFTWARELIST, IDC_ADDREMOVE, IDC_INFO_BUTTON, FALSE);
break;
case NM_CLICK:
{
- INT nIndex;
- nIndex = (INT)SendMessage(GetDlgItem(hwndDlg,
IDC_SOFTWARELIST),LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- if (nIndex == -1)
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_INFO_BUTTON),FALSE);
- }
+ if (!IsItemSelected(hwndDlg, IDC_SOFTWARELIST))
+ ButtonStatus(hwndDlg, FALSE, IDC_ADDREMOVE, IDC_INFO_BUTTON);
else
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),TRUE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_INFO_BUTTON),TRUE);
- }
+ ButtonStatus(hwndDlg, TRUE, IDC_ADDREMOVE, IDC_INFO_BUTTON);
}
break;
}
break;
- }
- }
- break;
- case WM_MENUSELECT:
- {
- switch((UINT)LOWORD(wParam))
- {
}
}
break;
@@ -511,7 +592,8 @@
ShowPopupMenu(hwndDlg,
IDR_POPUP_APP,
GET_X_LPARAM(lParam),
- GET_Y_LPARAM(lParam));
+ GET_Y_LPARAM(lParam),
+ IDC_SOFTWARELIST);
}
break;
}
Modified: trunk/reactos/dll/cpl/appwiz/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/resource.h?…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/resource.h (original)
+++ trunk/reactos/dll/cpl/appwiz/resource.h Fri Oct 12 14:12:52 2007
@@ -45,28 +45,31 @@
/* strings */
#define IDS_CPLSYSTEMNAME 1001
#define IDS_CPLSYSTEMDESCRIPTION 2001
-#define IDS_NOITEM_SELECTED 2002
-#define IDS_ERROR 2003
-#define IDS_UNABLEREAD_UNINSTSTR 2004
-#define IDS_UNABLEOPEN_UNINSTKEY 2005
-#define IDS_APPLIST 2006
-#define IDS_LARGEICONS 2007
-#define IDS_LIST 2008
-#define IDS_DETAILS 2009
-#define IDS_UPDATESLIST 2010
-#define IDS_INFO_DISPNAME 2011
-#define IDS_INFO_PUBLISHER 2012
-#define IDS_INFO_VERSION 2013
-#define IDS_INFO_CONTACT 2014
-#define IDS_INFO_SUPPORTINFO 2015
-#define IDS_INFO_SUPPORTPHONE 2016
-#define IDS_INFO_PRODUCT_UPDATES 2017
-#define IDS_INFO_COMMENTS 2018
-#define IDS_INFO_REGOWNER 2019
-#define IDS_INFO_PRODUCTID 2020
-#define IDS_INFO_README 2021
-#define IDS_CREATE_SHORTCUT 2022
-#define IDS_ERROR_NOT_FOUND 2023
+#define IDS_ERROR 2002
+#define IDS_UNABLEREAD_UNINSTSTR 2003
+#define IDS_UNABLEOPEN_UNINSTKEY 2004
+#define IDS_APPLIST 2005
+#define IDS_LARGEICONS 2006
+#define IDS_LIST 2007
+#define IDS_DETAILS 2008
+#define IDS_UPDATESLIST 2009
+#define IDS_INFO_DISPNAME 2010
+#define IDS_INFO_PUBLISHER 2011
+#define IDS_INFO_VERSION 2012
+#define IDS_INFO_CONTACT 2013
+#define IDS_INFO_SUPPORTINFO 2014
+#define IDS_INFO_SUPPORTPHONE 2015
+#define IDS_INFO_PRODUCT_UPDATES 2016
+#define IDS_INFO_COMMENTS 2017
+#define IDS_INFO_REGOWNER 2018
+#define IDS_INFO_PRODUCTID 2019
+#define IDS_INFO_README 2020
+#define IDS_CREATE_SHORTCUT 2021
+#define IDS_ERROR_NOT_FOUND 2022
+#define IDS_UNABLEREAD_INFORMATION 2023
+#define IDS_NO_INFORMATION 2024
+#define IDS_NONE_APP 2025
+#define IDS_NONE_UPD 2026
/* controls */
#define IDC_INSTALL 101
@@ -81,6 +84,11 @@
#define IDC_ADD_DOWNLOAD_BUTTON 110
#define IDC_ADD_FIND_BUTTON 111
#define IDC_ADD_PROP_BUTTON 112
+#define IDC_UPD_VIEW_COMBO 113
+#define IDC_UPDATESLIST 114
+#define IDC_UPD_FIND_EDIT 115
+#define IDC_UPD_REMOVE 116
+#define IDC_UPD_INFO_BUTTON 117
#endif /* __CPL_RESOURCE_H */
Modified: trunk/reactos/dll/cpl/appwiz/updates.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/updates.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/updates.c (original)
+++ trunk/reactos/dll/cpl/appwiz/updates.c Fri Oct 12 14:12:52 2007
@@ -30,6 +30,38 @@
#include "appwiz.h"
+HWND UpdInfoDialog;
+
+static
+INT_PTR CALLBACK
+InfoPropDlgProc(HWND hDlg,
+ UINT message,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ UNREFERENCED_PARAMETER(lParam);
+
+ switch (message)
+ {
+ case WM_INITDIALOG:
+ {
+ CallInformation(hDlg, UpdInfoDialog, IDC_UPDATESLIST);
+ }
+ case WM_COMMAND:
+ {
+ switch (LOWORD(wParam))
+ {
+ case IDCANCEL:
+ EndDialog(hDlg,LOWORD(wParam));
+ break;
+ }
+ }
+ break;
+ }
+
+ return FALSE;
+}
+
/* Property page dialog callback */
INT_PTR CALLBACK
UpdatesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -42,62 +74,56 @@
switch (uMsg)
{
case WM_INITDIALOG:
- AddItemsToViewControl(hwndDlg);
+ AddItemsToViewControl(hwndDlg, IDC_UPD_VIEW_COMBO);
LoadString(hApplet, IDS_UPDATESLIST, Buf, sizeof(Buf) / sizeof(TCHAR));
- AddListColumn(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),Buf);
- FillSoftwareList(hwndDlg, TRUE);
+ AddListColumn(GetDlgItem(hwndDlg, IDC_UPDATESLIST),Buf);
+ FillSoftwareList(hwndDlg, TRUE, IDC_UPDATESLIST);
+ UpdInfoDialog = hwndDlg;
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
- case IDC_FIND_EDIT:
+ case IDC_UPD_FIND_EDIT:
if (HIWORD(wParam) == EN_CHANGE)
{
- FindItems(hwndDlg);
+
FindItems(hwndDlg,IDC_UPDATESLIST,IDC_UPD_FIND_EDIT,IDC_UPD_REMOVE,IDC_UPD_INFO_BUTTON);
}
break;
case ID_UPD_INFORMATION:
- case IDC_INFO_BUTTON:
+ case IDC_UPD_INFO_BUTTON:
+ {
+ if (IsItemSelected(hwndDlg, IDC_SOFTWARELIST))
DialogBox(hApplet,
MAKEINTRESOURCE(IDD_INFORMATION),
hwndDlg,
InfoPropDlgProc);
+ }
break;
case ID_UPD_REMOVE:
- case IDC_ADDREMOVE:
- CallUninstall(hwndDlg, IDC_SOFTWARELIST, TRUE);
+ case IDC_UPD_REMOVE:
+ CallUninstall(hwndDlg, IDC_UPDATESLIST, IDC_UPD_REMOVE,
IDC_UPD_INFO_BUTTON, TRUE);
break;
- case IDC_VIEW_COMBO:
+ case IDC_UPD_VIEW_COMBO:
if (HIWORD(wParam) == CBN_SELCHANGE)
- {
- GetCurrentView(hwndDlg);
- }
+ GetCurrentView(hwndDlg, IDC_UPD_VIEW_COMBO, IDC_UPDATESLIST);
break;
}
break;
case WM_NOTIFY:
switch (LOWORD(wParam))
{
- case IDC_SOFTWARELIST:
+ case IDC_UPDATESLIST:
switch (((LPNMHDR)lParam)->code)
{
case NM_DBLCLK:
- CallUninstall(hwndDlg, IDC_SOFTWARELIST, TRUE);
+ CallUninstall(hwndDlg, IDC_UPDATESLIST, IDC_UPD_REMOVE, IDC_UPD_INFO_BUTTON,
TRUE);
break;
case NM_CLICK:
{
- INT nIndex;
- nIndex = (INT)SendMessage(GetDlgItem(hwndDlg,
IDC_SOFTWARELIST),LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- if (nIndex == -1)
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_INFO_BUTTON),FALSE);
- }
+ if (!IsItemSelected(hwndDlg, IDC_UPDATESLIST))
+ ButtonStatus(hwndDlg, FALSE, IDC_UPD_REMOVE, IDC_UPD_INFO_BUTTON);
else
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),TRUE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_INFO_BUTTON),TRUE);
- }
+ ButtonStatus(hwndDlg, TRUE, IDC_UPD_REMOVE, IDC_UPD_INFO_BUTTON);
}
break;
}
@@ -109,7 +135,8 @@
ShowPopupMenu(hwndDlg,
IDR_POPUP_UPD,
GET_X_LPARAM(lParam),
- GET_Y_LPARAM(lParam));
+ GET_Y_LPARAM(lParam),
+ IDC_UPDATESLIST);
}
break;
}