Commit be1587ca authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

cryptui: Refresh store display when a tab is switched or the purpose selection…

cryptui: Refresh store display when a tab is switched or the purpose selection is changed in the certificate manager dialog.
parent 29dcd605
......@@ -274,6 +274,13 @@ static HCERTSTORE cert_mgr_index_to_store(HWND tab, int index)
return (HCERTSTORE)item.lParam;
}
static HCERTSTORE cert_mgr_current_store(HWND hwnd)
{
HWND tab = GetDlgItem(hwnd, IDC_MGR_STORES);
return cert_mgr_index_to_store(tab, SendMessageW(tab, TCM_GETCURSEL, 0, 0));
}
static void close_stores(HWND tab)
{
int i, tabs = SendMessageW(tab, TCM_GETITEMCOUNT, 0, 0);
......@@ -282,6 +289,15 @@ static void close_stores(HWND tab)
CertCloseStore(cert_mgr_index_to_store(tab, i), 0);
}
static void refresh_store_certs(HWND hwnd)
{
HWND lv = GetDlgItem(hwnd, IDC_MGR_CERTS);
free_certs(lv);
SendMessageW(lv, LVM_DELETEALLITEMS, 0, 0);
show_store_certs(hwnd, cert_mgr_current_store(hwnd));
}
static LRESULT CALLBACK cert_mgr_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
LPARAM lp)
{
......@@ -317,9 +333,24 @@ static LRESULT CALLBACK cert_mgr_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
show_store_certs(hwnd, cert_mgr_index_to_store(tab, 0));
break;
}
case WM_NOTIFY:
{
NMHDR *hdr = (NMHDR *)lp;
switch (hdr->code)
{
case TCN_SELCHANGE:
refresh_store_certs(hwnd);
break;
}
break;
}
case WM_COMMAND:
switch (wp)
{
case ((CBN_SELCHANGE << 16) | IDC_MGR_PURPOSE_SELECTION):
refresh_store_certs(hwnd);
break;
case IDCANCEL:
free_certs(GetDlgItem(hwnd, IDC_MGR_CERTS));
close_stores(GetDlgItem(hwnd, IDC_MGR_STORES));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment