Juan Lang : cryptui: Refresh cert view when purpose selection is changed in the certificate manager dialog .

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


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Wed Jan  7 17:01:40 2009 -0800

cryptui: Refresh cert view when purpose selection is changed in the certificate manager dialog.

---

 dlls/cryptui/main.c |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c
index e5c5857..68fed92 100644
--- a/dlls/cryptui/main.c
+++ b/dlls/cryptui/main.c
@@ -636,8 +636,33 @@ static LRESULT CALLBACK cert_mgr_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
             refresh_store_certs(hwnd);
             break;
         case IDC_MGR_ADVANCED:
-            DialogBoxW(hInstance, MAKEINTRESOURCEW(IDD_CERT_MGR_ADVANCED), hwnd,
-             cert_mgr_advanced_dlg_proc);
+            if (DialogBoxW(hInstance, MAKEINTRESOURCEW(IDD_CERT_MGR_ADVANCED),
+             hwnd, cert_mgr_advanced_dlg_proc) == IDOK)
+            {
+                HWND cb = GetDlgItem(hwnd, IDC_MGR_PURPOSE_SELECTION);
+                int index, len;
+                LPWSTR curString = NULL;
+
+                index = SendMessageW(cb, CB_GETCURSEL, 0, 0);
+                if (index >= 0)
+                {
+                    len = SendMessageW(cb, CB_GETLBTEXTLEN, index, 0);
+                    curString = HeapAlloc(GetProcessHeap(), 0,
+                     (len + 1) * sizeof(WCHAR));
+                    SendMessageW(cb, CB_GETLBTEXT, index, (LPARAM)curString);
+                }
+                SendMessageW(cb, CB_RESETCONTENT, 0, 0);
+                initialize_purpose_selection(hwnd);
+                if (curString)
+                {
+                    index = SendMessageW(cb, CB_FINDSTRINGEXACT, -1,
+                     (LPARAM)curString);
+                    if (index >= 0)
+                        SendMessageW(cb, CB_SETCURSEL, index, 0);
+                    HeapFree(GetProcessHeap(), 0, curString);
+                }
+                refresh_store_certs(hwnd);
+            }
             break;
         case IDCANCEL:
             free_certs(GetDlgItem(hwnd, IDC_MGR_CERTS));




More information about the wine-cvs mailing list