【问题标题】:Firemonkey Hints don't work in Delphi Seattle, for a project converted from XE7对于从 XE7 转换的项目,Firemonkey 提示在 Delphi 西雅图不起作用
【发布时间】:2016-02-28 03:13:30
【问题描述】:

我在 Delphi 西雅图打开了 this 演示,它的工作原理应该是这样。 当我打开我的程序并包含它不起作用的演示表单时。我无法向我的控件添加提示。

    procedure TMainForm.FormCreate(Sender: TObject);
      application.ShowHint:=true;
      application.OnHint :=OnApplicationHint;
    end;

    procedure TMainForm.OnApplicationHint(Sender: TObject);
    begin
      caption := (Application.Hint);
    end;

My program is converted from XE7 to Seattle. So what could be the difference?

我在哪里可以找到实际显示提示的代码??

编辑:我找到了显示提示的代码。以下适用于新的 XE-10 Seattle 程序,但不适用于从 XE-7 转换的程序。

var
  LToolInfo: TOOLINFO;

  FNativeControlHandle,
  FToolTipHandle: HWND;
begin
 FNativeControlHandle := WindowHandleToPlatform(form1.Handle).Wnd;
  if FNativeControlHandle <> 0 then begin
    FToolTipHandle := CreateWindowEx(0, TOOLTIPS_CLASS, nil, WS_POPUP or TTS_ALWAYSTIP, 0, 0, 300, 300,FNativeControlHandle, 0, hInstance, nil);


    SetWindowPos(FToolTipHandle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE);

    FillChar(LToolInfo, SizeOf(TOOLINFO), 0);
    LToolInfo.cbSize := SizeOf(TOOLINFO);
    LToolInfo.uFlags := TTF_SUBCLASS or TTF_IDISHWND or TTF_PARSELINKS;
    LToolInfo.hinst := hInstance;
    LToolInfo.hwnd := FNativeControlHandle;
    LToolInfo.uId := FNativeControlHandle;
    LToolInfo.lpszText := PWideChar('Hint');


    SendMessage(FToolTipHandle, TTM_ADDTOOL, 0, LPARAM(@LToolInfo));
    SendMessage(FToolTipHandle, TTM_ACTIVATE, NativeInt(True), LPARAM(@LToolInfo));
  end;

【问题讨论】:

  • 您找到解决方案了吗? - 我有同样的问题。
  • 不,我暂时搁置了这个问题。当我找到解决方案时,我会更新这个问题。
  • 我在将 XE8 上的提示转换为柏林时遇到了类似的问题,我通过重新创建 .dproj 文件解决了这个问题。不是最优雅的解决方案,但它比搜索 .dproj 更快。另一个问题是更改表单的 BorderIcons 时提示消失了。经过一番调试,我发现了问题stackoverflow.com/questions/41603480/…

标签: delphi firemonkey hint delphi-10-seattle


【解决方案1】:

我在来自XE7 的转换程序中的提示在Delphi Seattle 中不起作用时遇到了类似的问题。

当我打开复选框 "Activate runtime themes"(我的德语版本中的“Laufzeit-Themes aktivieren”)(Project --&gt; Options --&gt; Application)时,提示出现了!

【讨论】:

  • 现在无法确认,稍后再测试!
  • 我已经对此进行了测试,它似乎确实很重要。当我创建一个新的西雅图程序并将其关闭时,提示不显示。它在我转换的 XE7 程序中被关闭。但是当我打开它时,它们仍然不显示。但是,它们确实会发出提示
猜你喜欢
  • 2017-05-26
  • 1970-01-01
  • 1970-01-01
  • 2014-11-05
  • 1970-01-01
  • 1970-01-01
  • 2016-10-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多