Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0215b55c
Commit
0215b55c
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 applications to list, remove on window close.
parent
c16aeaf8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
appwiz.c
dlls/appwiz.cpl/appwiz.c
+75
-0
No files found.
dlls/appwiz.cpl/appwiz.c
View file @
0215b55c
...
...
@@ -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
;
...
...
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