Author: tfaber
Date: Mon Nov 18 20:24:18 2013
New Revision: 61043
URL:
http://svn.reactos.org/svn/reactos?rev=61043&view=rev
Log:
[RAPPS]
- Fix info display on selection change. Patch by Carlo Bramini.
CORE-6139 #resolve
Modified:
trunk/reactos/base/applications/rapps/listview.c
trunk/reactos/base/applications/rapps/winmain.c
Modified: trunk/reactos/base/applications/rapps/listview.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/li…
==============================================================================
--- trunk/reactos/base/applications/rapps/listview.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/listview.c [iso-8859-1] Mon Nov 18 20:24:18
2013
@@ -103,7 +103,7 @@
hListView = CreateWindowExW(WS_EX_CLIENTEDGE,
WC_LISTVIEWW,
L"",
- WS_CHILD | WS_VISIBLE | LVS_SORTASCENDING | LVS_REPORT |
LVS_SINGLESEL,
+ WS_CHILD | WS_VISIBLE | LVS_SORTASCENDING | LVS_REPORT |
LVS_SINGLESEL | LVS_SHOWSELALWAYS,
205, 28, 465, 250,
hwnd,
NULL,
Modified: trunk/reactos/base/applications/rapps/winmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/wi…
==============================================================================
--- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Mon Nov 18 20:24:18 2013
@@ -73,7 +73,7 @@
if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"Software\\ReactOS\\rapps", 0,
NULL,
REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) == ERROR_SUCCESS)
{
- RegSetValueEx(hKey, L"Settings", 0, REG_BINARY,
(LPBYTE)&SettingsInfo, sizeof(SETTINGS_INFO));
+ RegSetValueExW(hKey, L"Settings", 0, REG_BINARY,
(LPBYTE)&SettingsInfo, sizeof(SETTINGS_INFO));
RegCloseKey(hKey);
}
}
@@ -631,21 +631,31 @@
}
break;
- case LVN_KEYDOWN:
+ case LVN_ITEMCHANGED:
{
- LPNMLVKEYDOWN pnkd = (LPNMLVKEYDOWN) lParam;
-
- if (pnkd->hdr.hwndFrom == hListView)
+ LPNMLISTVIEW pnic = (LPNMLISTVIEW) lParam;
+
+ if (pnic->hdr.hwndFrom == hListView)
{
- INT ItemIndex = (INT) SendMessage(hListView, LVM_GETNEXTITEM, -1,
LVNI_FOCUSED);
-
- if (pnkd->wVKey == VK_UP) ItemIndex -= 1;
- if (pnkd->wVKey == VK_DOWN) ItemIndex += 1;
-
- if (IS_INSTALLED_ENUM(SelectedEnumType))
- ShowInstalledAppInfo(ItemIndex);
- if (IS_AVAILABLE_ENUM(SelectedEnumType))
- ShowAvailableAppInfo(ItemIndex);
+ /* Check if this is a valid item
+ * (technically, it can be also an unselect) */
+ INT ItemIndex = pnic->iItem;
+ if (ItemIndex == -1 ||
+ ItemIndex >=
ListView_GetItemCount(pnic->hdr.hwndFrom))
+ {
+ break;
+ }
+
+ /* Check if the focus has been moved to another item */
+ if ((pnic->uChanged & LVIF_STATE) &&
+ (pnic->uNewState & LVIS_FOCUSED) &&
+ !(pnic->uOldState & LVIS_FOCUSED))
+ {
+ if (IS_INSTALLED_ENUM(SelectedEnumType))
+ ShowInstalledAppInfo(ItemIndex);
+ if (IS_AVAILABLE_ENUM(SelectedEnumType))
+ ShowAvailableAppInfo(ItemIndex);
+ }
}
}
break;
@@ -763,7 +773,7 @@
WCHAR szErrorText[MAX_STR_LEN];
HANDLE hMutex = NULL;
MSG Msg;
-
+
switch (GetUserDefaultUILanguage())
{
case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
@@ -773,7 +783,7 @@
default:
break;
}
-
+
hInst = hInstance;
if (!IsUserAnAdmin())