首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > PB >

取操作系统开始工具栏的高度,该如何处理

2013-01-05 
取操作系统开始工具栏的高度如题[解决办法]声明APIFUNCTION ulong FindWindow(ref string lpClassName,ref

取操作系统开始工具栏的高度
如题
[解决办法]
声明API

FUNCTION ulong FindWindow(ref string lpClassName,ref string lpWindowName) LIBRARY "user32.dll" ALIAS FOR "FindWindowA"
 
FUNCTION ulong GetClientRect(ulong hwnd,ref RECT lpRect) LIBRARY "user32.dll"


定义结构体 rect
global type rect from structure
longleft
longtop
longright
longbottom
end type


代码如下:

Long Getwnd
RECT Rect1
string ls, ls_classname = 'Shell_TrayWnd'
Getwnd   =   FindWindow( ls_classname,   ls) 
if getwnd > 0 then
GetClientRect(Getwnd,   Rect1 )
MessageBox('提示', "任务栏高度:" + string(Rect1.Bottom) + '像素~r~n任务栏宽度:' + string( Rect1.Right) + '像素')
end if

[解决办法]
在 Getwnd   =   FindWindow( ls_classname,   ls) 
前加上 SetNull(ls) 试试

热点排行