Firemonkey Hints don't work in Delphi Seattle, for a project converted from XE7

南楼画角 提交于 2020-01-07 09:07:29

问题


I opened this demo in Delphi Seattle and it works like it should. When I open my program, and include the demo form it doesnt work. I cannot add hints to my controls.

    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?

Where can i find the code that actually shows the hint??

EDIT : I found the code that shows a Hint. The following works in a new XE-10 Seattle program, but not in a program converted from 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;

回答1:


I had a similar problem with hints in a converted program from XE7 not working in Delphi Seattle.

When I switched on the checkbox "Activate runtime themes" ("Laufzeit-Themes aktivieren" in my German version) (Project --> Options --> Application) the hints appeared!



来源:https://stackoverflow.com/questions/33914667/firemonkey-hints-dont-work-in-delphi-seattle-for-a-project-converted-from-xe7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!