cryptui: Show/hide description's scrollbar depending on how much text it has.

This commit is contained in:
Juan Lang 2008-12-18 13:54:28 -08:00 committed by Alexandre Julliard
parent 53fc5b850d
commit c489ce31ba

View file

@ -1624,6 +1624,24 @@ static LRESULT CALLBACK cert_properties_general_dlg_proc(HWND hwnd, UINT msg,
SetWindowLongPtrW(hwnd, DWLP_USER, (LPARAM)data);
break;
}
case WM_COMMAND:
switch (HIWORD(wp))
{
case EN_CHANGE:
SendMessageW(GetParent(hwnd), PSM_CHANGED, (WPARAM)hwnd, 0);
if (LOWORD(wp) == IDC_DESCRIPTION)
{
/* Show/hide scroll bar on description depending on how much
* text it has.
*/
HWND description = GetDlgItem(hwnd, IDC_DESCRIPTION);
int lines = SendMessageW(description, EM_GETLINECOUNT, 0, 0);
ShowScrollBar(description, SB_VERT, lines > 1);
}
break;
}
break;
}
return 0;
}