mirror of
https://github.com/reactos/reactos.git
synced 2026-06-06 21:51:53 +08:00
[EXPLORER][SHELL32][SHELL32_APITEST][SDK] AppBar Part 2 (#7946)
Follow-up of #7778. JIRA issue: CORE-7237 - Rename APPBARDATA3264 structure as APPBARDATAINTEROP. - Fix structures for WoW64. - Use trace instead of DPRINT1. - Add CAppBarManager:: RecomputeAllWorkareas function. - Fix WM_DISPLAYCHANGE handling to re-compute the work areas.
This commit is contained in:
committed by
GitHub
parent
24c2e4433b
commit
7073bdfead
@@ -130,7 +130,7 @@ void CAppBarManager::OnAppBarQueryPos(_Inout_ PAPPBAR_COMMAND pData)
|
||||
return;
|
||||
}
|
||||
|
||||
PAPPBARDATA3264 pOutput = AppBar_LockOutput(pData);
|
||||
PAPPBARDATAINTEROP pOutput = AppBar_LockOutput(pData);
|
||||
if (!pOutput)
|
||||
{
|
||||
ERR("!pOutput: %d\n", pData->dwProcessId);
|
||||
@@ -187,7 +187,7 @@ void CAppBarManager::OnAppBarSetPos(_Inout_ PAPPBAR_COMMAND pData)
|
||||
|
||||
OnAppBarQueryPos(pData);
|
||||
|
||||
PAPPBARDATA3264 pOutput = AppBar_LockOutput(pData);
|
||||
PAPPBARDATAINTEROP pOutput = AppBar_LockOutput(pData);
|
||||
if (!pOutput)
|
||||
return;
|
||||
|
||||
@@ -425,6 +425,31 @@ CAppBarManager::RecomputeWorkArea(
|
||||
return WORKAREA_SAME_AS_MONITOR;
|
||||
}
|
||||
|
||||
BOOL CALLBACK
|
||||
CAppBarManager::MonitorEnumProc(
|
||||
_In_ HMONITOR hMonitor,
|
||||
_In_ HDC hDC,
|
||||
_In_ LPRECT prc,
|
||||
_Inout_ LPARAM lParam)
|
||||
{
|
||||
CAppBarManager *pThis = (CAppBarManager *)lParam;
|
||||
UNREFERENCED_PARAMETER(hDC);
|
||||
|
||||
RECT rcWorkArea;
|
||||
if (pThis->RecomputeWorkArea(prc, hMonitor, &rcWorkArea) != WORKAREA_IS_NOT_MONITOR)
|
||||
return TRUE;
|
||||
|
||||
HWND hwndDesktop = pThis->GetDesktopWnd();
|
||||
::SystemParametersInfoW(SPI_SETWORKAREA, 0, &rcWorkArea, hwndDesktop ? SPIF_SENDCHANGE : 0);
|
||||
pThis->RedrawDesktop(hwndDesktop, &rcWorkArea);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CAppBarManager::RecomputeAllWorkareas()
|
||||
{
|
||||
::EnumDisplayMonitors(NULL, NULL, CAppBarManager::MonitorEnumProc, (LPARAM)this);
|
||||
}
|
||||
|
||||
PAPPBAR_COMMAND
|
||||
CAppBarManager::GetAppBarMessage(_Inout_ PCOPYDATASTRUCT pCopyData)
|
||||
{
|
||||
|
||||
@@ -15,14 +15,14 @@ typedef struct tagAPPBAR
|
||||
RECT rc;
|
||||
} APPBAR, *PAPPBAR;
|
||||
|
||||
static inline PAPPBARDATA3264
|
||||
static inline PAPPBARDATAINTEROP
|
||||
AppBar_LockOutput(_In_ PAPPBAR_COMMAND pData)
|
||||
{
|
||||
return (PAPPBARDATA3264)SHLockShared(UlongToHandle(pData->hOutput32), pData->dwProcessId);
|
||||
return (PAPPBARDATAINTEROP)SHLockShared((HANDLE)pData->hOutput, pData->dwProcessId);
|
||||
}
|
||||
|
||||
static inline VOID
|
||||
AppBar_UnLockOutput(_Out_ PAPPBARDATA3264 pOutput)
|
||||
AppBar_UnLockOutput(_Out_ PAPPBARDATAINTEROP pOutput)
|
||||
{
|
||||
SHUnlockShared(pOutput);
|
||||
}
|
||||
@@ -77,6 +77,7 @@ protected:
|
||||
_In_ const RECT *prcTray,
|
||||
_In_ HMONITOR hMonitor,
|
||||
_Out_ PRECT prcWorkArea);
|
||||
void RecomputeAllWorkareas();
|
||||
|
||||
void StuckAppChange(
|
||||
_In_opt_ HWND hwndTarget,
|
||||
@@ -93,4 +94,11 @@ protected:
|
||||
virtual INT GetPosition() const = 0;
|
||||
virtual const RECT* GetTrayRect() = 0;
|
||||
virtual HWND GetDesktopWnd() const = 0;
|
||||
|
||||
static BOOL CALLBACK
|
||||
MonitorEnumProc(
|
||||
_In_ HMONITOR hMonitor,
|
||||
_In_ HDC hDC,
|
||||
_In_ LPRECT prc,
|
||||
_Inout_ LPARAM lParam);
|
||||
};
|
||||
|
||||
@@ -2492,6 +2492,9 @@ ChangePos:
|
||||
|
||||
LRESULT OnDisplayChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
/* Refresh workareas */
|
||||
RecomputeAllWorkareas();
|
||||
|
||||
/* Load the saved tray window settings */
|
||||
RegLoadSettings();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user