惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
O
OpenAI News
WordPress大学
WordPress大学
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园_首页
IT之家
IT之家
Last Week in AI
Last Week in AI
Vercel News
Vercel News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
B
Blog
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
P
Proofpoint News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
Schneier on Security
Schneier on Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
N
News and Events Feed by Topic
Google Online Security Blog
Google Online Security Blog
N
News | PayPal Newsroom
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
宝玉的分享
宝玉的分享
The GitHub Blog
The GitHub Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Announcements
Recent Announcements
L
LINUX DO - 最新话题
TaoSecurity Blog
TaoSecurity Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
F
Fortinet All Blogs
罗磊的独立博客
Forbes - Security
Forbes - Security
人人都是产品经理
人人都是产品经理
J
Java Code Geeks
H
Heimdal Security Blog
Help Net Security
Help Net Security
V
V2EX
Security Latest
Security Latest
W
WeLiveSecurity
Attack and Defense Labs
Attack and Defense Labs
H
Help Net Security

博客园 - Enli

IOS 命令行安装备忘 IOS开发备忘 MAC 编制计划任务 弹出式窗口管理单元备忘 Wininet请求包装类简稿 自备工具库 界面方面的备忘 rc资源文件的中英文应用备忘 Wininet下载类初稿 Dephi调用C#编写的WebService的一些问题与解决 (转) 关于Window的快捷方式,图标缓存的清理 Delphi 备忘五 http断点续传的单元 Delphi 代码优化(转) [转载]Delphi的四舍五入函数 同名派生的应用(转) 关于delphi的程序在英文操作系统下乱码问题 - Enli - 博客园 TWebBrowser备忘 组件开发中的技巧(转)
多屏开发的备忘
Enli · 2012-01-31 · via 博客园 - Enli

1. dll里面的form显示位置问题

   需要显示在主程序窗口的屏幕上,可以用下面的方法放到 TForm里面的FormActivate事件里面

var
  HM: HMonitor;
  I: Integer;
  LRect: TRect;
Begin
{$IFDEF STATIC_ADDIN}
  HM := MonitorFromWindow(FContext.MasterPageHandle, MONITOR_DEFAULTTONEAREST);
  if HM > 0 then
  begin
    for I := 0 to Screen.MonitorCount - 1 do
    if Screen.Monitors[I].Handle = HM then
    begin
      LRect := Screen.Monitors[I].WorkareaRect;
      SetBounds(LRect.Left + ((RectWidth(LRect) - Width) div 2),
        LRect.Top + ((RectHeight(LRect) - Height) div 2), Width, Height);
      Break;
    end;
  end;
{$ENDIF}
end;

 也可以直接跟着主程序的窗体走,直接在Formshow里面加

  Left := FContext.MainForm.Left;
  Top := FContext.MainForm.Top;