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

cryptui: Toggle a usage when it's clicked.

parent a958c27c
...@@ -1967,6 +1967,28 @@ static void set_general_cert_properties(HWND hwnd, struct detail_data *data) ...@@ -1967,6 +1967,28 @@ static void set_general_cert_properties(HWND hwnd, struct detail_data *data)
show_cert_usages(hwnd, data); show_cert_usages(hwnd, data);
} }
static void toggle_usage(HWND hwnd, int iItem)
{
LVITEMW item;
int res;
HWND lv = GetDlgItem(hwnd, IDC_CERTIFICATE_USAGES);
item.mask = LVIF_STATE;
item.iItem = iItem;
item.iSubItem = 0;
item.stateMask = LVIS_STATEIMAGEMASK;
res = SendMessageW(lv, LVM_GETITEMW, 0, (LPARAM)&item);
if (res)
{
int state = item.state >> 12;
item.state = INDEXTOSTATEIMAGEMASK(
state == CheckBitmapIndexChecked ? CheckBitmapIndexUnchecked :
CheckBitmapIndexChecked);
SendMessageW(lv, LVM_SETITEMSTATE, iItem, (LPARAM)&item);
}
}
#define MAX_FRIENDLY_NAME 40 #define MAX_FRIENDLY_NAME 40
#define MAX_DESCRIPTION 255 #define MAX_DESCRIPTION 255
...@@ -1994,6 +2016,21 @@ static LRESULT CALLBACK cert_properties_general_dlg_proc(HWND hwnd, UINT msg, ...@@ -1994,6 +2016,21 @@ static LRESULT CALLBACK cert_properties_general_dlg_proc(HWND hwnd, UINT msg,
SetWindowLongPtrW(hwnd, DWLP_USER, (LPARAM)data); SetWindowLongPtrW(hwnd, DWLP_USER, (LPARAM)data);
break; break;
} }
case WM_NOTIFY:
{
NMHDR *hdr = (NMHDR *)lp;
NMITEMACTIVATE *nm;
switch (hdr->code)
{
case NM_CLICK:
nm = (NMITEMACTIVATE *)lp;
toggle_usage(hwnd, nm->iItem);
SendMessageW(GetParent(hwnd), PSM_CHANGED, (WPARAM)hwnd, 0);
break;
}
break;
}
case WM_COMMAND: case WM_COMMAND:
switch (HIWORD(wp)) switch (HIWORD(wp))
{ {
......
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