[PROGMAN]

- Fix the icon chooser dialog: icon enumeration, icon list cleanup... Similar fixes should also be ported to our shell32 icon list dialog code!
- Remove erroneous LBS_SORT style from the icon list box.

svn path=/trunk/; revision=71327
This commit is contained in:
Hermès Bélusca-Maïto 2016-05-12 21:12:40 +00:00
parent 1e2e730dd3
commit 41ed1557a2
2 changed files with 10 additions and 10 deletions

View file

@ -514,9 +514,9 @@ EnumPickIconResourceProc(HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LON
WCHAR szName[100];
if (IS_INTRESOURCE(lpszName))
wcscpy(szName, lpszName);
else
swprintf(szName, L"%u", lpszName);
else
wcscpy(szName, lpszName);
hIcon = (HICON)LoadImageW(hModule, lpszName, IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
if (hIcon == NULL)
@ -531,17 +531,17 @@ VOID
DestroyIconList(HWND hDlgCtrl)
{
HICON hIcon;
INT index;
INT count;
UINT count;
count = SendMessageA(hDlgCtrl, LB_GETCOUNT, 0, 0);
if (count == LB_ERR)
if (count == LB_ERR || count == 0)
return;
for (index = 0; index < count; ++index)
while (count-- > 0)
{
hIcon = (HICON)SendMessageA(hDlgCtrl, LB_GETITEMDATA, index, 0);
hIcon = (HICON)SendMessageA(hDlgCtrl, LB_GETITEMDATA, 0, 0);
DestroyIcon(hIcon);
SendMessageA(hDlgCtrl, LB_DELETESTRING, 0, 0);
}
}
@ -591,7 +591,7 @@ DIALOG_SYMBOL_DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (pIconContext->hLibrary)
{
EnumResourceNamesW(pIconContext->hLibrary,
(LPCWSTR)RT_ICON, // RT_GROUP_ICON
(LPCWSTR)RT_GROUP_ICON,
EnumPickIconResourceProc,
(LONG_PTR)pIconContext->hDlgCtrl);
FreeLibrary(pIconContext->hLibrary);
@ -640,7 +640,7 @@ DIALOG_SYMBOL_DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (pIconContext->hLibrary)
{
EnumResourceNamesW(pIconContext->hLibrary,
(LPCWSTR)RT_ICON, // RT_GROUP_ICON
(LPCWSTR)RT_GROUP_ICON,
EnumPickIconResourceProc,
(LONG_PTR)pIconContext->hDlgCtrl);
FreeLibrary(pIconContext->hLibrary);

View file

@ -132,7 +132,7 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,175,25,60,15
PUSHBUTTON "&Browse...",PM_BROWSE,175,45,60,15
PUSHBUTTON "&Help",IDHELP,175,65,60,15
LISTBOX PM_SYMBOL_LIST,5,45,165,35,LBS_SORT | LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | LBS_DISABLENOSCROLL | WS_HSCROLL | WS_TABSTOP
LISTBOX PM_SYMBOL_LIST,5,45,165,35,LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | LBS_DISABLENOSCROLL | WS_HSCROLL | WS_TABSTOP
END
IDD_EXECUTE DIALOGEX 0, 0, 200, 85