大网数据广告活动
Windows 系统接口

IAccessibilityDockingService GetAvailableSize method

· 52CE 我爱测

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

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 code Description
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

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。