stc_rect lstc_parent //父窗口的
边坐标
stc_rect lstc_child //子窗口的边坐标
//值为时认为是桌面
if hwndp = then hwndparent = GetDesktopWindow ( )
//获得窗口的边坐标
if not GetWindowRect ( hwndcurrent lstc_child ) then return false
if not GetWindowRect ( hwndparent lstc_parent ) then return false
li_x = (( lstc_parentright - lstc_parentleft ) -( lstc_childright -lstc_childleft )) /
li_y = (( lstc_parentbottom - lstc_parenttop ) - ( lstc_childbottom -lstc_childtop )) /
//计算子窗口的XY坐标
if li_x < or li_y < then return false
//移动子窗口
if not MoveWindow ( hwndcurrent li_x li_y lstc_childright -lstc_childleft lstc_childbottom - lstc_childtop false ) then return false
return true
本文代码在PB 下通过
[] [] []