appwiz.cpl: Display Add/Remove Programs dialog.

This commit is contained in:
Owen Rudge 2008-07-21 19:42:07 +01:00 committed by Alexandre Julliard
parent f4e6489edb
commit 6d4f3d5d3a
3 changed files with 99 additions and 0 deletions

View File

@ -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
}

View File

@ -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;
/******************************************************************************
@ -64,6 +68,61 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
return TRUE;
}
/******************************************************************************
* 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
@ -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;

View File

@ -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