PlanetSquires Forums

Support Forums => WinFBX - Windows Framework for FreeBASIC => Topic started by: Paul Squires on January 02, 2019, 12:47:48 PM

Title: AfxGetWindowSize
Post by: Paul Squires 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
' ========================================================================================
Title: Re: AfxGetWindowSize
Post by: Josť Roca on January 03, 2019, 12:54:46 PM
I have added it.