Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fc59d0b2
Commit
fc59d0b2
authored
Apr 27, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/shlview: Remove redundant message sent on every iteration, fix a helper interface leak.
parent
7ea71196
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
71 deletions
+65
-71
shlview.c
dlls/shell32/shlview.c
+65
-71
No files found.
dlls/shell32/shlview.c
View file @
fc59d0b2
...
...
@@ -1517,98 +1517,92 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn
case
LVN_KEYDOWN
:
{
/* MSG msg;
msg.hwnd = This->hWnd;
msg.message = WM_KEYDOWN;
msg.wParam = plvKeyDown->wVKey;
msg.lParam = 0;
msg.time = 0;
msg.pt = 0;*/
LPNMLVKEYDOWN
plvKeyDown
=
(
LPNMLVKEYDOWN
)
lpnmh
;
/* initiate a rename of the selected file or directory */
if
(
plvKeyDown
->
wVKey
==
VK_F2
)
switch
(
plvKeyDown
->
wVKey
)
{
/* see how many files are selected */
int
i
=
SendMessageW
(
This
->
hWndList
,
LVM_GETSELECTEDCOUNT
,
0
,
0
);
/* get selected item */
if
(
i
==
1
)
case
VK_F2
:
{
/* get selected item */
i
=
SendMessageW
(
This
->
hWndList
,
LVM_GETNEXTITEM
,
-
1
,
MAKELPARAM
(
LVNI_SELECTED
,
0
));
INT
i
=
SendMessageW
(
This
->
hWndList
,
LVM_GETSELECTEDCOUNT
,
0
,
0
);
SendMessageW
(
This
->
hWndList
,
LVM_ENSUREVISIBLE
,
i
,
0
);
SendMessageW
(
This
->
hWndList
,
LVM_EDITLABELW
,
i
,
0
);
if
(
i
==
1
)
{
/* get selected item */
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
);
}
}
}
#if 0
TranslateAccelerator(This->hWnd, This->hAccel, &msg)
#endif
else
if
(
plvKeyDown
->
wVKey
==
VK_DELETE
)
{
UINT
i
;
int
item_index
;
LVITEMA
item
;
LPITEMIDLIST
*
pItems
;
ISFHelper
*
psfhlp
;
break
;
case
VK_DELETE
:
{
UINT
i
,
count
;
int
item_index
;
LVITEMW
item
;
LPITEMIDLIST
*
pItems
;
ISFHelper
*
psfhlp
;
HRESULT
hr
;
IShellFolder_QueryInterface
(
This
->
pSFParent
,
&
IID_ISFHelper
,
(
LPVOID
*
)
&
psfhlp
)
;
hr
=
IShellFolder_QueryInterface
(
This
->
pSFParent
,
&
IID_ISFHelper
,
(
void
**
)
&
psfhlp
);
if
(
hr
!=
S_OK
)
return
0
;
if
(
psfhlp
==
NULL
)
break
;
if
(
!
(
count
=
SendMessageW
(
This
->
hWndList
,
LVM_GETSELECTEDCOUNT
,
0
,
0
)))
{
ISFHelper_Release
(
psfhlp
);
return
0
;
}
if
(
!
(
i
=
SendMessageW
(
This
->
hWndList
,
LVM_GETSELECTEDCOUNT
,
0
,
0
)))
break
;
/* allocate memory for the pidl array */
pItems
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPITEMIDLIST
)
*
count
)
;
/* allocate memory for the pidl array
*/
pItems
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPITEMIDLIST
)
*
i
)
;
/* retrieve all selected items
*/
i
=
0
;
item_index
=
-
1
;
/* retrieve all selected items */
i
=
0
;
item_index
=
-
1
;
while
(
SendMessageW
(
This
->
hWndList
,
LVM_GETSELECTEDCOUNT
,
0
,
0
)
>
i
)
{
/* get selected item */
item_index
=
SendMessageW
(
This
->
hWndList
,
LVM_GETNEXTITEM
,
item_index
,
MAKELPARAM
(
LVNI_SELECTED
,
0
));
item
.
iItem
=
item_index
;
item
.
mask
=
LVIF_PARAM
;
SendMessageW
(
This
->
hWndList
,
LVM_GETITEMW
,
0
,
(
LPARAM
)
&
item
);
while
(
count
>
i
)
{
/* get selected item */
item_index
=
SendMessageW
(
This
->
hWndList
,
LVM_GETNEXTITEM
,
item_index
,
MAKELPARAM
(
LVNI_SELECTED
,
0
));
item
.
iItem
=
item_index
;
item
.
mask
=
LVIF_PARAM
;
SendMessageW
(
This
->
hWndList
,
LVM_GETITEMW
,
0
,
(
LPARAM
)
&
item
);
/* get item pidl */
pItems
[
i
]
=
(
LPITEMIDLIST
)
item
.
lParam
;
/* get item pidl */
pItems
[
i
]
=
(
LPITEMIDLIST
)
item
.
lParam
;
i
++
;
}
i
++
;
}
/* perform the item deletion */
ISFHelper_DeleteItems
(
psfhlp
,
i
,
(
LPCITEMIDLIST
*
)
pItems
);
/* perform the item deletion */
ISFHelper_DeleteItems
(
psfhlp
,
i
,
(
LPCITEMIDLIST
*
)
pItems
);
ISFHelper_Release
(
psfhlp
);
/* free pidl array memory */
HeapFree
(
GetProcessHeap
(),
0
,
pItems
);
}
/* free pidl array memory */
HeapFree
(
GetProcessHeap
(),
0
,
pItems
);
}
break
;
/* Initiate a refresh */
else
if
(
plvKeyDown
->
wVKey
==
VK_F5
)
{
case
VK_F5
:
/* Initiate a refresh */
IShellView_Refresh
((
IShellView
*
)
This
);
}
break
;
else
if
(
plvKeyDown
->
wVKey
==
VK_BACK
)
{
LPSHELLBROWSER
lpSb
;
if
((
lpSb
=
(
LPSHELLBROWSER
)
SendMessageW
(
This
->
hWndParent
,
CWM_GETISHELLBROWSER
,
0
,
0
)))
case
VK_BACK
:
{
IShellBrowser_BrowseObject
(
lpSb
,
NULL
,
SBSP_PARENT
);
}
}
LPSHELLBROWSER
lpSb
;
if
((
lpSb
=
(
LPSHELLBROWSER
)
SendMessageW
(
This
->
hWndParent
,
CWM_GETISHELLBROWSER
,
0
,
0
)))
{
IShellBrowser_BrowseObject
(
lpSb
,
NULL
,
SBSP_PARENT
);
}
}
break
;
else
FIXME
(
"LVN_KEYDOWN key=0x%08x
\n
"
,
plvKeyDown
->
wVKey
);
default:
FIXME
(
"LVN_KEYDOWN key=0x%08x
\n
"
,
plvKeyDown
->
wVKey
);
}
}
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment