RegisterScaleChangeNotifications function

Registers a window to receive callbacks when scaling information changes.

Note  This function is not supported as of Windows 8.1. Use RegisterScaleChangeEvent instead.
 

Syntax

HRESULT RegisterScaleChangeNotifications(
  DISPLAY_DEVICE_TYPE displayDevice,
  HWND                hwndNotify,
  UINT                uMsgNotify,
  DWORD               *pdwCookie
);

Parameters

displayDevice

Type: DISPLAY_DEVICE_TYPE

The enum value that indicates which display device to receive notifications about.

hwndNotify

Type: HWND

The handle of the window that will receive the notifications.

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.

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

   
Windows version Windows 8 [desktop apps only] Windows Server 2012 [desktop apps only]
Target Platform Windows
Header shellscalingapi.h
DLL Shcore.dll

See Also

GetScaleFactorForMonitor

RegisterScaleChangeEvent

UnregisterScaleChangeEvent