Page 1 of 1
height of taskbar
Posted: Wed Apr 26, 2006 6:03 am
by Johnny Yiu
Can I use getsysmetrics() to retrive the height of the windows taskbar?
Re: height of taskbar
Posted: Wed Apr 26, 2006 6:51 am
by Enrico Maria Giordano
Yes, but you have to subtract the value returned by the API SystemParametersInfo() with the argument SPI_GETWORKAREA.
EMG
Posted: Fri Apr 28, 2006 5:28 am
by Johnny Yiu
Enrico,
Can you please show me how to do it. What value to use for getsysmetrics()?
Posted: Fri Apr 28, 2006 9:37 am
by Enrico Maria Giordano
This should be a working sample:
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
? GETTASKBARHEIGHT()
RETURN NIL
#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"
HB_FUNC( GETTASKBARHEIGHT )
{
RECT rct;
LONG nHDiff, nVDiff;
SystemParametersInfo( SPI_GETWORKAREA, 0, &rct, 0 );
nHDiff = GetSystemMetrics( SM_CXSCREEN ) - ( rct.right - rct.left );
nVDiff = GetSystemMetrics( SM_CYSCREEN ) - ( rct.bottom - rct.top );
if ( nHDiff > 0 )
hb_retnl( nHDiff );
else
hb_retnl( nVDiff );
}
#pragma ENDDUMP
EMG
Posted: Tue May 02, 2006 9:18 am
by Johnny Yiu
Enrico,
As always you been a great help, thanks.
Re:
Posted: Mon Jan 31, 2011 3:36 pm
by Bayron
Enrico,
This same function SystemParametersInfo() can be used to set the height of the top window border.. Am I right???
Do you think you can help me with it????? I am building a Touch Screen App, the default sysmenu is too small for that...
Re: Re:
Posted: Mon Jan 31, 2011 7:33 pm
by Enrico Maria Giordano
Bayron wrote:This same function SystemParametersInfo() can be used to set the height of the top window border.. Am I right???
No, as far as I know.
EMG
Re: height of taskbar
Posted: Mon Jan 31, 2011 7:35 pm
by Bayron
Thnx Enrico...
I found a way of doing what I need, but I don't know anything about C
http://www.codeproject.com/KB/vista/Aer ... wsApp.aspx
Re: Re:
Posted: Tue Feb 01, 2011 11:02 pm
by Bayron
Enrico,
I think it can be done this way using c++
Code: Select all
if ( !IsThemeNull() )
GetThemeSysFont ( TMT_MSGBOXFONT, &lf );
else
{
NONCLIENTMETRICS ncm = { sizeof(NONCLIENTMETRICS) };
SystemParametersInfo ( SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, false );
lf = ncm.lfMessageFont;
}
***********************************
from MSDN:
SPI_GETNONCLIENTMETRICS
0x0029
Retrieves the metrics associated with the nonclient area of nonminimized windows. The pvParam parameter must point to a NONCLIENTMETRICS structure that receives the information. Set the cbSize member of this structure and the uiParam parameter to sizeof(NONCLIENTMETRICS).
Public Domain Code from:
http://www.codeproject.com/KB/vista/VGGlassIntro.aspx
Re: height of taskbar
Posted: Wed Feb 02, 2011 10:10 am
by Enrico Maria Giordano
Yes, I was wrong: according to MSDN, SystemParametersInfo() can also be used to set the parameters but I never done it and can't help you, sorry.
EMG
Re: height of taskbar
Posted: Wed Feb 02, 2011 2:10 pm
by Bayron
Enrico,
Thanks a lot anyway; at least it's a start, maybe someone else may help...
I know that Laiton is working with FiveTechSoft to implement something like this to FiveWin....
Re: height of taskbar
Posted: Wed Feb 02, 2011 3:51 pm
by Bayron