Expand Minimize

RegisterScaleChangeEvent function

Registers for an event that is triggered when the scale has possibly changed. This function replaces RegisterScaleChangeNotifications.

Syntax


STDAPI RegisterScaleChangeEvent(
  _In_   HANDLE hEvent,
  _Out_  DWORD_PTR *pdwCookie
);

Parameters

hEvent [in]

Handle of the event to register for scale change notifications.

pdwCookie [out]

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

Minimum supported client

Windows 8.1 [desktop apps only]

Minimum supported server

Windows Server 2012 R2 [desktop apps only]

Header

ShellScalingAPI.h

Library

Shcore.lib

DLL

Shcore.dll

See also

UnregisterScaleChangeEvent
GetScaleFactorForMonitor

 

 

Community Additions

ADD
Show:
© 2014 Microsoft