appwiz.cpl: Add basic Support Information dialog.

This commit is contained in:
Owen Rudge 2008-07-21 19:44:02 +01:00 committed by Alexandre Julliard
parent eece76b8b3
commit d508a58caf
3 changed files with 117 additions and 0 deletions

View File

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

View File

@ -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;
@ -608,6 +674,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;
}

View File

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