GetWindowRect(hwnd,rc);
if(scr)
returnrc;
varparent=..win.getParent(hwnd)
if(parent)
toClientRect(parent,rc);
returnrc;
}
getClientRect=function(hwnd){
varrc=RECT();
GetClientRect(hwnd,rc);
returnrc;
}
setRect=function(hwnd,rc){
setPos(hwnd,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top)
}
getPos=function(hwnd,scr){
varrc=getRect(hwnd,scr);
returnrc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top
}
/**intellisense()
?.getRect=!rect.
!rect.left=左
!rect.top=上
!rect.right=右
!rect.bottom=下
!point.x=x坐标
!point.y=y坐标
?::RECT=!rect.
?::RECT=!point.
endintellisense**/
/**intellisense(win)
toScreen(__/*输入窗口句柄*/,x,y)=将坐标转换为屏幕坐标\n::POINT结构体请直接使用::ClientToScreen
toClient(__/*输入窗口句柄*/,x,y)=将坐标转换为客户坐标\n::POINT结构体请直接使用::ScreenToClient
toScreenRect(__/*输入窗口句柄*/,rc)=将::RECT结构体转换为屏幕坐标
toClientRect(__/*输入窗口句柄*/,rc)=将::RECT结构体转换为客户坐标
getRect(__/*输入窗口句柄*/)=返回窗体相对坐标位置\n对于顶层窗口则等同于屏幕绝对坐标位置\n如需返回屏幕坐标,可以直接使用::GetWindowRect
getRect(__/*输入窗口句柄*/,true)=返回窗体屏幕坐标位置\n返回值为::RECT结构体
setRect(__/*输入窗口句柄*/,rc)=设置窗口相对坐标位置
getClientRect(__/*输入窗口句柄*/)=获取窗口客户区的坐标\n不包括边框等
setPos(.(窗口句柄,x坐标,y坐标,宽,高,插入位置,参数)=调整窗口位置或排序,除句柄外所有参数可选\n同时指定x,y坐标则移动位置\n同时指定宽高则改变大小\n指定插入位置(句柄或_HWND前缀常量)则调整Z序
getPos(__/*输入窗口句柄*/)=返回相对坐标,宽,高\nx,y,cx,cy=win.getPos(hwnd)
getPos(__/*输入窗口句柄*/,true)=返回屏幕坐标,宽,高\nx,y,cx,cy=win.getPos(hwnd)
endintellisense**/
getScreen=function(){
return::GetSystemMetrics(0x0),::GetSystemMetrics(0x1)
}
/**intellisense(win)
getScreen()=返回屏幕宽度、高度
endintellisense**/
varmessageBox=u.api("MessageBoxA","int(inthWnd,stringlpText,stringlpCaption,INTuType)")
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-30959-4.html
小米公关太牛逼了
打垮了北洋舰队的侧翼超勇和扬威号两艘老舰
假货和山寨货横行
空间让我们的心拉距