enter image description hereI am working on a robotics graphic application and I am trying to create a window and resize the window based on the windows client rect size.
Basically I have a number of cells (matrix or 2d array ) which is currently 21×21 which I plot in the client area with pdc->Rectangle( LocalMapCellRect ); this drawing a single cell based on current Brush and Pen. The size of the cells being the client size divided by the number of cells X or Y. See image
My problem is two fold:
(One) Creating/sizing the windows to a sized based on a required client size when the window is initially created. Currently I bodge it with:
int InitialWindowSize_X = 420;
int InitialWindowSize_Y = 400;
SetWindowPos( &wndNoTopMost , 50, 250, InitialWindowSize_X , InitialWindowSize_Y , 0 );
(Two)
When I use the mouse to resize the window frame I can’t figure out how to have the client size drive the window size so I don’t have an undrawn area. See image
I have found a function called AdjustWindowRect() which is supposed to adjust the Window size to the required client size but I can’t get it to work.
I have spent hours on this and am simply stuck so some guidance please or even better a coding example would be wonderful.
Many thanks in advance IMK
enter image description here