Commit f8f8f0a4 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/listview: Make ListView_* macros match PSDK.

parent 7d4bbe9e
......@@ -365,7 +365,7 @@ static inline void EmptyList(void)
*/
static void UpdateButtons(HWND hWnd)
{
BOOL sel = ListView_GetSelectedCount(GetDlgItem(hWnd, IDL_PROGRAMS)) != 0;
BOOL sel = SendMessageW(GetDlgItem(hWnd, IDL_PROGRAMS), LVM_GETSELECTEDCOUNT, 0, 0) != 0;
EnableWindow(GetDlgItem(hWnd, IDC_ADDREMOVE), sel);
EnableWindow(GetDlgItem(hWnd, IDC_SUPPORT_INFO), sel);
......@@ -636,7 +636,7 @@ static HIMAGELIST AddListViewImageList(HWND hWnd)
ImageList_AddIcon(hSmall, hDefaultIcon);
DestroyIcon(hDefaultIcon);
(void) ListView_SetImageList(hWnd, hSmall, LVSIL_SMALL);
SendMessageW(hWnd, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)hSmall);
return hSmall;
}
......
......@@ -214,8 +214,8 @@ static BOOL Control_CreateListView (CPanel *panel)
panel->hImageListLarge = ImageList_Create(GetSystemMetrics(SM_CXICON),
GetSystemMetrics(SM_CYICON), ILC_MASK, 1, 1);
(void) ListView_SetImageList(panel->hWndListView, panel->hImageListSmall, LVSIL_SMALL);
(void) ListView_SetImageList(panel->hWndListView, panel->hImageListLarge, LVSIL_NORMAL);
SendMessageW(panel->hWndListView, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)panel->hImageListSmall);
SendMessageW(panel->hWndListView, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)panel->hImageListLarge);
/* Create columns for list view */
lvc.mask = LVCF_FMT | LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH;
......
......@@ -560,7 +560,7 @@ static BOOLEAN LV_AddItem(IShellViewImpl * This, LPCITEMIDLIST pidl)
TRACE("(%p)(pidl=%p)\n", This, pidl);
lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; /*set the mask*/
lvItem.iItem = ListView_GetItemCount(This->hWndList); /*add the item to the end of the list*/
lvItem.iItem = SendMessageW(This->hWndList, LVM_GETITEMCOUNT, 0, 0); /*add the item to the end of the list*/
lvItem.iSubItem = 0;
lvItem.lParam = (LPARAM) ILClone(ILFindLastID(pidl)); /*set the item's data*/
lvItem.pszText = LPSTR_TEXTCALLBACKW; /*get text on a callback basis*/
......@@ -578,7 +578,7 @@ static BOOLEAN LV_DeleteItem(IShellViewImpl * This, LPCITEMIDLIST pidl)
TRACE("(%p)(pidl=%p)\n", This, pidl);
nIndex = LV_FindItemByPidl(This, ILFindLastID(pidl));
return (-1==ListView_DeleteItem(This->hWndList, nIndex))? FALSE: TRUE;
return (-1==SendMessageW(This->hWndList, LVM_DELETEITEM, nIndex, 0))? FALSE: TRUE;
}
/**********************************************************
......@@ -836,7 +836,7 @@ static UINT ShellView_GetSelections(IShellViewImpl * This)
SHFree(This->apidl);
This->cidl = ListView_GetSelectedCount(This->hWndList);
This->cidl = SendMessageW(This->hWndList, LVM_GETSELECTEDCOUNT, 0, 0);
This->apidl = SHAlloc(This->cidl * sizeof(LPITEMIDLIST));
TRACE("selected=%i\n", This->cidl);
......@@ -1494,14 +1494,13 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn
if(plvKeyDown->wVKey == VK_F2)
{
/* see how many files are selected */
int i = ListView_GetSelectedCount(This->hWndList);
int i = SendMessageW(This->hWndList, LVM_GETSELECTEDCOUNT, 0, 0);
/* get selected item */
if(i == 1)
{
/* get selected item */
i = ListView_GetNextItem(This->hWndList, -1,
LVNI_SELECTED);
i = SendMessageW(This->hWndList, LVM_GETNEXTITEM, -1, MAKELPARAM (LVNI_SELECTED, 0));
SendMessageW(This->hWndList, LVM_ENSUREVISIBLE, i, 0);
SendMessageW(This->hWndList, LVM_EDITLABELW, i, 0);
......@@ -1524,7 +1523,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn
if (psfhlp == NULL)
break;
if(!(i = ListView_GetSelectedCount(This->hWndList)))
if(!(i = SendMessageW(This->hWndList, LVM_GETSELECTEDCOUNT, 0, 0)))
break;
/* allocate memory for the pidl array */
......@@ -1534,11 +1533,11 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn
/* retrieve all selected items */
i = 0;
item_index = -1;
while(ListView_GetSelectedCount(This->hWndList) > i)
while(SendMessageW(This->hWndList, LVM_GETSELECTEDCOUNT, 0, 0) > i)
{
/* get selected item */
item_index = ListView_GetNextItem(This->hWndList,
item_index, LVNI_SELECTED);
item_index = SendMessageW(This->hWndList, LVM_GETNEXTITEM, item_index,
MAKELPARAM (LVNI_SELECTED, 0));
item.iItem = item_index;
item.mask = LVIF_PARAM;
SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &item);
......
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