Juan Lang : cryptui: Refresh store display when a tab is switched or the purpose selection is changed in the certificate manager dialog .

Alexandre Julliard julliard at winehq.org
Fri Jan 9 09:52:29 CST 2009


Module: wine
Branch: master
Commit: be1587ca50a70a163e0a3207123693965a782b0f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=be1587ca50a70a163e0a3207123693965a782b0f

Author: Juan Lang <juan.lang at gmail.com>
Date:   Wed Jan  7 16:29:19 2009 -0800

cryptui: Refresh store display when a tab is switched or the purpose selection is changed in the certificate manager dialog.

---

 dlls/cryptui/main.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c
index 8a84c34..9f156c4 100644
--- a/dlls/cryptui/main.c
+++ b/dlls/cryptui/main.c
@@ -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));




More information about the wine-cvs mailing list