FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour height of taskbar
Posts: 11
Joined: Thu Nov 24, 2005 04:02 AM
height of taskbar
Posted: Wed Apr 26, 2006 06:03 AM

Can I use getsysmetrics() to retrive the height of the windows taskbar?

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: height of taskbar
Posted: Wed Apr 26, 2006 06:51 AM

Yes, but you have to subtract the value returned by the API SystemParametersInfo() with the argument SPI_GETWORKAREA.

EMG

Posts: 11
Joined: Thu Nov 24, 2005 04:02 AM
height of taskbar
Posted: Fri Apr 28, 2006 05:28 AM

Enrico,

Can you please show me how to do it. What value to use for getsysmetrics()?

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
height of taskbar
Posted: Fri Apr 28, 2006 09:37 AM
This should be a working sample:

#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
Posts: 11
Joined: Thu Nov 24, 2005 04:02 AM
height of taskbar
Posted: Tue May 02, 2006 09:18 AM

Enrico,

As always you been a great help, thanks.

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re:
Posted: Mon Jan 31, 2011 03:36 PM

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...

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Re:
Posted: Mon Jan 31, 2011 07:33 PM
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
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: height of taskbar
Posted: Mon Jan 31, 2011 07:35 PM
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/AeroGlassLegacyWindowsApp.aspx


=====>

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...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: Re:
Posted: Tue Feb 01, 2011 11:02 PM
Enrico,

I think it can be done this way using c++
Code (fw): Select all Collapse
    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

=====>

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...

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: height of taskbar
Posted: Wed Feb 02, 2011 10:10 AM

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

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: height of taskbar
Posted: Wed Feb 02, 2011 02:10 PM

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...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: height of taskbar
Posted: Wed Feb 02, 2011 03:51 PM

=====>

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...

Continue the discussion