IAccessibilityDockingService::GetAvailableSize method

Gets the dimensions available for docking an accessibility window on a monitor.

Syntax


HRESULT GetAvailableSize(
  [in]  HMONITOR hMonitor,
  [out] UINT     *puMaxHeight,
  [out] UINT     *puFixedWidth
);

Parameters

hMonitor [in]

Specifies the monitor for which the available docking size will be retrieved.

puMaxHeight [out]

On success, set to the maximum height available for docking on the specified hMonitor, in pixels.

On failure, set to zero.

puFixedWidth [out]

On success, set to the fixed width available for docking on the specified hMonitor, in pixels. Any window docked to this hMonitor will be sized to this width.

On failure, set to zero.

Return value

Return codeDescription
S_OK

Success.

HRESULT_FROM_WIN32(ERROR_INVALID_MONITOR_HANDLE)

The monitor specified by the monitor handle does not support docking.

 

If either puMaxHeight or puFixedWidth are null, an access violation will occur.

Remarks

Accessibility windows can only be docked to a monitor that has at least 768 vertical screen pixels. This API will not allow such windows to be docked with a height that would cause Windows Store apps to have less than 768 vertical screen pixels.

Examples


IAccessibilityDockingService *pDockingService;
HRESULT hr = CoCreateInstance(CLSID_AccessibilityDockingService, CLSCTX_INPROV_SERVER, nullptr, IID_PPV_ARGS(&pDockingService));
if (SUCCEEDED(hr))
{
    UINT uMaxHeight;
    UINT uFixedWidth;

    HMONITOR hMonitor = MonitorFromWindow(_hwndMyApplication, MONITOR_DEFAULTTONULL);
    if (hMonitor != nullptr)
    {
        hr = pDockingService->GetAvailableSize(hMonitor, &uMaxHeight, &uFixedWidth);
    }
}

See also

IAccessibilityDockingService

 

 

Show: