1,076
社区成员
发帖
与我相关
我的任务
分享
string ls_ClassName, ls_WindowName
long ll_null, ll_toolbar
ls_ClassName = "FNFIXEDBAR115"
SetNull(ls_WindowName)
SetNull(ll_NULL)
ll_toolbar = FindWindowEXA( Handle(w_name), ll_NULL, ls_ClassName, ls_WindowName )
//获取toolbar工具栏的宽度和高度
RECT Rect1
GetClientRect(ll_toolbar, Rect1 ) //rect是自定义一个结构体,分为left,top,right,bottom四个参数,都是long型的。
long ll_handle
ws_position lws_pointapi[]
// 工具条坐标参数
int li_xpos, li_ypos, li_width
li_xpos = 2
li_ypos = 2
li_width = 3 //该长度,用来去掉toolbar右边的边框
//工具条左上原点
lws_pointapi[1].xpos = li_xpos
lws_pointapi[1].ypos = li_ypos
//工具条右上原点
lws_pointapi[2].xpos=Rect1.Right - li_width
lws_pointapi[2].ypos = li_ypos
//工具条右下原点
lws_pointapi[3].xpos = Rect1.Right - li_width
lws_pointapi[3].ypos =Rect1.Bottom
//工具条左上下原点
lws_pointapi[4].xpos = li_xpos
lws_pointapi[4].ypos = Rect1.bottom
ll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)
//其中第 1 个参数为多边形各个顶点坐标值的数组
//其中第 2 个参数为多边形边数,可修改,配合数组值
//其中第 3 个参数为填充模式 ALTERNATE /WINDING
SetwindowRgn(ll_toolbar, ll_handle, true)
////////////////////////////////////////////////////////////////////////////////////////
声明结构体rect ,带四个long型参数,分别是left ,top,right,bottom
///////////////////////////////////////////////////////////////////////////////////////
声明 globle extrend function
function long FindWindowExA( long hParent, long hChildAfter, String lpszClass, String lpszWindow ) Library "user32.dll" alias for "FindWindowExA;Ansi"
Function ulong CreatePolygonRgn (ref ws_position lppt[], int cPoints, int fnPolyFillMode ) Library "gdi32.dll"
FUNCTION ulong SetWindowRgn(ulong hWnd,ulong hRgn,boolean bRedraw) LIBRARY "user32.dll"
FUNCTION ulong GetClientRect(ulong hwnd,ref RECT lpRect) LIBRARY "user32.dll"
////////////////////////////////////////////////
最后感谢老大的支持
//工具栏的宽度和高度
long ll_toolbar_weight
ll_toolbar_weight = 850
string ls_ClassName, ls_WindowName
long ll_null, ll_toolbar
ls_ClassName = "FNFIXEDBAR115"
SetNull(ls_WindowName)
SetNull(ll_NULL)
ll_toolbar = FindWindowEXA( Handle(this), ll_NULL, ls_ClassName, ls_WindowName )
//工具栏的宽度和高度
long ll_toolbar_weight
ll_toolbar_weight = 850 //关键这个数值,我是一点一点实验出来的,否则还是要带边框,但实在不解,这个数值能不能用程序得到?
long ll_toolbar_hegith =310
long ll_handle
ws_position lws_pointapi[]
// 图形2
int li_xpos, li_ypos, li_width, li_height
li_xpos = 2
li_ypos = 2
lws_pointapi[1].xpos = li_xpos
lws_pointapi[1].ypos = li_ypos
lws_pointapi[2].xpos = UnitsToPixels(ll_toolbar_weight, xunitstopixels!)
lws_pointapi[2].ypos = li_ypos
lws_pointapi[3].xpos = UnitsToPixels(ll_toolbar_weight, xunitstopixels!)
lws_pointapi[3].ypos = UnitsToPixels(ll_toolbar_hegith, yunitstopixels!)
lws_pointapi[4].xpos = li_xpos
lws_pointapi[4].ypos = UnitsToPixels(ll_toolbar_hegith, yunitstopixels!)
ll_handle = CreatePolygonRgn(lws_pointapi[], 4, 1)
//其中第 1 个参数为多边形各个顶点坐标值的数组
//其中第 2 个参数为多边形边数,可修改,配合数组值
//其中第 3 个参数为填充模式 ALTERNATE /WINDING
SetwindowRgn(ll_toolbar, ll_handle, true)
//return 1