怎样把我调用的系统计算器居于屏幕的中间,或当前窗口的中间

xdxycx 2003-07-14 11:26:16
谢谢
...全文
87 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Eastunfail 2003-07-14
  • 打赏
  • 举报
回复
var Calc:HWND;CalcRec:TRect;x,y,w,h:Integer;
begin
WinExec('calc.exe',SW_NORMAL);
Calc:=FindWindow('SciCalc',nil);
if calc=0 then exit;
GetWindowRect(Calc,CalcRec);
w:=CalcRec.Right -CalcRec.Left ;
h:=CalcRec.Bottom -CalcRec.Top;
x:=Trunc((Screen.DesktopRect.Right -w)/2);
y:=Trunc((Screen.DesktopRect.Bottom -h)/2);
SetWindowPos(Calc,0,x,y,w,h ,0);

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧