mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 12:24:48 +00:00
[SHELL32] Fix and improve SHLimitInputEdit
Use CallWindowProcW to call the subclass window procedure. Use Wide functions explicitly. CORE-11701
This commit is contained in:
parent
065a0bbf0f
commit
ea8a6d6fb7
1 changed files with 9 additions and 9 deletions
|
@ -2153,7 +2153,7 @@ BOOL WINAPI IsUserAnAdmin(VOID)
|
||||||
* SHLimitInputEdit(SHELL32.@)
|
* SHLimitInputEdit(SHELL32.@)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* TODO: Show baloon popup window using SetWindowRgn */
|
/* TODO: Show baloon popup window with TTS_BALLOON */
|
||||||
|
|
||||||
typedef struct UxSubclassInfo
|
typedef struct UxSubclassInfo
|
||||||
{
|
{
|
||||||
|
@ -2174,7 +2174,7 @@ UxSubclassInfo_Destroy(UxSubclassInfo *pInfo)
|
||||||
CoTaskMemFree(pInfo->pwszValidChars);
|
CoTaskMemFree(pInfo->pwszValidChars);
|
||||||
CoTaskMemFree(pInfo->pwszInvalidChars);
|
CoTaskMemFree(pInfo->pwszInvalidChars);
|
||||||
|
|
||||||
SetWindowLongPtr(pInfo->hwnd, GWLP_WNDPROC, (LONG_PTR)pInfo->fnWndProc);
|
SetWindowLongPtrW(pInfo->hwnd, GWLP_WNDPROC, (LONG_PTR)pInfo->fnWndProc);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, pInfo);
|
HeapFree(GetProcessHeap(), 0, pInfo);
|
||||||
}
|
}
|
||||||
|
@ -2185,7 +2185,7 @@ LimitEditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
WNDPROC fnWndProc;
|
WNDPROC fnWndProc;
|
||||||
UxSubclassInfo *pInfo = GetPropW(hwnd, L"UxSubclassInfo");
|
UxSubclassInfo *pInfo = GetPropW(hwnd, L"UxSubclassInfo");
|
||||||
if (!pInfo)
|
if (!pInfo)
|
||||||
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||||
|
|
||||||
fnWndProc = pInfo->fnWndProc;
|
fnWndProc = pInfo->fnWndProc;
|
||||||
|
|
||||||
|
@ -2209,7 +2209,7 @@ LimitEditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fnWndProc(hwnd, uMsg, wParam, lParam);
|
return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_IME_CHAR:
|
case WM_IME_CHAR:
|
||||||
|
@ -2237,17 +2237,17 @@ LimitEditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fnWndProc(hwnd, uMsg, wParam, lParam);
|
return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_NCDESTROY:
|
case WM_NCDESTROY:
|
||||||
{
|
{
|
||||||
UxSubclassInfo_Destroy(pInfo);
|
UxSubclassInfo_Destroy(pInfo);
|
||||||
return fnWndProc(hwnd, uMsg, wParam, lParam);
|
return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return fnWndProc(hwnd, uMsg, wParam, lParam);
|
return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2266,10 +2266,10 @@ UxSubclassInfo_Create(HWND hwnd, LPWSTR valid, LPWSTR invalid)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pInfo->fnWndProc = (WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)LimitEditWindowProc);
|
pInfo->fnWndProc = (WNDPROC)SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)LimitEditWindowProc);
|
||||||
if (!pInfo->fnWndProc)
|
if (!pInfo->fnWndProc)
|
||||||
{
|
{
|
||||||
ERR("SetWindowLongPtr failed\n");
|
ERR("SetWindowLongPtrW failed\n");
|
||||||
CoTaskMemFree(valid);
|
CoTaskMemFree(valid);
|
||||||
CoTaskMemFree(invalid);
|
CoTaskMemFree(invalid);
|
||||||
HeapFree(GetProcessHeap(), 0, pInfo);
|
HeapFree(GetProcessHeap(), 0, pInfo);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue