RegisterScaleChangeEvent function (shellscalingapi.h)
Registers for an event that is triggered when the scale has possibly changed. This function replaces RegisterScaleChangeNotifications.
Syntax
HRESULT RegisterScaleChangeEvent(
[in] HANDLE hEvent,
[out] DWORD_PTR *pdwCookie
);
Parameters
[in] hEvent
Handle of the event to register for scale change notifications.
[out] pdwCookie
When this function returns successfully, this value receives the address of a pointer to a cookie that can be used later to unregister for the scale change notifications through UnregisterScaleChangeEvent.
Return value
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
The event is raised whenever something that can affect scale changes, but just because the scale can be affected doesn't mean that it has been. Callers can cache the scale factor to verify that the monitor's scale actually has changed. The event handle will be duplicated, so callers can close their handle at any time.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 8.1 [desktop apps only] |
Minimum supported server | Windows Server 2012 R2 [desktop apps only] |
Target Platform | Windows |
Header | shellscalingapi.h |
Library | Shcore.lib |
DLL | Shcore.dll |