RegisterScaleChangeNotifications function (shellscalingapi.h)
Registers a window to receive callbacks when scaling information changes.
Syntax
HRESULT RegisterScaleChangeNotifications(
[in] DISPLAY_DEVICE_TYPE displayDevice,
[in] HWND hwndNotify,
[in] UINT uMsgNotify,
[out] DWORD *pdwCookie
);
Parameters
[in] displayDevice
Type: DISPLAY_DEVICE_TYPE
The enum value that indicates which display device to receive notifications about.
[in] hwndNotify
Type: HWND
The handle of the window that will receive the notifications.
[in] uMsgNotify
Type: UINT
An application-defined message that is passed to the window specified by hwndNotify when scaling information changes. Typically, this should be set to WM_APP+x, where x is an integer value.
[out] pdwCookie
Type: DWORD*
Pointer to a value that, when this function returns successfully, receives a registration token. This token is used to revoke notifications by calling RevokeScaleChangeNotifications.
Return value
Type: STDAPI
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
This message specified by uMsgNotify is posted to the registered window through PostMessage. The wParam of the message can contain a combination of SCALE_CHANGE_FLAGS that describe the change that occurred.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 8 [desktop apps only] |
Minimum supported server | Windows Server 2012 [desktop apps only] |
Target Platform | Windows |
Header | shellscalingapi.h |
DLL | Shcore.dll |