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
3a7d3fcc
Commit
3a7d3fcc
authored
Oct 26, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Oct 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptui: Support sorting columns by clicking on their headers.
parent
9d62f475
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
main.c
dlls/cryptui/main.c
+72
-0
No files found.
dlls/cryptui/main.c
View file @
3a7d3fcc
...
...
@@ -1062,6 +1062,49 @@ static void cert_mgr_do_export(HWND hwnd)
}
}
static
int
CALLBACK
cert_mgr_sort_by_text
(
HWND
lv
,
int
col
,
int
index1
,
int
index2
)
{
LVITEMW
item
;
WCHAR
buf1
[
MAX_STRING_LEN
];
WCHAR
buf2
[
MAX_STRING_LEN
];
item
.
cchTextMax
=
sizeof
(
buf1
)
/
sizeof
(
buf1
[
0
]);
item
.
mask
=
LVIF_TEXT
;
item
.
pszText
=
buf1
;
item
.
iItem
=
index1
;
item
.
iSubItem
=
col
;
SendMessageW
(
lv
,
LVM_GETITEMW
,
0
,
(
LPARAM
)
&
item
);
item
.
pszText
=
buf2
;
item
.
iItem
=
index2
;
SendMessageW
(
lv
,
LVM_GETITEMW
,
0
,
(
LPARAM
)
&
item
);
return
strcmpW
(
buf1
,
buf2
);
}
static
int
CALLBACK
cert_mgr_sort_by_subject
(
LPARAM
lp1
,
LPARAM
lp2
,
LPARAM
lp
)
{
return
cert_mgr_sort_by_text
((
HWND
)
lp
,
0
,
lp1
,
lp2
);
}
static
int
CALLBACK
cert_mgr_sort_by_issuer
(
LPARAM
lp1
,
LPARAM
lp2
,
LPARAM
lp
)
{
return
cert_mgr_sort_by_text
((
HWND
)
lp
,
1
,
lp1
,
lp2
);
}
static
int
CALLBACK
cert_mgr_sort_by_date
(
LPARAM
lp1
,
LPARAM
lp2
,
LPARAM
lp
)
{
PCCERT_CONTEXT
cert1
=
(
PCCERT_CONTEXT
)
lp1
;
PCCERT_CONTEXT
cert2
=
(
PCCERT_CONTEXT
)
lp2
;
return
CompareFileTime
(
&
cert1
->
pCertInfo
->
NotAfter
,
&
cert2
->
pCertInfo
->
NotAfter
);
}
static
int
CALLBACK
cert_mgr_sort_by_friendly_name
(
LPARAM
lp1
,
LPARAM
lp2
,
LPARAM
lp
)
{
return
cert_mgr_sort_by_text
((
HWND
)
lp
,
3
,
lp1
,
lp2
);
}
static
LRESULT
CALLBACK
cert_mgr_dlg_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
...
...
@@ -1141,6 +1184,35 @@ static LRESULT CALLBACK cert_mgr_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
cert_mgr_do_remove
(
hwnd
);
break
;
}
case
LVN_COLUMNCLICK
:
{
NMLISTVIEW
*
nmlv
=
(
NMLISTVIEW
*
)
lp
;
HWND
lv
=
GetDlgItem
(
hwnd
,
IDC_MGR_CERTS
);
/* FIXME: doesn't support swapping sort order between ascending
* and descending.
*/
switch
(
nmlv
->
iSubItem
)
{
case
0
:
SendMessageW
(
lv
,
LVM_SORTITEMSEX
,
(
WPARAM
)
lv
,
(
LPARAM
)
cert_mgr_sort_by_subject
);
break
;
case
1
:
SendMessageW
(
lv
,
LVM_SORTITEMSEX
,
(
WPARAM
)
lv
,
(
LPARAM
)
cert_mgr_sort_by_issuer
);
break
;
case
2
:
SendMessageW
(
lv
,
LVM_SORTITEMS
,
0
,
(
LPARAM
)
cert_mgr_sort_by_date
);
break
;
case
3
:
SendMessageW
(
lv
,
LVM_SORTITEMSEX
,
(
WPARAM
)
lv
,
(
LPARAM
)
cert_mgr_sort_by_friendly_name
);
break
;
}
break
;
}
}
break
;
}
...
...
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