Hi Claudio,
I have found difference to use C_CENTER function specially when I try with GETDESKTOPREAL at maximum size.
Difference exists at y = GetSystemMetrics(SM_CYSCREEN) thru taking rect by GetWindowRect and y = rect.bottom - rect.top thru taking rect by SystemParametersInfo( SPI_GETWORKAREA, 1, &rect, 0 )
Would you agree with this replacement at:
y = GetSystemMetrics(SM_CYSCREEN);
by this:
SystemParametersInfo( SPI_GETWORKAREA, 1, &rect, 0 );
y = rect.bottom - rect.top;
I made this changing and working in properly.
I guess that our actual C_CENTER function is considering the window's title height and do not make the right centralizing.
<WindowName>.Center
Moderator: Rathinagiri
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
<WindowName>.Center
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: <WindowName>.Center
I will check this function.
The difference between: GetSystemMetrics(SM_CYSCREEN) - SystemParametersInfo (SPI_GETWORKAREA) = taskbar height
The difference between: GetSystemMetrics(SM_CYSCREEN) - SystemParametersInfo (SPI_GETWORKAREA) = taskbar height
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
<WindowName>.Center
Thank you Claudio, will be appreciated.srvet_claudio wrote:I will check this function
Also thank for your info, I forgot to check this because I was without internet during all that morning.srvet_claudio wrote:The difference between: GetSystemMetrics(SM_CYSCREEN) - SystemParametersInfo (SPI_GETWORKAREA) = taskbar height
Simple test, you will see the difference.
Code: Select all
#include <hmg.ch>
Function Main()
DEFINE WINDOW Form_1 MAIN ;
TITLE "Form with GETDESKTOPREAL size demo"
END WINDOW
Form_1.Center
Form_1.Activate
Return Nil
P.S. Running on Win7 32bits and in classic mode.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein