提示形式和焦点

发布于 2025-01-02 16:25:38 字数 229 浏览 6 评论 0原文

我正在显示自定义表单作为提示。我希望提示窗口不获得焦点。

提示表单的 Enabled 属性设置为 False,我还处理 WM_MOUSE_ACTIVATE 窗口消息并返回 MA_NOACTIVATE。然而,每次显示提示窗口时,我的主窗口的边框都会闪烁(Windows 7 具有透明边框)。

如何避免这种闪烁?

I am displaying a custom form as a hint. I want the hint window not to get the focus.

Enabled property of the hint form is set to False and I also handle the WM_MOUSE_ACTIVATEwindow message and return MA_NOACTIVATE. Nevertheless each time the hint window is displayed the border of my main window flickers (Windows 7 with transparent borders).

How can I avoid this flickering?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

念三年u 2025-01-09 16:25:38

我假设您在处理 Application.OnShowHint 时显示自己的提示表单,如下所示:

procedure TMainForm.ApplicationShowHint(var HintStr: string;
  var CanShow: Boolean; var HintInfo: THintInfo);
var
  HintForm: THintForm;
begin
  CanShow := False;
  HintForm := THintForm.Create(nil);
  HintForm.HintLabel.Caption := HintStr;
  HintForm.Left := HintInfo.HintPos.X;
  HintForm.Top := HintInfo.HintPos.Y;
  ShowWindow(HintForm.Handle, SW_SHOWNOACTIVATE);
end;

最后一行使用 D7 来解决这个问题(并使用 THintFrom 作为正常的在 XP 和 W7 上使用默认设置(例如 Enabled = True)的表单。

I assume you show your own hint form when you handle Application.OnShowHint, e.g. as follows:

procedure TMainForm.ApplicationShowHint(var HintStr: string;
  var CanShow: Boolean; var HintInfo: THintInfo);
var
  HintForm: THintForm;
begin
  CanShow := False;
  HintForm := THintForm.Create(nil);
  HintForm.HintLabel.Caption := HintStr;
  HintForm.Left := HintInfo.HintPos.X;
  HintForm.Top := HintInfo.HintPos.Y;
  ShowWindow(HintForm.Handle, SW_SHOWNOACTIVATE);
end;

That last line does the trick here with D7 (and with a THintFrom as a normal form with default settings, e.g. Enabled = True) on XP and W7.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文