height of taskbar

height of taskbar

Postby Johnny Yiu » Wed Apr 26, 2006 6:03 am

Can I use getsysmetrics() to retrive the height of the windows taskbar?
Johnny Yiu
 
Posts: 11
Joined: Thu Nov 24, 2005 4:02 am

Re: height of taskbar

Postby Enrico Maria Giordano » Wed Apr 26, 2006 6:51 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8338
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Johnny Yiu » Fri Apr 28, 2006 5:28 am

Enrico,

Can you please show me how to do it. What value to use for getsysmetrics()?
Johnny Yiu
 
Posts: 11
Joined: Thu Nov 24, 2005 4:02 am

Postby Enrico Maria Giordano » Fri Apr 28, 2006 9:37 am

This should be a working sample:

Code: Select all  Expand view
#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
User avatar
Enrico Maria Giordano
 
Posts: 8338
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Johnny Yiu » Tue May 02, 2006 9:18 am

Enrico,

As always you been a great help, thanks.
Johnny Yiu
 
Posts: 11
Joined: Thu Nov 24, 2005 4:02 am

Re:

Postby Bayron » Mon Jan 31, 2011 3: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
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: Re:

Postby Enrico Maria Giordano » Mon Jan 31, 2011 7: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
User avatar
Enrico Maria Giordano
 
Posts: 8338
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: height of taskbar

Postby Bayron » Mon Jan 31, 2011 7: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


Image
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: Re:

Postby Bayron » Tue Feb 01, 2011 11:02 pm

Enrico,
Image
I think it can be done this way using c++
Code: Select all  Expand view
   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
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: height of taskbar

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8338
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: height of taskbar

Postby Bayron » Wed Feb 02, 2011 2: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
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: height of taskbar

Postby Bayron » Wed Feb 02, 2011 3:51 pm

=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Adolfo, Google [Bot] and 13 guests