Help Center

AfxSetWindowLocationfunction

Sets the location of the top left corner of the window, in pixels.

WindowsfunctionAfxWin.incdocumented

Syntax

FUNCTION AfxSetWindowLocation (BYVAL hwnd AS HWND, BYVAL nLeft AS LONG, BYVAL nTop AS LONG) AS BOOLEAN
Also documented as AfxSetWindowLocationForDpi — one description covers them all.

Parameters

NameDescription
hwndHandle to the window.
nLeftThe new position of the left side of the window, in client coordinates.
nTopThe new position of the top side of the window, in client coordinates.

Return value

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To get extended error information, call GetLastError.

AfxSetWindowLocationForDpi is a DPI awre version of AfxSetWindowLocation.

Description

Sets the location of the top left corner of the window, in pixels.The location is relative to the upper-left corner of the client area in the parent window.

Reference

  • Include file AfxWin.inc
  • Defined in AfxNova/AfxWin.inc:2328
  • Documented in Windows/Windows Procedures.md
  • Topic: Windows Procedures