Author: fireball
Date: Mon Oct 8 19:56:31 2007
New Revision: 29458
URL:
http://svn.reactos.org/svn/reactos?rev=29458&view=rev
Log:
Dmitry Chapyshev <lentind(a)yandex.ru>
- Modify/Remove action: Wait for the process completion and only then become active again
(like Windows' AppWiz does)
- Move Updates to another tab
- Move all include directives to appwiz.h
- Add context menu for applications list
- Slightly change this applet's design
- Add an icon for ReactOS setup and Update tabs
- Add a working Download! button. This button is active only if Download!.exe exists in
system32 directory when appwiz.cpl starts
- Other small changes
Added:
trunk/reactos/dll/cpl/appwiz/resources/reactos.ico (with props)
trunk/reactos/dll/cpl/appwiz/resources/updates.ico (with props)
trunk/reactos/dll/cpl/appwiz/updates.c (with props)
Modified:
trunk/reactos/dll/cpl/appwiz/add.c
trunk/reactos/dll/cpl/appwiz/appwiz.c
trunk/reactos/dll/cpl/appwiz/appwiz.h
trunk/reactos/dll/cpl/appwiz/appwiz.rbuild
trunk/reactos/dll/cpl/appwiz/appwiz.rc
trunk/reactos/dll/cpl/appwiz/createlink.c
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/rossetup.c
Modified: trunk/reactos/dll/cpl/appwiz/add.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/add.c?rev=2…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/add.c (original)
+++ trunk/reactos/dll/cpl/appwiz/add.c Mon Oct 8 19:56:31 2007
@@ -19,7 +19,7 @@
/*
*
* PROJECT: ReactOS Software Control Panel
- * FILE: dll/cpl/appwiz/appwiz.c
+ * FILE: dll/cpl/appwiz/add.c
* PURPOSE: ReactOS Software Control Panel
* PROGRAMMERS: Gero Kuehn (reactos.filter(a)gkware.com)
* Dmitry Chapyshev (lentind(a)yandex.ru)
@@ -28,19 +28,40 @@
* 09-25-2007 Modify
*/
-#include <windows.h>
-#include <commctrl.h>
-#include <cpl.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <tchar.h>
-#include <process.h>
-
-#include "resource.h"
#include "appwiz.h"
+BOOL
+CheckDownload(VOID)
+{
+ TCHAR Buf[MAX_PATH];
+ if(!GetSystemDirectory(Buf,MAX_PATH)) return FALSE;
+ lstrcat((LPTSTR)Buf, L"\\downloader.exe");
+ if (GetFileAttributes(Buf) != 0xFFFFFFFF) return TRUE;
+ return FALSE;
+}
+
+BOOL
+LaunchDownload(HWND hwndDlg)
+{
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ TCHAR Buf[MAX_PATH];
+
+ ZeroMemory(&si, sizeof(si));
+ si.cb = sizeof(si);
+ ZeroMemory(&pi, sizeof(pi));
+
+ if(!GetSystemDirectory(Buf,MAX_PATH)) return FALSE;
+ lstrcat((LPTSTR)Buf, L"\\downloader.exe");
+
+ if(CreateProcess(NULL,Buf,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi))
+ {
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ return TRUE;
+ }
+ return FALSE;
+}
/* Property page dialog callback */
INT_PTR CALLBACK
@@ -54,7 +75,16 @@
{
case WM_INITDIALOG:
EnableWindow(GetDlgItem(hwndDlg, IDC_INSTALL), FALSE);
- break;
+ if (CheckDownload()) EnableWindow(GetDlgItem(hwndDlg, IDC_ADD_DOWNLOAD_BUTTON),
TRUE);
+ break;
+ case WM_COMMAND:
+ switch (LOWORD(wParam))
+ {
+ case IDC_ADD_DOWNLOAD_BUTTON:
+ LaunchDownload(hwndDlg);
+ break;
+ }
+ break;
}
return FALSE;
Modified: trunk/reactos/dll/cpl/appwiz/appwiz.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/appwiz.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/appwiz.c (original)
+++ trunk/reactos/dll/cpl/appwiz/appwiz.c Mon Oct 8 19:56:31 2007
@@ -28,17 +28,6 @@
* 09-25-2007 Modify
*/
-#include <windows.h>
-#include <commctrl.h>
-#include <cpl.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <tchar.h>
-#include <process.h>
-
-#include "resource.h"
#include "appwiz.h"
#define NUM_APPLETS (1)
@@ -71,7 +60,7 @@
LONG CALLBACK
SystemApplet(VOID)
{
- PROPSHEETPAGE psp[3];
+ PROPSHEETPAGE psp[4];
PROPSHEETHEADER psh;
TCHAR Caption[1024];
@@ -90,8 +79,9 @@
psh.pfnCallback = NULL;
InitPropSheetPage(&psp[0], IDD_PROPPAGEINSTALL, (DLGPROC) RemovePageProc);
- InitPropSheetPage(&psp[1], IDD_PROPPAGEADD, (DLGPROC) AddPageProc);
- InitPropSheetPage(&psp[2], IDD_PROPPAGEROSSETUP, (DLGPROC) RosPageProc);
+ InitPropSheetPage(&psp[1], IDD_PROPPAGEUPDATES, (DLGPROC) UpdatesPageProc);
+ InitPropSheetPage(&psp[2], IDD_PROPPAGEADD, (DLGPROC) AddPageProc);
+ InitPropSheetPage(&psp[3], IDD_PROPPAGEROSSETUP, (DLGPROC) RosPageProc);
return (LONG)(PropertySheet(&psh) != -1);
}
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 Mon Oct 8 19:56:31 2007
@@ -1,5 +1,23 @@
#ifndef __CPL_APPWIZ_H
#define __CPL_APPWIZ_H
+
+#include <windows.h>
+#include <windowsx.h> /* GET_X/Y_LPARAM */
+#include <commctrl.h>
+#include <cpl.h>
+#include <prsht.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <tchar.h>
+#include <process.h>
+#include <prsht.h>
+#include <shlobj.h>
+#include <objbase.h>
+#include <shobjidl.h>
+#include <shlguid.h>
+
+#include "resource.h"
typedef LONG (CALLBACK *CPLAPPLET_PROC)(VOID);
@@ -26,6 +44,33 @@
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);
+
+VOID
+AddItemsToViewControl(HWND hwndDlg);
+
+VOID
+FindItems(HWND hwndDlg);
+
+VOID
+CallUninstall(HWND hwndDlg, UINT Control, BOOL isUpdate);
+
+VOID
+GetCurrentView(HWND hwndDlg);
+
+VOID
+CallInformation(HWND hwndDlg);
+
+VOID
+ShowPopupMenu(HWND hwndDlg, UINT ResMenu, INT xPos, INT yPos);
+
/* add.c */
INT_PTR CALLBACK
AddPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
@@ -44,6 +89,10 @@
LONG CALLBACK
NewLinkHere(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
+/* updates.c */
+INT_PTR CALLBACK
+UpdatesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
void ShowLastWin32Error(HWND hWndOwner);
#endif /* __CPL_APPWIZ_H */
Modified: trunk/reactos/dll/cpl/appwiz/appwiz.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/appwiz.rbui…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/appwiz.rbuild (original)
+++ trunk/reactos/dll/cpl/appwiz/appwiz.rbuild Mon Oct 8 19:56:31 2007
@@ -19,5 +19,6 @@
<file>add.c</file>
<file>rossetup.c</file>
<file>createlink.c</file>
+ <file>updates.c</file>
<file>appwiz.rc</file>
</module>
Modified: trunk/reactos/dll/cpl/appwiz/appwiz.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/appwiz.rc?r…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/appwiz.rc (original)
+++ trunk/reactos/dll/cpl/appwiz/appwiz.rc Mon Oct 8 19:56:31 2007
@@ -21,6 +21,8 @@
IDI_RECBINICO ICON "resources/1503.ico"
IDI_DOWNLOADICO ICON "resources/1504.ico"
IDI_APPINETICO ICON "resources/1505.ico"
+IDI_UPDATES ICON "resources/updates.ico"
+IDI_REACTOS ICON "resources/reactos.ico"
IDB_WATERMARK BITMAP "resources/watermark.bmp"
Modified: trunk/reactos/dll/cpl/appwiz/createlink.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/createlink.…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/createlink.c (original)
+++ trunk/reactos/dll/cpl/appwiz/createlink.c Mon Oct 8 19:56:31 2007
@@ -1,27 +1,15 @@
-
/* $Id: appwiz.c 29364 2007-10-02 23:34:00Z janderwald $
*
* PROJECT: ReactOS Software Control Panel
* FILE: dll/cpl/appwiz/createlink.c
* PURPOSE: ReactOS Software Control Panel
- * PROGRAMMER: Johannes Anderwald
+ * PROGRAMMER: Gero Kuehn (reactos.filter(a)gkware.com)
+ * Dmitry Chapyshev (lentind(a)yandex.ru)
+ * Johannes Anderwald
+ * UPDATE HISTORY:
+ * 06-17-2004 Created
*/
-#include <windows.h>
-#include <commctrl.h>
-#include <cpl.h>
-#include <prsht.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <tchar.h>
-#include <process.h>
-#include <shlobj.h>
-#include <objbase.h>
-#include <shobjidl.h>
-#include <shlguid.h>
-#include <stdio.h>
-#include "resource.h"
#include "appwiz.h"
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 Mon Oct 8 19:56:31 2007
@@ -1,4 +1,22 @@
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+IDR_POPUP_APP MENU
+BEGIN
+ POPUP "popup"
+ BEGIN
+ MENUITEM "Modify/&Remove",ID_APP_MODIFYREMOVE
+ MENUITEM "&Information", ID_APP_INFORMATION
+ END
+END
+
+IDR_POPUP_UPD MENU
+BEGIN
+ POPUP "popup"
+ BEGIN
+ MENUITEM "&Remove", ID_UPD_REMOVE
+ MENUITEM "&Information", ID_UPD_INFORMATION
+ END
+END
IDD_PROPPAGEINSTALL DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
@@ -7,14 +25,29 @@
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
- CONTROL "&Show updates",IDC_SHOWUPDATES,"button",BS_AUTOCHECKBOX
| WS_TABSTOP,PROPSHEETPADDING, 30, 100, 14
- LTEXT "Find:",-1,172,33,50,14
- EDITTEXT IDC_FIND_EDIT, 193, 30, 180, 14, WS_VISIBLE | WS_TABSTOP
+ 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 "Modify/&Remove", IDC_ADDREMOVE, PROPSHEETPADDING, 210, 80, 14,
WS_DISABLED
PUSHBUTTON "&Information", IDC_INFO_BUTTON, PROPSHEETPADDING+85, 210, 80,
14, WS_DISABLED
- LTEXT "View:",-1,253,212,40,8
- COMBOBOX IDC_VIEW_COMBO, 280, 210, 94, 80, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE |
WS_TABSTOP | WS_VSCROLL
+END
+
+IDD_PROPPAGEUPDATES DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Remove Updates"
+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
END
IDD_PROPPAGEADD DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
@@ -28,12 +61,12 @@
LTEXT "", -1, PROPSHEETPADDING, 70, PROPSHEETWIDTH-12, 1, NOT WS_GROUP |
SS_SUNKEN
ICON IDI_DOWNLOADICO,-1,PROPSHEETPADDING,80,32,32
LTEXT "To download and install new applications, press ""Download
!"".",-1,36,83,PROPSHEETWIDTH-48,17
- PUSHBUTTON "&Download !", IDC_INSTALL, PROPSHEETWIDTH-(90), 125, 80, 14
+ PUSHBUTTON "&Download !", IDC_ADD_DOWNLOAD_BUTTON, PROPSHEETWIDTH-(90),
125, 80, 14, WS_DISABLED
LTEXT "", -1, PROPSHEETPADDING, 150, PROPSHEETWIDTH-12, 1, NOT WS_GROUP |
SS_SUNKEN
ICON IDI_APPINETICO,-1,PROPSHEETPADDING,160,32,32
LTEXT "Press ""Find in the Internet"" button in order to search
for new applications available via Internet
connection.",-1,36,161,PROPSHEETWIDTH-48,17
- PUSHBUTTON "&Properties...", IDC_INSTALL, PROPSHEETWIDTH-(175), 205, 80,
14
- PUSHBUTTON "&Find in the Internet", IDC_INSTALL, PROPSHEETWIDTH-(90), 205,
80, 14
+ PUSHBUTTON "&Properties...", IDC_ADD_PROP_BUTTON, PROPSHEETWIDTH-(175),
205, 80, 14, WS_DISABLED
+ PUSHBUTTON "&Find in the Internet", IDC_ADD_FIND_BUTTON,
PROPSHEETWIDTH-(90), 205, 80, 14, WS_DISABLED
END
IDD_PROPPAGEROSSETUP DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
@@ -41,7 +74,8 @@
CAPTION "ReactOS Setup"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
-
+ ICON IDI_REACTOS,-1,PROPSHEETPADDING,6,16,16
+ LTEXT "",-1,36,7,PROPSHEETWIDTH-48,32
END
IDD_FIRSTPAGE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
@@ -85,6 +119,35 @@
LTEXT "Click Finish to create the shortcut.", -1, 120, 50, 150, 10
END
+IDD_INFORMATION DIALOG 5, 100, 269, 200
+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
+END
+
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Add/Remove Programs"
@@ -94,6 +157,7 @@
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"
IDS_APPLIST "Currently installed programs"
+ IDS_UPDATESLIST "Currently installed updates"
IDS_LARGEICONS "Large Icons"
IDS_LIST "List"
IDS_DETAILS "Details"
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 Mon Oct 8 19:56:31 2007
@@ -19,7 +19,7 @@
/*
*
* PROJECT: ReactOS Software Control Panel
- * FILE: dll/cpl/appwiz/appwiz.c
+ * FILE: dll/cpl/appwiz/remove.c
* PURPOSE: ReactOS Software Control Panel
* PROGRAMMERS: Gero Kuehn (reactos.filter(a)gkware.com)
* Dmitry Chapyshev (lentind(a)yandex.ru)
@@ -28,21 +28,16 @@
* 09-25-2007 Modify
*/
-#include <windows.h>
-#include <commctrl.h>
-#include <cpl.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <tchar.h>
-#include <process.h>
-
-#include "resource.h"
#include "appwiz.h"
-static VOID
-CallUninstall(HWND hwndDlg)
+VOID
+CallInformation(HWND hwndDlg)
+{
+
+}
+
+VOID
+CallUninstall(HWND hwndDlg, UINT Control, BOOL isUpdate)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
@@ -53,7 +48,7 @@
DWORD dwSize;
TCHAR Buf[256],Title[256];
- 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)
{
LoadString(hApplet, IDS_NOITEM_SELECTED, Buf, sizeof(Buf) / sizeof(TCHAR));
@@ -87,8 +82,12 @@
si.wShowWindow = SW_SHOW;
if
(CreateProcess(NULL,pszUninstallString,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi))
{
+ WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
+ // Update software list
+ (void)ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_SOFTWARELIST));
+ FillSoftwareList(hwndDlg, isUpdate);
}
}
else
@@ -103,7 +102,7 @@
}
}
-static VOID
+VOID
AddListColumn(HWND hList, LPTSTR Caption)
{
LV_COLUMN dummy;
@@ -166,11 +165,10 @@
(void)ListView_SetImageList(GetDlgItem(hwndDlg,
IDC_SOFTWARELIST),hImgListSmall,LVSIL_SMALL);
(void)ListView_SetImageList(GetDlgItem(hwndDlg,
IDC_SOFTWARELIST),hImgListLarge,LVSIL_NORMAL);
-
-}
-
-static VOID
-FillSoftwareList(HWND hwndDlg)
+}
+
+VOID
+FillSoftwareList(HWND hwndDlg, BOOL bShowUpdates)
{
TCHAR pszName[MAX_PATH];
TCHAR pszDisplayName[MAX_PATH];
@@ -183,11 +181,8 @@
DWORD dwValue = 0;
BOOL bIsUpdate = FALSE;
BOOL bIsSystemComponent = FALSE;
- BOOL bShowUpdates = FALSE;
INT ItemIndex = 0;
TCHAR Buf[256],Title[256];
-
- bShowUpdates = (SendMessage(GetDlgItem(hwndDlg, IDC_SHOWUPDATES), BM_GETCHECK, 0, 0)
== BST_CHECKED);
if (RegOpenKey(HKEY_LOCAL_MACHINE,
TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"),
@@ -240,7 +235,7 @@
(LPBYTE)pszDisplayName,
&dwSize) == ERROR_SUCCESS)
{
- if ((!bIsUpdate) && (!bIsSystemComponent))
+ if ((!bIsUpdate) && (!bIsSystemComponent) &&
(!bShowUpdates))
{
AddItemToList(hwndDlg, (LPARAM)hSubKey, (LPTSTR)pszDisplayName, ItemIndex);
}
@@ -258,7 +253,7 @@
RegCloseKey(hKey);
}
-static VOID
+VOID
AddItemsToViewControl(HWND hwndDlg)
{
TCHAR Buf[256];
@@ -304,7 +299,7 @@
(LPARAM)Buf);
}
-static VOID
+VOID
FindItems(HWND hwndDlg)
{
HWND hList;
@@ -344,6 +339,91 @@
}
}
+VOID
+GetCurrentView(HWND hwndDlg)
+{
+ int nCurrSel;
+ nCurrSel = (int)SendMessage(GetDlgItem(hwndDlg, IDC_VIEW_COMBO),
+ CB_GETCURSEL,
+ (WPARAM)0,
+ (LPARAM)0);
+ switch (nCurrSel)
+ {
+ case 0:
+ SetWindowLong(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),
+ 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),
+ 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),
+ 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)
+{
+ INT nIndex;
+ nIndex = (INT)SendMessage(GetDlgItem(hwndDlg,
IDC_SOFTWARELIST),LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ if ( nIndex != -1)
+ {
+ POINT pt;
+ RECT lvRect;
+ HMENU hMenu;
+
+ GetCursorPos(&pt);
+
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_SOFTWARELIST), &lvRect);
+ if (PtInRect(&lvRect, pt))
+ {
+ hMenu = GetSubMenu(LoadMenu(hApplet, MAKEINTRESOURCE(ResMenu)),0);
+ TrackPopupMenuEx(hMenu,
+ TPM_RIGHTBUTTON,
+ xPos,
+ yPos,
+ hwndDlg,
+ NULL);
+ DestroyMenu(hMenu);
+ }
+ }
+}
+
+INT_PTR CALLBACK
+InfoPropDlgProc(HWND hDlg,
+ UINT message,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ UNREFERENCED_PARAMETER(lParam);
+
+ switch (message)
+ {
+ case WM_INITDIALOG:
+ {
+
+ }
+ case WM_COMMAND:
+ {
+ switch (LOWORD(wParam))
+ {
+ case IDOK:
+
+ break;
+ case IDCANCEL:
+ EndDialog(hDlg,LOWORD(wParam));
+ break;
+ }
+ }
+ break;
+ }
+
+ return FALSE;
+}
+
/* Property page dialog callback */
INT_PTR CALLBACK
RemovePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -357,7 +437,7 @@
AddItemsToViewControl(hwndDlg);
LoadString(hApplet, IDS_APPLIST, Buf, sizeof(Buf) / sizeof(TCHAR));
AddListColumn(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),Buf);
- FillSoftwareList(hwndDlg);
+ FillSoftwareList(hwndDlg, FALSE);
break;
case WM_COMMAND:
@@ -369,51 +449,34 @@
FindItems(hwndDlg);
}
break;
- case IDC_SHOWUPDATES:
- if (HIWORD(wParam) == BN_CLICKED)
- {
- SendMessage(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),LVM_DELETEALLITEMS,0,0);
- FillSoftwareList(hwndDlg);
- }
+ case ID_APP_MODIFYREMOVE:
+ case IDC_ADDREMOVE:
+ CallUninstall(hwndDlg, IDC_SOFTWARELIST, FALSE);
break;
- case IDC_ADDREMOVE:
- CallUninstall(hwndDlg);
- break;
+ case ID_APP_INFORMATION:
+ case IDC_INFO_BUTTON:
+ DialogBox(hApplet,
+ MAKEINTRESOURCE(IDD_INFORMATION),
+ hwndDlg,
+ InfoPropDlgProc);
+ break;
case IDC_VIEW_COMBO:
if (HIWORD(wParam) == CBN_SELCHANGE)
{
- int nCurrSel;
- nCurrSel = (int)SendMessage(GetDlgItem(hwndDlg, IDC_VIEW_COMBO),
- CB_GETCURSEL,
- (WPARAM)0,
- (LPARAM)0);
- switch (nCurrSel)
- {
- case 0:
- SetWindowLong(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),
- 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),
- 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),
- GWL_STYLE,LVS_REPORT | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL |
WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP);
- break;
- }
+ GetCurrentView(hwndDlg);
}
break;
}
break;
case WM_NOTIFY:
+ {
switch (LOWORD(wParam))
{
case IDC_SOFTWARELIST:
switch (((LPNMHDR)lParam)->code)
{
case NM_DBLCLK:
- CallUninstall(hwndDlg);
+ CallUninstall(hwndDlg, IDC_SOFTWARELIST, FALSE);
break;
case NM_CLICK:
{
@@ -422,16 +485,34 @@
if (nIndex == -1)
{
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_INFO_BUTTON),FALSE);
}
else
{
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_INFO_BUTTON),TRUE);
}
}
break;
}
break;
}
+ }
+ break;
+ case WM_MENUSELECT:
+ {
+ switch((UINT)LOWORD(wParam))
+ {
+ }
+ }
+ break;
+ case WM_CONTEXTMENU:
+ {
+ ShowPopupMenu(hwndDlg,
+ IDR_POPUP_APP,
+ GET_X_LPARAM(lParam),
+ GET_Y_LPARAM(lParam));
+ }
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 Mon Oct 8 19:56:31 2007
@@ -18,6 +18,17 @@
#define IDI_RECBINICO 1503
#define IDI_DOWNLOADICO 1504
#define IDI_APPINETICO 1505
+#define IDI_UPDATES 1506
+#define IDI_REACTOS 1507
+
+/* menus */
+#define IDR_POPUP_APP 3000
+#define IDR_POPUP_UPD 3001
+
+#define ID_APP_MODIFYREMOVE 3500
+#define ID_APP_INFORMATION 3501
+#define ID_UPD_REMOVE 3502
+#define ID_UPD_INFORMATION 3503
/* dialogs */
#define IDD_PROPPAGEINSTALL 200
@@ -25,6 +36,8 @@
#define IDD_PROPPAGEADD 202
#define IDD_SHORTCUT_LOCATION 203
#define IDD_SHORTCUT_FINISH 204
+#define IDD_PROPPAGEUPDATES 205
+#define IDD_INFORMATION 206
/* bitmaps */
#define IDB_WATERMARK 5001
@@ -40,20 +53,34 @@
#define IDS_LARGEICONS 2007
#define IDS_LIST 2008
#define IDS_DETAILS 2009
-#define IDS_CREATE_SHORTCUT 2010
-#define IDS_ERROR_NOT_FOUND 2011
+#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
/* controls */
#define IDC_INSTALL 101
#define IDC_SOFTWARELIST 102
#define IDC_ADDREMOVE 103
-#define IDC_SHOWUPDATES 104
-#define IDC_FIND_EDIT 105
-#define IDC_INFO_BUTTON 106
-#define IDC_VIEW_COMBO 107
-#define IDC_SHORTCUT_LOCATION 108
-#define IDC_SHORTCUT_BROWSE 109
-#define IDC_SHORTCUT_NAME 110
+#define IDC_FIND_EDIT 104
+#define IDC_INFO_BUTTON 105
+#define IDC_VIEW_COMBO 106
+#define IDC_SHORTCUT_LOCATION 107
+#define IDC_SHORTCUT_BROWSE 108
+#define IDC_SHORTCUT_NAME 109
+#define IDC_ADD_DOWNLOAD_BUTTON 110
+#define IDC_ADD_FIND_BUTTON 111
+#define IDC_ADD_PROP_BUTTON 112
#endif /* __CPL_RESOURCE_H */
Added: trunk/reactos/dll/cpl/appwiz/resources/reactos.ico
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/resources/r…
==============================================================================
Binary file - no diff available.
Propchange: trunk/reactos/dll/cpl/appwiz/resources/reactos.ico
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/reactos/dll/cpl/appwiz/resources/updates.ico
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/resources/u…
==============================================================================
Binary file - no diff available.
Propchange: trunk/reactos/dll/cpl/appwiz/resources/updates.ico
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: trunk/reactos/dll/cpl/appwiz/rossetup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/rossetup.c?…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/rossetup.c (original)
+++ trunk/reactos/dll/cpl/appwiz/rossetup.c Mon Oct 8 19:56:31 2007
@@ -19,7 +19,7 @@
/*
*
* PROJECT: ReactOS Software Control Panel
- * FILE: dll/cpl/appwiz/appwiz.c
+ * FILE: dll/cpl/appwiz/rossetup.c
* PURPOSE: ReactOS Software Control Panel
* PROGRAMMERS: Gero Kuehn (reactos.filter(a)gkware.com)
* Dmitry Chapyshev (lentind(a)yandex.ru)
@@ -28,17 +28,6 @@
* 09-25-2007 Modify
*/
-#include <windows.h>
-#include <commctrl.h>
-#include <cpl.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <tchar.h>
-#include <process.h>
-
-#include "resource.h"
#include "appwiz.h"
Added: 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 (added)
+++ trunk/reactos/dll/cpl/appwiz/updates.c Mon Oct 8 19:56:31 2007
@@ -1,0 +1,118 @@
+/*
+ * ReactOS
+ * Copyright (C) 2004 ReactOS Team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/*
+ *
+ * PROJECT: ReactOS Software Control Panel
+ * FILE: dll/cpl/appwiz/updates.c
+ * PURPOSE: ReactOS Software Control Panel
+ * PROGRAMMERS: Gero Kuehn (reactos.filter(a)gkware.com)
+ * Dmitry Chapyshev (lentind(a)yandex.ru)
+ * UPDATE HISTORY:
+ * 06-17-2004 Created
+ * 09-25-2007 Modify
+ */
+
+#include "appwiz.h"
+
+/* Property page dialog callback */
+INT_PTR CALLBACK
+UpdatesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ UNREFERENCED_PARAMETER(lParam);
+ UNREFERENCED_PARAMETER(wParam);
+ UNREFERENCED_PARAMETER(hwndDlg);
+ TCHAR Buf[256];
+
+ switch (uMsg)
+ {
+ case WM_INITDIALOG:
+ AddItemsToViewControl(hwndDlg);
+ LoadString(hApplet, IDS_UPDATESLIST, Buf, sizeof(Buf) / sizeof(TCHAR));
+ AddListColumn(GetDlgItem(hwndDlg, IDC_SOFTWARELIST),Buf);
+ FillSoftwareList(hwndDlg, TRUE);
+ break;
+ case WM_COMMAND:
+ switch (LOWORD(wParam))
+ {
+ case IDC_FIND_EDIT:
+ if (HIWORD(wParam) == EN_CHANGE)
+ {
+ FindItems(hwndDlg);
+ }
+ break;
+ case ID_UPD_INFORMATION:
+ case IDC_INFO_BUTTON:
+ DialogBox(hApplet,
+ MAKEINTRESOURCE(IDD_INFORMATION),
+ hwndDlg,
+ InfoPropDlgProc);
+ break;
+ case ID_UPD_REMOVE:
+ case IDC_ADDREMOVE:
+ CallUninstall(hwndDlg, IDC_SOFTWARELIST, TRUE);
+ break;
+ case IDC_VIEW_COMBO:
+ if (HIWORD(wParam) == CBN_SELCHANGE)
+ {
+ GetCurrentView(hwndDlg);
+ }
+ break;
+ }
+ break;
+ case WM_NOTIFY:
+ switch (LOWORD(wParam))
+ {
+ case IDC_SOFTWARELIST:
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case NM_DBLCLK:
+ CallUninstall(hwndDlg, IDC_SOFTWARELIST, 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);
+ }
+ else
+ {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDREMOVE),TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_INFO_BUTTON),TRUE);
+ }
+ }
+ break;
+ }
+ break;
+ }
+ break;
+ case WM_CONTEXTMENU:
+ {
+ ShowPopupMenu(hwndDlg,
+ IDR_POPUP_UPD,
+ GET_X_LPARAM(lParam),
+ GET_Y_LPARAM(lParam));
+ }
+ break;
+ }
+
+ return FALSE;
+}
Propchange: trunk/reactos/dll/cpl/appwiz/updates.c
------------------------------------------------------------------------------
svn:eol-style = native