PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: AfxGetWindowSize  (Read 157 times)

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8747
  • Windows 10
    • PlanetSquires Software
AfxGetWindowSize
« on: January 02, 2019, 12:47:48 PM »

Hi Jose,

While working on some resize code, I noticed that there is not a AfxGetWindowSize function. There are separate functions for AfxGetWindowWidth and AfxGetWindowHeight and also a AfxSetWindowSize. It would be convenient to have a AfxSetWindowSize and including such a function would also help parallel the AfxGetWindowLocation and AfxSetWindowLocation functionality.

I know that you can easily code such a function but for convenience I have it below based other code from your library.

Code: [Select]
' ========================================================================================
' Gets the width and height of the window, in pixels.
' ========================================================================================
PRIVATE SUB AfxGetWindowSize (BYVAL hwnd AS HWND, BYREF nWidth AS LONG, BYREF nHeight AS LONG)
   DIM rc AS RECT
   ' // Get the dimensions of the window
   GetWindowRect(hwnd, @rc)
   ' // Return the width and height values
   nWidth = rc.Right - rc.Left
   nHeight = rc.Bottom - rc.Top
END SUB
' ========================================================================================
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Josť Roca

  • Moderator
  • Guru Member
  • *****
  • Posts: 3164
Re: AfxGetWindowSize
« Reply #1 on: January 03, 2019, 12:54:46 PM »

I have added it.