1. Size of task bar
------=_NextPart_000_0007_01BFCC31.450E6BA0
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Is there any way to get the current size of the task bar?
Pete King
------=_NextPart_000_0007_01BFCC31.450E6BA0
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dwindows-1252" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2722.2800" name=3DGENERATOR></HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Is there any way to get the current size of the task =
bar?</FONT></DIV>
<DIV> </DIV>
------=_NextPart_000_0007_01BFCC31.450E6BA0--
2. Re: Size of task bar
- Posted by Brian Broker <bkb at CNW.COM>
Jun 01, 2000
-
Last edited Jun 02, 2000
On Fri, 2 Jun 2000 01:24:17 +0100, Agent Spectre wrote:
>Is there any way to get the current size of the task bar?
>
>Pete King
>
I wrote this Win32Lib 'add-on' that returns the coordinates of the desktop
work area (usually the 'Screen' size minus the task bar). I wrote this so
that I could center a window or determine the size and location of a
maximized window, taking into consideration the size and location of the
task bar.
-- sysparams.ew
-- This 'add-on' requires Win32Lib.ew by David Cuny
-- Brian K. Broker - APR 2000
-- email: bkb at cnw.com
include Win32Lib.ew
constant
xSystemParameters = linkFunc(user32, "SystemParametersInfoA",
{C_UINT, C_UINT, C_POINTER, C_UINT}, C_LONG),
SPI_GETWORKAREA = 48
-----------------------------------------------------------
global function getWorkarea()
-- Returns: sequence containing the coordinates of the work area,
-- expressed in virtual screen coordinates {x1,y1, x2,y2}
atom workarea
sequence wa_out
-- get pointer for RECT structure to recieve coordinates
workarea = allocate_struct( SIZEOF_RECT )
-- call C function from user32.dll
if not c_func( xSystemParameters, {SPI_GETWORKAREA, 0, workarea, 0} ) then
warnErr( "getWorkarea:SystemParametersInfo failed" )
end if
-- set return sequence
wa_out = { fetch( workarea, rectLeft ), fetch( workarea, rectTop ),
fetch( workarea, rectRight ), fetch( workarea, rectBottom ) }
-- free pointer
free( workarea )
return wa_out
end function
-----------------------------------------------------------
-- hope this helps
-- Brian
3. Re: Size of task bar
...as usual, I played around with Brians code,
, and oddly enuf this
*seems* to do the same thing, win32.hlp, notwithstanding....
constant
full=c_func(xGetSystemMetrics,{SM_CYFULLSCREEN}),
screen=c_func(xGetSystemMetrics,{SM_CYSCREEN}),
caption=c_func(xGetSystemMetrics,{SM_CYCAPTION})
integer taskbar_height
taskbar_height = screen - full - caption
Wolf
----------
4. Re: Size of task bar
LOL, I've been up TOO late !
My example only works for a horizontal task bar ;-(
Wolf
5. Re: Size of task bar
Thanks thats brilliant!
Pete King.
-----Original Message-----
From: Brian Broker <bkb at CNW.COM>
To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU>
Date: Friday, June 02, 2000 2:10 AM
Subject: Re: Size of task bar
>On Fri, 2 Jun 2000 01:24:17 +0100, Agent Spectre wrote:
>
>>Is there any way to get the current size of the task bar?
>>
>>Pete King
>>
>
>I wrote this Win32Lib 'add-on' that returns the coordinates of the desktop
>work area (usually the 'Screen' size minus the task bar). I wrote this so
>that I could center a window or determine the size and location of a
>maximized window, taking into consideration the size and location of the
>task bar.
>
>-- sysparams.ew
>-- This 'add-on' requires Win32Lib.ew by David Cuny
>-- Brian K. Broker - APR 2000
>-- email: bkb at cnw.com
>
>include Win32Lib.ew
>
>constant
> xSystemParameters = linkFunc(user32, "SystemParametersInfoA",
> {C_UINT, C_UINT, C_POINTER, C_UINT}, C_LONG),
> SPI_GETWORKAREA = 48
>
>-----------------------------------------------------------
>
>global function getWorkarea()
> -- Returns: sequence containing the coordinates of the work area,
> -- expressed in virtual screen coordinates {x1,y1, x2,y2}
> atom workarea
> sequence wa_out
>
> -- get pointer for RECT structure to recieve coordinates
> workarea = allocate_struct( SIZEOF_RECT )
>
> -- call C function from user32.dll
> if not c_func( xSystemParameters, {SPI_GETWORKAREA, 0, workarea, 0} )
then
> warnErr( "getWorkarea:SystemParametersInfo failed" )
> end if
>
> -- set return sequence
> wa_out = { fetch( workarea, rectLeft ), fetch( workarea, rectTop ),
> fetch( workarea, rectRight ), fetch( workarea, rectBottom ) }
>
> -- free pointer
> free( workarea )
>
> return wa_out
>end function
>
>-----------------------------------------------------------
>
>-- hope this helps
>-- Brian
>