LogicalToPhysicalPoint function
Converts the logical coordinates of a point in a window to physical coordinates.
Syntax
BOOL WINAPI LogicalToPhysicalPoint( _In_ HWND hWnd, _Inout_ LPPOINT lpPoint );
Parameters
- hWnd [in]
-
Type: HWND
A handle to the window whose transform is used for the conversion. Top level windows are fully supported. In the case of child windows, only the area of overlap between the parent and the child window is converted.
- lpPoint [in, out]
-
Type: LPPOINT
A pointer to a POINT structure that specifies the logical coordinates to be converted. The new physical coordinates are copied into this structure if the function succeeds.
Remarks
Windows Vista introduces the concept of physical coordinates. Desktop Window Manager (DWM) scales non-dots per inch (dpi) aware windows when the display is high dpi. The window seen on the screen corresponds to the physical coordinates. The application continues to work in logical space. Therefore, the application's view of the window is different from that which appears on the screen. For scaled windows, logical and physical coordinates are different.
LogicalToPhysicalPoint is a transformation API that can be called by a process that declares itself as dpi aware. The function uses the window identified by the hWnd parameter and the logical coordinates given in the POINT structure to compute the physical coordinates.
The LogicalToPhysicalPoint function replaces the logical coordinates in the POINT structure with the physical coordinates. The physical coordinates are relative to the upper-left corner of the screen. The coordinates have to be inside the client area of hWnd.
On all platforms, LogicalToPhysicalPoint will fail on a window that has either 0 width or height; an application must first establish a non-0 width and height by calling, for example, MoveWindow. On some versions of Windows (including Windows 7), LogicalToPhysicalPoint will still fail if MoveWindow has been called after a call to ShowWindow with SH_HIDE has hidden the window.
Requirements
|
Minimum supported client | Windows Vista [desktop apps only] |
|---|---|
|
Minimum supported server | Windows Server 2008 [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
Send comments about this topic to Microsoft
Build date: 2/25/2013