Can I use getsysmetrics() to retrive the height of the windows taskbar?
Can I use getsysmetrics() to retrive the height of the windows taskbar?
Yes, but you have to subtract the value returned by the API SystemParametersInfo() with the argument SPI_GETWORKAREA.
EMG
Enrico,
Can you please show me how to do it. What value to use for getsysmetrics()?
#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 ENDDUMPEnrico,
As always you been a great help, thanks.
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...
=====>
Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala
FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10
FiveWin, One line of code and it's done...
Bayron wrote:This same function SystemParametersInfo() can be used to set the height of the top window border.. Am I right???

=====>
Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala
FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10
FiveWin, One line of code and it's done...

  if ( !IsThemeNull() )
    GetThemeSysFont ( TMT_MSGBOXFONT, &lf );
  else
    {
    NONCLIENTMETRICS ncm = { sizeof(NONCLIENTMETRICS) };
    SystemParametersInfo ( SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, false );
    lf = ncm.lfMessageFont;
    }=====>
Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala
FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10
FiveWin, One line of code and it's done...
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
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....
=====>
Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala
FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10
FiveWin, One line of code and it's done...
=====>
Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala
FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10
FiveWin, One line of code and it's done...