[PATCH 2/4] inetcpl: Fill the security listview with zones

Nikolay Sivov bunglehead at gmail.com
Wed Apr 13 00:15:11 CDT 2011


Some minor things regarding listview.

On Wed, Apr 13, 2011 at 7:33 AM, Detlef Riekenberg <wine.dev at web.de> wrote:
> ---
>  dlls/inetcpl.cpl/security.c |  131 +++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 131 insertions(+), 0 deletions(-)
>

> +static void add_zone_to_listview(secdlg_data *sd, DWORD *pindex, DWORD zone)
> +{
> +    DWORD lv_index = *pindex;
> +    ZONEATTRIBUTES *za = &sd->zone_attr[lv_index];
> +    LVITEMW lvitem;
> +    HRESULT hr;
> +    INT iconid = 0;
> +    HMODULE hdll = NULL;
> +    WCHAR * ptr;
> +    HICON icon;
> +
> +    TRACE("item %d (zone %d)\n", lv_index, zone);
> +
> +    sd->zones[lv_index] = zone;
> +
> +    memset(&lvitem, 0, sizeof(LVITEMW));

This reset shouldn't be needed, cause control checks for mask field
and doesn't access other fields.

> +
> +        if (ListView_InsertItemW(sd->hlv, &lvitem) >= 0) {
> +            /* activate first item in the listview */
> +            if (! lv_index) {
> +                lvitem.state = LVIS_FOCUSED | LVIS_SELECTED;
> +                lvitem.stateMask = LVIS_FOCUSED | LVIS_SELECTED;
> +                SendMessageW(sd->hlv, LVM_SETITEMSTATE, 0, (LPARAM) &lvitem);

> +    }
> +    SendMessageW(sd->hlv, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)sd->himages);
> +

You could use macros here too, if you prefer that.



More information about the wine-devel mailing list