Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Winfile.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<ClCompile Include="winfile.c" />
<ClCompile Include="wnetcaps.c" />
<ClCompile Include="wfloc.c" />
<ClCompile Include="resize.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="dbg.h" />
Expand All @@ -62,6 +63,7 @@
<ClInclude Include="winfile.h" />
<ClInclude Include="wnetcaps.h" />
<ClInclude Include="res.h" />
<ClInclude Include="resize.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res.rc" />
Expand Down Expand Up @@ -145,4 +147,4 @@
<UniqueIdentifier>{a74d83f3-58ec-46d3-bb3d-fadca6ac5743}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
</Project>
20 changes: 18 additions & 2 deletions src/wfdlgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,24 @@ ActivateCommonContextMenu(HWND hwnd, HWND hwndLB, LPARAM lParam)
}
else
{
SendMessage(hwndLB, LB_SETSEL, (WPARAM)FALSE, (LPARAM)-1);
SendMessage(hwndLB, LB_SETSEL, (WPARAM)TRUE, (LPARAM)item);
// directory. Allow for multiselection
INT iMac = (INT)SendMessage(hwndLB, LB_GETSELCOUNT, 0, 0L);
LPINT lpSelItems = (LPINT)LocalAlloc(LMEM_FIXED, sizeof(INT) * iMac);
iMac = (INT)SendMessage(hwndLB,
LB_GETSELITEMS,
(WPARAM)iMac,
(LPARAM)lpSelItems);
boolean clickedOnSelected = 0;
for (int i = 0; i < iMac; i++) {
if (lpSelItems[i] == item) {
clickedOnSelected = 1;
}
}
if (!clickedOnSelected) { // clicked on something new, select it
SendMessage(hwndLB, LB_SETSEL, (WPARAM)FALSE, (LPARAM)-1);
SendMessage(hwndLB, LB_SETSEL, (WPARAM)TRUE, (LPARAM)item);
}
LocalFree((HLOCAL)lpSelItems);

BOOL bDir = FALSE;
SendMessage(hwnd, FS_GETSELECTION, 5, (LPARAM)&bDir);
Expand Down