Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2812a9ec
Commit
2812a9ec
authored
Jul 21, 2008
by
Owen Rudge
Committed by
Alexandre Julliard
Jul 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
appwiz.cpl: Add column headers to listview.
parent
6d4f3d5d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
0 deletions
+87
-0
En.rc
dlls/appwiz.cpl/En.rc
+4
-0
appwiz.c
dlls/appwiz.cpl/appwiz.c
+80
-0
res.h
dlls/appwiz.cpl/res.h
+3
-0
No files found.
dlls/appwiz.cpl/En.rc
View file @
2812a9ec
...
...
@@ -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... */
...
...
dlls/appwiz.cpl/appwiz.c
View file @
2812a9ec
...
...
@@ -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
;
}
...
...
dlls/appwiz.cpl/res.h
View file @
2812a9ec
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment