Author: hbelusca
Date: Thu May 12 21:12:40 2016
New Revision: 71327
URL:
http://svn.reactos.org/svn/reactos?rev=71327&view=rev
Log:
[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.
Modified:
trunk/reactos/base/shell/progman/dialog.c
trunk/reactos/base/shell/progman/new_resources.rc
Modified: trunk/reactos/base/shell/progman/dialog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/progman/dialog.…
==============================================================================
--- trunk/reactos/base/shell/progman/dialog.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/progman/dialog.c [iso-8859-1] Thu May 12 21:12:40 2016
@@ -514,9 +514,9 @@
WCHAR szName[100];
if (IS_INTRESOURCE(lpszName))
+ swprintf(szName, L"%u", lpszName);
+ else
wcscpy(szName, lpszName);
- else
- swprintf(szName, L"%u", lpszName);
hIcon = (HICON)LoadImageW(hModule, lpszName, IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
if (hIcon == NULL)
@@ -531,17 +531,17 @@
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)
- {
- hIcon = (HICON)SendMessageA(hDlgCtrl, LB_GETITEMDATA, index, 0);
+ while (count-- > 0)
+ {
+ hIcon = (HICON)SendMessageA(hDlgCtrl, LB_GETITEMDATA, 0, 0);
DestroyIcon(hIcon);
+ SendMessageA(hDlgCtrl, LB_DELETESTRING, 0, 0);
}
}
@@ -591,7 +591,7 @@
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 @@
if (pIconContext->hLibrary)
{
EnumResourceNamesW(pIconContext->hLibrary,
- (LPCWSTR)RT_ICON, // RT_GROUP_ICON
+ (LPCWSTR)RT_GROUP_ICON,
EnumPickIconResourceProc,
(LONG_PTR)pIconContext->hDlgCtrl);
FreeLibrary(pIconContext->hLibrary);
Modified: trunk/reactos/base/shell/progman/new_resources.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/progman/new_res…
==============================================================================
--- trunk/reactos/base/shell/progman/new_resources.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/progman/new_resources.rc [iso-8859-1] Thu May 12 21:12:40
2016
@@ -132,7 +132,7 @@
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