Export (0) Print
Expand All

SetProcessDpiAwareness function

Sets the current process to one of three dots per inch (dpi) awareness levels. The DPI awareness levels are from the PROCESS_DPI_AWARENESS enumeration.

Syntax


HRESULT WINAPI SetProcessDPIAwareness(
  _In_  PROCESS_DPI_AWARENESS value
);

Parameters

value [in]

The DPI awareness value to set. Possible values are from the PROCESS_DPI_AWARENESSenumeration.

Return value

This function returns one of the following values.

Return codeDescription
S_OK

The current process is set as dpi aware.

E_INVALIDARG

The value passed in is not valid.

E_ACCESSDENIED

The DPI awareness is already set, either by calling this API previously or through the application (.exe) manifest.

 

Remarks

If the DPI awareness level is not set by calling this API or through the application manifest, then it defaults to PROCESS_DPI_UNAWARE.

This API fails if the DPI awareness is specified in the application manifest or if this API has been called previously.

You must call this API before you call any APIs that involve a monitor’s coordinate space.

 

 

Community Additions

ADD
Show:
© 2014 Microsoft