winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
July 2008
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
1114 discussions
Start a n
N
ew thread
Owen Rudge : appwiz.cpl: Add basic Support Information dialog.
by Alexandre Julliard
25 Jul '08
25 Jul '08
Module: wine Branch: master Commit: d508a58cafbb42230a7a77e49a79319d2c8a1764 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d508a58cafbb42230a7a77e49…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Mon Jul 21 19:44:02 2008 +0100 appwiz.cpl: Add basic Support Information dialog. --- dlls/appwiz.cpl/En.rc | 25 ++++++++++++++ dlls/appwiz.cpl/appwiz.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/appwiz.cpl/res.h | 10 ++++++ 3 files changed, 117 insertions(+), 0 deletions(-) diff --git a/dlls/appwiz.cpl/En.rc b/dlls/appwiz.cpl/En.rc index fde9fa1..155f46c 100644 --- a/dlls/appwiz.cpl/En.rc +++ b/dlls/appwiz.cpl/En.rc @@ -51,3 +51,28 @@ FONT 8, "MS Sans Serif" CONTROL "&Support Info...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 198, 64, 14 CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 } + +IDD_INFO DIALOG 0, 0, 256, 138 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Support Information" +FONT 8, "MS Sans Serif" +{ + CONTROL "OK", IDOK, "BUTTON", BS_DEFPUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 103, 116, 50, 14 + CONTROL "The following information can be used to get technical support for %s:", IDC_INFO_LABEL, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 12, 9, 228, 19 + CONTROL "Publisher:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 30, 60, 8 + CONTROL "Version:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 40, 60, 8 + CONTROL "Contact:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 50, 60, 8 + CONTROL "Support Information:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 60, 64, 8 + CONTROL "Support Telephone:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 70, 68, 8 + CONTROL "Readme:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 80, 60, 8 + CONTROL "Product Updates:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 90, 60, 8 + CONTROL "Comments:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 100, 60, 8 + CONTROL "", IDC_INFO_PUBLISHER, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 30, 136, 8 + CONTROL "", IDC_INFO_VERSION, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 40, 136, 8 + CONTROL "", IDC_INFO_CONTACT, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 50, 136, 8 + CONTROL "", IDC_INFO_SUPPORT, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 60, 136, 8 + CONTROL "", IDC_INFO_PHONE, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 70, 136, 8 + CONTROL "", IDC_INFO_README, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 80, 136, 8 + CONTROL "", IDC_INFO_UPDATES, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 90, 136, 8 + CONTROL "", IDC_INFO_COMMENTS, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 100, 136, 8 +} diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c index fa4d573..a13dea1 100644 --- a/dlls/appwiz.cpl/appwiz.c +++ b/dlls/appwiz.cpl/appwiz.c @@ -426,6 +426,72 @@ static void UninstallProgram(int id) } } +/****************************************************************************** + * Name : SupportInfoDlgProc + * Description: Callback procedure for support info dialog + * Parameters : hWnd - hWnd of the window + * msg - reason for calling function + * wParam - additional parameter + * lParam - additional parameter + * Returns : Dependant on message + */ +static BOOL CALLBACK SupportInfoDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + APPINFO *iter; + WCHAR oldtitle[MAX_STRING_LEN]; + WCHAR buf[MAX_STRING_LEN]; + + switch(msg) + { + case WM_INITDIALOG: + for (iter = AppInfo; iter; iter = iter->next) + { + if (iter->id == (int) lParam) + { + /* Update the main label with the app name */ + if (GetWindowTextW(GetDlgItem(hWnd, IDC_INFO_LABEL), oldtitle, + MAX_STRING_LEN) != 0) + { + wsprintfW(buf, oldtitle, iter->title); + SetWindowTextW(GetDlgItem(hWnd, IDC_INFO_LABEL), buf); + } + + break; + } + } + + return TRUE; + + case WM_DESTROY: + return 0; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDOK: + EndDialog(hWnd, TRUE); + break; + + } + + return TRUE; + } + + return FALSE; +} + +/****************************************************************************** + * Name : SupportInfo + * Description: Displays the Support Information dialog + * Parameters : hWnd - Handle of the main dialog + * id - ID of the application to display information for + */ +static void SupportInfo(HWND hWnd, int id) +{ + DialogBoxParamW(hInst, MAKEINTRESOURCEW(IDD_INFO), hWnd, (DLGPROC) + SupportInfoDlgProc, (LPARAM) id); +} + /* Definition of column headers for AddListViewColumns function */ typedef struct AppWizColumn { int width; @@ -609,6 +675,22 @@ static BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar hImageList = ResetApplicationList(FALSE, hWnd, hImageList); break; + + case IDC_SUPPORT_INFO: + selitem = SendDlgItemMessageW(hWnd, IDL_PROGRAMS, + LVM_GETNEXTITEM, -1, LVNI_FOCUSED | LVNI_SELECTED); + + if (selitem != -1) + { + lvItem.iItem = selitem; + lvItem.mask = LVIF_PARAM; + + if (SendDlgItemMessageW(hWnd, IDL_PROGRAMS, LVM_GETITEMW, + 0, (LPARAM) &lvItem)) + SupportInfo(hWnd, lvItem.lParam); + } + + break; } return TRUE; diff --git a/dlls/appwiz.cpl/res.h b/dlls/appwiz.cpl/res.h index 2aff5ca..ea32be8 100644 --- a/dlls/appwiz.cpl/res.h +++ b/dlls/appwiz.cpl/res.h @@ -30,6 +30,16 @@ #define IDC_ADDREMOVE 1012 #define IDC_SUPPORT_INFO 1013 +#define IDC_INFO_PUBLISHER 1100 +#define IDC_INFO_VERSION 1101 +#define IDC_INFO_CONTACT 1102 +#define IDC_INFO_SUPPORT 1103 +#define IDC_INFO_PHONE 1104 +#define IDC_INFO_README 1105 +#define IDC_INFO_UPDATES 1106 +#define IDC_INFO_COMMENTS 1107 +#define IDC_INFO_LABEL 1108 + /* Icons */ #define ICO_MAIN 1
1
0
0
0
Owen Rudge : appwiz.cpl: Add uninstall routine for applications.
by Alexandre Julliard
25 Jul '08
25 Jul '08
Module: wine Branch: master Commit: eece76b8b33e355341f84c5f13d442529b9c31ab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eece76b8b33e355341f84c5f1…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Mon Jul 21 19:42:38 2008 +0100 appwiz.cpl: Add uninstall routine for applications. --- dlls/appwiz.cpl/En.rc | 2 + dlls/appwiz.cpl/appwiz.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/appwiz.cpl/res.h | 1 + 3 files changed, 84 insertions(+), 0 deletions(-) diff --git a/dlls/appwiz.cpl/En.rc b/dlls/appwiz.cpl/En.rc index 1abc788..fde9fa1 100644 --- a/dlls/appwiz.cpl/En.rc +++ b/dlls/appwiz.cpl/En.rc @@ -27,6 +27,8 @@ STRINGTABLE IDS_CPL_DESC, "Allows you to install new software, or remove existing software from your computer." IDS_TAB1_TITLE, "Applications" + IDS_UNINSTALL_FAILED, "Unable to execute the uninstaller, '%s'. Do you want to remove the uninstall entry for this program from the registry?" + IDS_COLUMN_NAME, "Name" IDS_COLUMN_PUBLISHER, "Publisher" IDS_COLUMN_VERSION, "Version" diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c index 445e5ba..fa4d573 100644 --- a/dlls/appwiz.cpl/appwiz.c +++ b/dlls/appwiz.cpl/appwiz.c @@ -371,6 +371,61 @@ static void UpdateButtons(HWND hWnd) EnableWindow(GetDlgItem(hWnd, IDC_SUPPORT_INFO), sel); } +/****************************************************************************** + * Name : UninstallProgram + * Description: Executes the specified program's installer. + * Parameters : id - the internal ID of the installer to remove + */ +static void UninstallProgram(int id) +{ + APPINFO *iter; + STARTUPINFOW si; + PROCESS_INFORMATION info; + WCHAR errormsg[MAX_STRING_LEN]; + WCHAR sUninstallFailed[MAX_STRING_LEN]; + HKEY hkey; + BOOL res; + + LoadStringW(hInst, IDS_UNINSTALL_FAILED, sUninstallFailed, + sizeof(sUninstallFailed) / sizeof(sUninstallFailed[0])); + + for (iter = AppInfo; iter; iter = iter->next) + { + if (iter->id == id) + { + TRACE("Uninstalling %s (%s)\n", wine_dbgstr_w(iter->title), + wine_dbgstr_w(iter->path)); + + memset(&si, 0, sizeof(STARTUPINFOW)); + si.cb = sizeof(STARTUPINFOW); + si.wShowWindow = SW_NORMAL; + res = CreateProcessW(NULL, iter->path, NULL, NULL, FALSE, 0, NULL, + NULL, &si, &info); + + if (res) + { + /* wait for the process to exit */ + WaitForSingleObject(info.hProcess, INFINITE); + } + else + { + wsprintfW(errormsg, sUninstallFailed, iter->path); + + if (MessageBoxW(0, errormsg, iter->title, MB_YESNO | + MB_ICONQUESTION) == IDYES) + { + /* delete the application's uninstall entry */ + RegOpenKeyExW(iter->regroot, PathUninstallW, 0, KEY_READ, &hkey); + RegDeleteKeyW(hkey, iter->regkey); + RegCloseKey(hkey); + } + } + + break; + } + } +} + /* Definition of column headers for AddListViewColumns function */ typedef struct AppWizColumn { int width; @@ -494,8 +549,10 @@ static HIMAGELIST ResetApplicationList(BOOL bFirstRun, HWND hWnd, HIMAGELIST hIm */ static BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { + int selitem; static HIMAGELIST hImageList; LPNMHDR nmh; + LVITEMW lvItem; switch(msg) { @@ -531,6 +588,30 @@ static BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar } return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_ADDREMOVE: + selitem = SendDlgItemMessageW(hWnd, IDL_PROGRAMS, + LVM_GETNEXTITEM, -1, LVNI_FOCUSED|LVNI_SELECTED); + + if (selitem != -1) + { + lvItem.iItem = selitem; + lvItem.mask = LVIF_PARAM; + + if (SendDlgItemMessageW(hWnd, IDL_PROGRAMS, LVM_GETITEMW, + 0, (LPARAM) &lvItem)) + UninstallProgram(lvItem.lParam); + } + + hImageList = ResetApplicationList(FALSE, hWnd, hImageList); + + break; + } + + return TRUE; } return FALSE; diff --git a/dlls/appwiz.cpl/res.h b/dlls/appwiz.cpl/res.h index 64b4a5b..2aff5ca 100644 --- a/dlls/appwiz.cpl/res.h +++ b/dlls/appwiz.cpl/res.h @@ -38,6 +38,7 @@ #define IDS_CPL_TITLE 1 #define IDS_CPL_DESC 2 #define IDS_TAB1_TITLE 3 +#define IDS_UNINSTALL_FAILED 4 #define IDS_COLUMN_NAME 6 #define IDS_COLUMN_PUBLISHER 7 #define IDS_COLUMN_VERSION 8
1
0
0
0
Owen Rudge : appwiz.cpl: Add applications to list, remove on window close.
by Alexandre Julliard
25 Jul '08
25 Jul '08
Module: wine Branch: master Commit: 0215b55ce63e20d674fc6002695783089c2078fe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0215b55ce63e20d674fc60026…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Mon Jul 21 19:42:30 2008 +0100 appwiz.cpl: Add applications to list, remove on window close. --- dlls/appwiz.cpl/appwiz.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 75 insertions(+), 0 deletions(-) diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c index 4cbcf79..445e5ba 100644 --- a/dlls/appwiz.cpl/appwiz.c +++ b/dlls/appwiz.cpl/appwiz.c @@ -293,6 +293,60 @@ end: return ret; } + +/****************************************************************************** + * Name : AddApplicationsToList + * Description: Populates the list box with applications. + * Parameters : hWnd - Handle of the dialog box + */ +static void AddApplicationsToList(HWND hWnd, HIMAGELIST hList) +{ + APPINFO *iter = AppInfo; + LVITEMW lvItem; + HICON hIcon; + int index; + + while (iter) + { + /* get the icon */ + index = 0; + + if (iter->icon) + { + if (ExtractIconExW(iter->icon, iter->iconIdx, NULL, &hIcon, 1) == 1) + { + index = ImageList_AddIcon(hList, hIcon); + DestroyIcon(hIcon); + } + } + + lvItem.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM; + lvItem.iItem = iter->id; + lvItem.iSubItem = 0; + lvItem.pszText = iter->title; + lvItem.iImage = index; + lvItem.lParam = iter->id; + + index = ListView_InsertItemW(hWnd, &lvItem); + + /* now add the subitems (columns) */ + ListView_SetItemTextW(hWnd, index, 1, iter->publisher); + ListView_SetItemTextW(hWnd, index, 2, iter->version); + + iter = iter->next; + } +} + +/****************************************************************************** + * Name : RemoveItemsFromList + * Description: Clears the application list box. + * Parameters : hWnd - Handle of the dialog box + */ +static void RemoveItemsFromList(HWND hWnd) +{ + SendDlgItemMessageW(hWnd, IDL_PROGRAMS, LVM_DELETEALLITEMS, 0, 0); +} + /****************************************************************************** * Name : EmptyList * Description: Frees memory used by the application linked list. @@ -409,6 +463,7 @@ static HIMAGELIST ResetApplicationList(BOOL bFirstRun, HWND hWnd, HIMAGELIST hIm } else /* we need to remove the existing things first */ { + RemoveItemsFromList(hWnd); ImageList_Destroy(hImageList); /* reset the list, since it's probably changed if the uninstallation was @@ -422,6 +477,7 @@ static HIMAGELIST ResetApplicationList(BOOL bFirstRun, HWND hWnd, HIMAGELIST hIm ReadApplicationsFromRegistry(HKEY_LOCAL_MACHINE); ReadApplicationsFromRegistry(HKEY_CURRENT_USER); + AddApplicationsToList(hWndListView, hImageList); UpdateButtons(hWnd); return(hImageList); @@ -439,6 +495,7 @@ static HIMAGELIST ResetApplicationList(BOOL bFirstRun, HWND hWnd, HIMAGELIST hIm static BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static HIMAGELIST hImageList; + LPNMHDR nmh; switch(msg) { @@ -451,11 +508,29 @@ static BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar return TRUE; case WM_DESTROY: + RemoveItemsFromList(hWnd); ImageList_Destroy(hImageList); EmptyList(); return 0; + + case WM_NOTIFY: + nmh = (LPNMHDR) lParam; + + switch (nmh->idFrom) + { + case IDL_PROGRAMS: + switch (nmh->code) + { + case LVN_ITEMCHANGED: + UpdateButtons(hWnd); + break; + } + break; + } + + return TRUE; } return FALSE;
1
0
0
0
Owen Rudge : appwiz.cpl: Read installed application information from registry.
by Alexandre Julliard
25 Jul '08
25 Jul '08
Module: wine Branch: master Commit: c16aeaf8e560dae85c7d7bb649ecf6bd197b7c82 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c16aeaf8e560dae85c7d7bb64…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Mon Jul 21 19:42:25 2008 +0100 appwiz.cpl: Read installed application information from registry. --- dlls/appwiz.cpl/appwiz.c | 244 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 244 insertions(+), 0 deletions(-) diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c index 4bf86a9..4cbcf79 100644 --- a/dlls/appwiz.cpl/appwiz.c +++ b/dlls/appwiz.cpl/appwiz.c @@ -48,8 +48,44 @@ WINE_DEFAULT_DEBUG_CHANNEL(appwizcpl); /* define a maximum length for various buffers we use */ #define MAX_STRING_LEN 1024 +typedef struct APPINFO { + int id; + + LPWSTR title; + LPWSTR path; + + LPWSTR icon; + int iconIdx; + + LPWSTR publisher; + LPWSTR version; + + HKEY regroot; + WCHAR regkey[MAX_STRING_LEN]; + + struct APPINFO *next; +} APPINFO; + +static struct APPINFO *AppInfo = NULL; static HINSTANCE hInst; +/* names of registry keys */ +static const WCHAR BackSlashW[] = { '\\', 0 }; +static const WCHAR DisplayNameW[] = {'D','i','s','p','l','a','y','N','a','m','e',0}; +static const WCHAR DisplayIconW[] = {'D','i','s','p','l','a','y','I','c','o','n',0}; +static const WCHAR DisplayVersionW[] = {'D','i','s','p','l','a','y','V','e','r', + 's','i','o','n',0}; +static const WCHAR PublisherW[] = {'P','u','b','l','i','s','h','e','r',0}; +static const WCHAR UninstallCommandlineW[] = {'U','n','i','n','s','t','a','l','l', + 'S','t','r','i','n','g',0}; + +static const WCHAR PathUninstallW[] = { + 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','d','o','w','s','\\', + 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', + 'U','n','i','n','s','t','a','l','l',0 }; + /****************************************************************************** * Name : DllMain * Description: Entry point for DLL file @@ -69,6 +105,205 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, } /****************************************************************************** + * Name : FreeAppInfo + * Description: Frees memory used by an AppInfo structure, and any children. + */ +static void FreeAppInfo(APPINFO *info) +{ + APPINFO *iter = info; + + while (iter) + { + if (iter->title) + HeapFree(GetProcessHeap(), 0, iter->title); + + if (iter->path) + HeapFree(GetProcessHeap(), 0, iter->path); + + if (iter->icon) + HeapFree(GetProcessHeap(), 0, iter->icon); + + if (iter->publisher) + HeapFree(GetProcessHeap(), 0, iter->publisher); + + if (iter->version) + HeapFree(GetProcessHeap(), 0, iter->version); + + iter = iter->next; + HeapFree(GetProcessHeap(), 0, iter); + } +} + +/****************************************************************************** + * Name : ReadApplicationsFromRegistry + * Description: Creates a linked list of uninstallable applications from the + * registry. + * Parameters : root - Which registry root to read from (HKCU/HKLM) + * Returns : TRUE if successful, FALSE otherwise + */ +static BOOL ReadApplicationsFromRegistry(HKEY root) +{ + HKEY hkeyUninst, hkeyApp; + int i, id = 0; + DWORD sizeOfSubKeyName, displen, uninstlen; + WCHAR subKeyName[256]; + WCHAR key_app[MAX_STRING_LEN]; + WCHAR *p; + APPINFO *iter = AppInfo; + LPWSTR iconPtr; + BOOL ret = FALSE; + + if (RegOpenKeyExW(root, PathUninstallW, 0, KEY_READ, &hkeyUninst) != + ERROR_SUCCESS) + return FALSE; + + lstrcpyW(key_app, PathUninstallW); + lstrcatW(key_app, BackSlashW); + p = key_app+lstrlenW(PathUninstallW)+1; + + sizeOfSubKeyName = sizeof(subKeyName) / sizeof(subKeyName[0]); + + if (iter) + { + /* find the end of the list */ + for (iter = AppInfo; iter->next; iter = iter->next); + } + + for (i = 0; RegEnumKeyExW(hkeyUninst, i, subKeyName, &sizeOfSubKeyName, NULL, + NULL, NULL, NULL) != ERROR_NO_MORE_ITEMS; ++i) + { + lstrcpyW(p, subKeyName); + RegOpenKeyExW(root, key_app, 0, KEY_READ, &hkeyApp); + + displen = 0; + uninstlen = 0; + + if ((RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, NULL, &displen) == + ERROR_SUCCESS) && (RegQueryValueExW(hkeyApp, UninstallCommandlineW, + 0, 0, NULL, &uninstlen) == ERROR_SUCCESS)) + { + /* if we already have iter, allocate the next entry */ + if (iter) + { + iter->next = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(struct APPINFO)); + + if (!iter->next) + goto err; + + iter = iter->next; + } + else + { + /* if not, start the list */ + iter = AppInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(struct APPINFO)); + + if (!iter) + goto err; + } + + iter->title = HeapAlloc(GetProcessHeap(), 0, displen); + + if (!iter->title) + goto err; + + RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, (LPBYTE)iter->title, + &displen); + + /* now get DisplayIcon */ + displen = 0; + RegQueryValueExW(hkeyApp, DisplayIconW, 0, 0, NULL, &displen); + + if (displen == 0) + iter->icon = 0; + else + { + iter->icon = HeapAlloc(GetProcessHeap(), 0, displen); + + if (!iter->icon) + goto err; + + RegQueryValueExW(hkeyApp, DisplayIconW, 0, 0, (LPBYTE)iter->icon, + &displen); + + /* separate the index from the icon name, if supplied */ + iconPtr = strchrW(iter->icon, ','); + + if (iconPtr) + { + *iconPtr++ = 0; + iter->iconIdx = atoiW(iconPtr); + } + } + + iter->path = HeapAlloc(GetProcessHeap(), 0, uninstlen); + + if (!iter->path) + goto err; + + RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, + (LPBYTE)iter->path, &uninstlen); + + /* publisher, version */ + if (RegQueryValueExW(hkeyApp, PublisherW, 0, 0, NULL, &displen) == + ERROR_SUCCESS) + { + iter->publisher = HeapAlloc(GetProcessHeap(), 0, displen); + + if (!iter->publisher) + goto err; + + RegQueryValueExW(hkeyApp, PublisherW, 0, 0, (LPBYTE)iter->publisher, + &displen); + } + + if (RegQueryValueExW(hkeyApp, DisplayVersionW, 0, 0, NULL, &displen) == + ERROR_SUCCESS) + { + iter->version = HeapAlloc(GetProcessHeap(), 0, displen); + + if (!iter->version) + goto err; + + RegQueryValueExW(hkeyApp, DisplayVersionW, 0, 0, (LPBYTE)iter->version, + &displen); + } + + /* registry key */ + iter->regroot = root; + lstrcpyW(iter->regkey, subKeyName); + + iter->id = id++; + } + + RegCloseKey(hkeyApp); + sizeOfSubKeyName = sizeof(subKeyName) / sizeof(subKeyName[0]); + } + + ret = TRUE; + goto end; + +err: + RegCloseKey(hkeyApp); + FreeAppInfo(iter); + +end: + RegCloseKey(hkeyUninst); + return ret; +} + +/****************************************************************************** + * Name : EmptyList + * Description: Frees memory used by the application linked list. + */ +static inline void EmptyList(void) +{ + FreeAppInfo(AppInfo); + AppInfo = NULL; +} + +/****************************************************************************** * Name : UpdateButtons * Description: Enables/disables the Add/Remove button depending on current * selection in list box. @@ -175,11 +410,18 @@ static HIMAGELIST ResetApplicationList(BOOL bFirstRun, HWND hWnd, HIMAGELIST hIm else /* we need to remove the existing things first */ { ImageList_Destroy(hImageList); + + /* reset the list, since it's probably changed if the uninstallation was + successful */ + EmptyList(); } /* now create the image list and add the applications to the listview */ hImageList = AddListViewImageList(hWndListView); + ReadApplicationsFromRegistry(HKEY_LOCAL_MACHINE); + ReadApplicationsFromRegistry(HKEY_CURRENT_USER); + UpdateButtons(hWnd); return(hImageList); @@ -211,6 +453,8 @@ static BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_DESTROY: ImageList_Destroy(hImageList); + EmptyList(); + return 0; }
1
0
0
0
Owen Rudge : appwiz.cpl: Check to see if buttons should be enabled.
by Alexandre Julliard
25 Jul '08
25 Jul '08
Module: wine Branch: master Commit: d8d725f73f5594cc95942ed48b2357dd6bf814ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d8d725f73f5594cc95942ed48…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Mon Jul 21 19:42:21 2008 +0100 appwiz.cpl: Check to see if buttons should be enabled. --- dlls/appwiz.cpl/appwiz.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c index 6f3a083..4bf86a9 100644 --- a/dlls/appwiz.cpl/appwiz.c +++ b/dlls/appwiz.cpl/appwiz.c @@ -68,6 +68,20 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, return TRUE; } +/****************************************************************************** + * Name : UpdateButtons + * Description: Enables/disables the Add/Remove button depending on current + * selection in list box. + * Parameters : hWnd - Handle of the dialog box + */ +static void UpdateButtons(HWND hWnd) +{ + BOOL sel = ListView_GetSelectedCount(GetDlgItem(hWnd, IDL_PROGRAMS)) != 0; + + EnableWindow(GetDlgItem(hWnd, IDC_ADDREMOVE), sel); + EnableWindow(GetDlgItem(hWnd, IDC_SUPPORT_INFO), sel); +} + /* Definition of column headers for AddListViewColumns function */ typedef struct AppWizColumn { int width; @@ -166,6 +180,8 @@ static HIMAGELIST ResetApplicationList(BOOL bFirstRun, HWND hWnd, HIMAGELIST hIm /* now create the image list and add the applications to the listview */ hImageList = AddListViewImageList(hWndListView); + UpdateButtons(hWnd); + return(hImageList); }
1
0
0
0
Owen Rudge : appwiz.cpl: Add imagelist for listview.
by Alexandre Julliard
25 Jul '08
25 Jul '08
Module: wine Branch: master Commit: 76518c0883f76ed288750e2f493d5f07046a568c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=76518c0883f76ed288750e2f4…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Mon Jul 21 19:42:16 2008 +0100 appwiz.cpl: Add imagelist for listview. --- dlls/appwiz.cpl/appwiz.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c index b07c2a7..6f3a083 100644 --- a/dlls/appwiz.cpl/appwiz.c +++ b/dlls/appwiz.cpl/appwiz.c @@ -115,6 +115,30 @@ static BOOL AddListViewColumns(HWND hWnd) } /****************************************************************************** + * Name : AddListViewImageList + * Description: Creates an ImageList for the list view control. + * Parameters : hWnd - Handle of the list view control. + * Returns : Handle of the image list. + */ +static HIMAGELIST AddListViewImageList(HWND hWnd) +{ + HIMAGELIST hSmall; + HICON hDefaultIcon; + + hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), + ILC_MASK, 1, 1); + + /* Add default icon to image list */ + hDefaultIcon = LoadIconW(hInst, MAKEINTRESOURCEW(ICO_MAIN)); + ImageList_AddIcon(hSmall, hDefaultIcon); + DestroyIcon(hDefaultIcon); + + (void) ListView_SetImageList(hWnd, hSmall, LVSIL_SMALL); + + return hSmall; +} + +/****************************************************************************** * Name : ResetApplicationList * Description: Empties the app list, if need be, and recreates it. * Parameters : bFirstRun - TRUE if this is the first time this is run, FALSE otherwise @@ -134,6 +158,13 @@ static HIMAGELIST ResetApplicationList(BOOL bFirstRun, HWND hWnd, HIMAGELIST hIm if (!AddListViewColumns(hWndListView)) return NULL; } + else /* we need to remove the existing things first */ + { + ImageList_Destroy(hImageList); + } + + /* now create the image list and add the applications to the listview */ + hImageList = AddListViewImageList(hWndListView); return(hImageList); } @@ -156,7 +187,15 @@ static BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_INITDIALOG: hImageList = ResetApplicationList(TRUE, hWnd, hImageList); + if (!hImageList) + return FALSE; + return TRUE; + + case WM_DESTROY: + ImageList_Destroy(hImageList); + + return 0; } return FALSE;
1
0
0
0
Owen Rudge : appwiz.cpl: Add column headers to listview.
by Alexandre Julliard
25 Jul '08
25 Jul '08
Module: wine Branch: master Commit: 2812a9ecefb547b931c8b953934fe86ab5335f5c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2812a9ecefb547b931c8b9539…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Mon Jul 21 19:42:12 2008 +0100 appwiz.cpl: Add column headers to listview. --- dlls/appwiz.cpl/En.rc | 4 ++ dlls/appwiz.cpl/appwiz.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/appwiz.cpl/res.h | 3 ++ 3 files changed, 87 insertions(+), 0 deletions(-) diff --git a/dlls/appwiz.cpl/En.rc b/dlls/appwiz.cpl/En.rc index ad477e3..1abc788 100644 --- a/dlls/appwiz.cpl/En.rc +++ b/dlls/appwiz.cpl/En.rc @@ -26,6 +26,10 @@ STRINGTABLE IDS_CPL_TITLE, "Add/Remove Programs" IDS_CPL_DESC, "Allows you to install new software, or remove existing software from your computer." IDS_TAB1_TITLE, "Applications" + + IDS_COLUMN_NAME, "Name" + IDS_COLUMN_PUBLISHER, "Publisher" + IDS_COLUMN_VERSION, "Version" } /* TODO: it's best to use the constant WC_LISTVIEW instead of SysListView32 directly, but the Wine resource compiler doesn't seem to like that... */ diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c index fd06371..b07c2a7 100644 --- a/dlls/appwiz.cpl/appwiz.c +++ b/dlls/appwiz.cpl/appwiz.c @@ -68,6 +68,76 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, return TRUE; } +/* Definition of column headers for AddListViewColumns function */ +typedef struct AppWizColumn { + int width; + int fmt; + int title; +} AppWizColumn; + +AppWizColumn columns[] = { + {200, LVCFMT_LEFT, IDS_COLUMN_NAME}, + {150, LVCFMT_LEFT, IDS_COLUMN_PUBLISHER}, + {100, LVCFMT_LEFT, IDS_COLUMN_VERSION}, +}; + +/****************************************************************************** + * Name : AddListViewColumns + * Description: Adds column headers to the list view control. + * Parameters : hWnd - Handle of the list view control. + * Returns : TRUE if completed successfully, FALSE otherwise. + */ +static BOOL AddListViewColumns(HWND hWnd) +{ + WCHAR buf[MAX_STRING_LEN]; + LVCOLUMNW lvc; + int i; + + lvc.mask = LVCF_FMT | LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH; + + /* Add the columns */ + for (i = 0; i < sizeof(columns) / sizeof(columns[0]); i++) + { + lvc.iSubItem = i; + lvc.pszText = buf; + + /* set width and format */ + lvc.cx = columns[i].width; + lvc.fmt = columns[i].fmt; + + LoadStringW(hInst, columns[i].title, buf, sizeof(buf) / sizeof(buf[0])); + + if (ListView_InsertColumnW(hWnd, i, &lvc) == -1) + return FALSE; + } + + return TRUE; +} + +/****************************************************************************** + * Name : ResetApplicationList + * Description: Empties the app list, if need be, and recreates it. + * Parameters : bFirstRun - TRUE if this is the first time this is run, FALSE otherwise + * hWnd - handle of the dialog box + * hImageList - handle of the image list + * Returns : New handle of the image list. + */ +static HIMAGELIST ResetApplicationList(BOOL bFirstRun, HWND hWnd, HIMAGELIST hImageList) +{ + HWND hWndListView; + + hWndListView = GetDlgItem(hWnd, IDL_PROGRAMS); + + /* if first run, create the image list and add the listview columns */ + if (bFirstRun) + { + if (!AddListViewColumns(hWndListView)) + return NULL; + } + + return(hImageList); +} + /****************************************************************************** * Name : MainDlgProc * Description: Callback procedure for main tab @@ -79,6 +149,16 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, */ static BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { + static HIMAGELIST hImageList; + + switch(msg) + { + case WM_INITDIALOG: + hImageList = ResetApplicationList(TRUE, hWnd, hImageList); + + return TRUE; + } + return FALSE; } diff --git a/dlls/appwiz.cpl/res.h b/dlls/appwiz.cpl/res.h index ff23bcb..64b4a5b 100644 --- a/dlls/appwiz.cpl/res.h +++ b/dlls/appwiz.cpl/res.h @@ -38,3 +38,6 @@ #define IDS_CPL_TITLE 1 #define IDS_CPL_DESC 2 #define IDS_TAB1_TITLE 3 +#define IDS_COLUMN_NAME 6 +#define IDS_COLUMN_PUBLISHER 7 +#define IDS_COLUMN_VERSION 8
1
0
0
0
Owen Rudge : appwiz.cpl: Display Add/Remove Programs dialog.
by Alexandre Julliard
25 Jul '08
25 Jul '08
Module: wine Branch: master Commit: 6d4f3d5d3ab51d551bbab6d8ef6df869e3bf67db URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6d4f3d5d3ab51d551bbab6d8e…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Mon Jul 21 19:42:07 2008 +0100 appwiz.cpl: Display Add/Remove Programs dialog. --- dlls/appwiz.cpl/En.rc | 18 ++++++++++++ dlls/appwiz.cpl/appwiz.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/appwiz.cpl/res.h | 11 +++++++ 3 files changed, 99 insertions(+), 0 deletions(-) diff --git a/dlls/appwiz.cpl/En.rc b/dlls/appwiz.cpl/En.rc index 240793b..ad477e3 100644 --- a/dlls/appwiz.cpl/En.rc +++ b/dlls/appwiz.cpl/En.rc @@ -27,3 +27,21 @@ STRINGTABLE IDS_CPL_DESC, "Allows you to install new software, or remove existing software from your computer." IDS_TAB1_TITLE, "Applications" } + +/* TODO: it's best to use the constant WC_LISTVIEW instead of SysListView32 directly, but the Wine resource compiler doesn't seem to like that... */ + +IDD_MAIN DIALOG 0, 0, 320, 220 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Install/Uninstall" +FONT 8, "MS Sans Serif" +{ + CONTROL "To install a new program from a floppy disk, CD-ROM drive, or your hard drive, click Install.", 1000, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 7, 270, 20 + CONTROL "&Install...", IDC_INSTALL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 26, 64, 14 + CONTROL "", -1, "STATIC", SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE, 7, 46, 303, 1 + CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 + CONTROL "The following software can be automatically removed. To remove a program or to modify its installed components, select it from the list and click Add/Remove.", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 36 + CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 + CONTROL "Add/&Remove...", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 198, 64, 14 + CONTROL "&Support Info...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 198, 64, 14 + CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 +} diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c index 76658de..fd06371 100644 --- a/dlls/appwiz.cpl/appwiz.c +++ b/dlls/appwiz.cpl/appwiz.c @@ -38,12 +38,16 @@ #include <wingdi.h> #include <winreg.h> #include <shellapi.h> +#include <commctrl.h> #include <cpl.h> #include "res.h" WINE_DEFAULT_DEBUG_CHANNEL(appwizcpl); +/* define a maximum length for various buffers we use */ +#define MAX_STRING_LEN 1024 + static HINSTANCE hInst; /****************************************************************************** @@ -65,6 +69,61 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, } /****************************************************************************** + * Name : MainDlgProc + * Description: Callback procedure for main tab + * Parameters : hWnd - hWnd of the window + * msg - reason for calling function + * wParam - additional parameter + * lParam - additional parameter + * Returns : Dependant on message + */ +static BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + return FALSE; +} + +/****************************************************************************** + * Name : StartApplet + * Description: Main routine for applet + * Parameters : hWnd - hWnd of the Control Panel + */ +static void StartApplet(HWND hWnd) +{ + PROPSHEETPAGEW psp; + PROPSHEETHEADERW psh; + WCHAR tab_title[MAX_STRING_LEN], app_title[MAX_STRING_LEN]; + + /* Load the strings we will use */ + LoadStringW(hInst, IDS_TAB1_TITLE, tab_title, sizeof(tab_title) / sizeof(tab_title[0])); + LoadStringW(hInst, IDS_CPL_TITLE, app_title, sizeof(app_title) / sizeof(app_title[0])); + + /* Fill out the PROPSHEETPAGE */ + psp.dwSize = sizeof (PROPSHEETPAGEW); + psp.dwFlags = PSP_USETITLE; + psp.hInstance = hInst; + psp.pszTemplate = MAKEINTRESOURCEW (IDD_MAIN); + psp.pszIcon = NULL; + psp.pfnDlgProc = (DLGPROC) MainDlgProc; + psp.pszTitle = tab_title; + psp.lParam = 0; + + /* Fill out the PROPSHEETHEADER */ + psh.dwSize = sizeof (PROPSHEETHEADERW); + psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID; + psh.hwndParent = hWnd; + psh.hInstance = hInst; + psh.pszIcon = NULL; + psh.pszCaption = app_title; + psh.nPages = 1; + psh.ppsp = &psp; + psh.pfnCallback = NULL; + psh.nStartPage = 0; + + /* Display the property sheet */ + PropertySheetW (&psh); +} + +/****************************************************************************** * Name : CPlApplet * Description: Entry point for Control Panel applets * Parameters : hwndCPL - hWnd of the Control Panel @@ -75,9 +134,16 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, */ LONG CALLBACK CPlApplet(HWND hwndCPL, UINT message, LPARAM lParam1, LPARAM lParam2) { + INITCOMMONCONTROLSEX iccEx; + switch (message) { case CPL_INIT: + iccEx.dwSize = sizeof(iccEx); + iccEx.dwICC = ICC_LISTVIEW_CLASSES | ICC_TAB_CLASSES; + + InitCommonControlsEx(&iccEx); + return TRUE; case CPL_GETCOUNT: @@ -94,6 +160,10 @@ LONG CALLBACK CPlApplet(HWND hwndCPL, UINT message, LPARAM lParam1, LPARAM lPara break; } + + case CPL_DBLCLK: + StartApplet(hwndCPL); + break; } return FALSE; diff --git a/dlls/appwiz.cpl/res.h b/dlls/appwiz.cpl/res.h index 513c322..ff23bcb 100644 --- a/dlls/appwiz.cpl/res.h +++ b/dlls/appwiz.cpl/res.h @@ -19,6 +19,17 @@ * */ +/* Dialogs */ + +#define IDD_MAIN 1 +#define IDD_INFO 2 + +/* Dialog controls */ +#define IDC_INSTALL 1010 +#define IDL_PROGRAMS 1011 +#define IDC_ADDREMOVE 1012 +#define IDC_SUPPORT_INFO 1013 + /* Icons */ #define ICO_MAIN 1
1
0
0
0
Owen Rudge : appwiz.cpl: Add skeleton Add/Remove Programs control panel.
by Alexandre Julliard
25 Jul '08
25 Jul '08
Module: wine Branch: master Commit: f4e6489edbcbab768277f4fea7f2b639f053783c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4e6489edbcbab768277f4fea…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Thu Jul 24 21:57:28 2008 +0100 appwiz.cpl: Add skeleton Add/Remove Programs control panel. --- Makefile.in | 2 + configure | 3 + configure.ac | 1 + dlls/Makefile.in | 1 + dlls/appwiz.cpl/En.rc | 29 +++++++++++ dlls/appwiz.cpl/Makefile.in | 15 ++++++ dlls/appwiz.cpl/appwiz.c | 100 +++++++++++++++++++++++++++++++++++++++ dlls/appwiz.cpl/appwiz.cpl.spec | 1 + dlls/appwiz.cpl/appwiz.ico | Bin 0 -> 766 bytes dlls/appwiz.cpl/appwiz.rc | 32 ++++++++++++ dlls/appwiz.cpl/res.h | 29 +++++++++++ tools/wine.inf.in | 1 + 12 files changed, 214 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f4e6489edbcbab768277f…
1
0
0
0
Owen Rudge : shell32: Add status bar to control panel.
by Alexandre Julliard
25 Jul '08
25 Jul '08
Module: wine Branch: master Commit: 5800539bb68282e406ea0ad090a08714f1adfd1a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5800539bb68282e406ea0ad09…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Thu Jul 24 22:10:41 2008 +0100 shell32: Add status bar to control panel. --- dlls/shell32/control.c | 70 +++++++++++++++++++++++++++++++++++++++++++----- dlls/shell32/cpanel.h | 1 + 2 files changed, 64 insertions(+), 7 deletions(-) diff --git a/dlls/shell32/control.c b/dlls/shell32/control.c index 89a790a..642e611 100644 --- a/dlls/shell32/control.c +++ b/dlls/shell32/control.c @@ -166,6 +166,7 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel) } #define IDC_LISTVIEW 1000 +#define IDC_STATUSBAR 1001 #define NUM_COLUMNS 2 #define LISTVIEW_DEFSTYLE (WS_CHILD | WS_VISIBLE | WS_TABSTOP |\ @@ -173,18 +174,20 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel) static BOOL Control_CreateListView (CPanel *panel) { - RECT ws; + RECT ws, sb; WCHAR empty_string[] = {0}; WCHAR buf[MAX_STRING_LEN]; LVCOLUMNW lvc; /* Create list view */ + GetClientRect(panel->hWndStatusBar, &sb); GetClientRect(panel->hWnd, &ws); panel->hWndListView = CreateWindowExW(WS_EX_CLIENTEDGE, WC_LISTVIEWW, empty_string, LISTVIEW_DEFSTYLE | LVS_ICON, - 0, 0, ws.right - ws.left, ws.bottom - ws.top, - panel->hWnd, (HMENU) IDC_LISTVIEW, panel->hInst, NULL); + 0, 0, ws.right - ws.left, ws.bottom - ws.top - + (sb.bottom - sb.top), panel->hWnd, + (HMENU) IDC_LISTVIEW, panel->hInst, NULL); if (!panel->hWndListView) return FALSE; @@ -233,15 +236,23 @@ static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW* cs) CPlItem *item; LVITEMW lvItem; INITCOMMONCONTROLSEX icex; + INT sb_parts; SetWindowLongPtrW(hWnd, 0, (LONG_PTR)panel); panel->hWnd = hWnd; /* Initialise common control DLL */ icex.dwSize = sizeof(INITCOMMONCONTROLSEX); - icex.dwICC = ICC_LISTVIEW_CLASSES; + icex.dwICC = ICC_LISTVIEW_CLASSES | ICC_BAR_CLASSES; InitCommonControlsEx(&icex); + /* create the status bar */ + if (!(panel->hWndStatusBar = CreateStatusWindowW(WS_CHILD | WS_VISIBLE | CCS_BOTTOM | SBARS_SIZEGRIP, NULL, hWnd, IDC_STATUSBAR))) + return; + + sb_parts = -1; + SendMessageW(panel->hWndStatusBar, SB_SETPARTS, 1, (LPARAM) &sb_parts); + /* create the list view */ if (!Control_CreateListView(panel)) return; @@ -491,6 +502,17 @@ static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg, return 0; } + case LVN_ITEMCHANGED: + { + CPlItem *item = Control_GetCPlItem_From_ListView(panel); + + /* update the status bar if item is valid */ + if (item) + SetWindowTextW(panel->hWndStatusBar, + item->applet->info[item->id].szInfo); + + return 0; + } } break; @@ -499,12 +521,46 @@ static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg, break; } + case WM_MENUSELECT: + /* check if this is an applet */ + if ((LOWORD(lParam1) >= IDM_CPANEL_APPLET_BASE) && + (LOWORD(lParam1) <= IDM_CPANEL_APPLET_BASE + panel->total_subprogs)) + { + CPlItem *item = Control_GetCPlItem_From_MenuID(hWnd, LOWORD(lParam1)); + + /* update the status bar if item is valid */ + if (item) + SetWindowTextW(panel->hWndStatusBar, item->applet->info[item->id].szInfo); + } + else + SetWindowTextW(panel->hWndStatusBar, NULL); + + return 0; + case WM_SIZE: { - RECT rect; + HDWP hdwp; + RECT sb; + + hdwp = BeginDeferWindowPos(2); + + if (hdwp == NULL) + break; + + GetClientRect(panel->hWndStatusBar, &sb); + + hdwp = DeferWindowPos(hdwp, panel->hWndListView, NULL, 0, 0, + LOWORD(lParam2), HIWORD(lParam2) - (sb.bottom - sb.top), + SWP_NOZORDER | SWP_NOMOVE); + + if (hdwp == NULL) + break; + + hdwp = DeferWindowPos(hdwp, panel->hWndStatusBar, NULL, 0, 0, + LOWORD(lParam2), LOWORD(lParam1), SWP_NOZORDER | SWP_NOMOVE); - GetClientRect(hWnd, &rect); - MoveWindow(panel->hWndListView, 0, 0, rect.right, rect.bottom, TRUE); + if (hdwp != NULL) + EndDeferWindowPos(hdwp); return 0; } diff --git a/dlls/shell32/cpanel.h b/dlls/shell32/cpanel.h index b52ad97..23ec5e5 100644 --- a/dlls/shell32/cpanel.h +++ b/dlls/shell32/cpanel.h @@ -41,6 +41,7 @@ typedef struct CPanel { HWND hWndListView; HIMAGELIST hImageListLarge; HIMAGELIST hImageListSmall; + HWND hWndStatusBar; } CPanel; /* structure to reference an individual control panel item */
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
112
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Results per page:
10
25
50
100
200