鱼C论坛

 找回密码
 立即注册
查看: 2470|回复: 1

修改D7 hit 提示 变成气泡型的 存在bug 哪位大神懂修?

[复制链接]
发表于 2017-2-22 08:45:04 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
以下去别人的代码

unit SherryHint;

interface

uses
  Windows, Messages, Classes, Controls, Forms, CommCtrl;

type
  THintWin=class(THintWindow)
  private
    FLastActive: THandle;
  public
    procedure ActivateHint(Rect:TRect;Const AHint:string);override;
  end;

implementation

procedure AddTipTool(hWnd: DWORD; IconType: Integer; Title, Text: PChar);
const
  TTS_BALLOON =$0040;
  TTM_SETTITLE=WM_USER + 32;
var
  hWndTip: DWORD;
  ToolInfo: TToolInfo;
begin
  hWndTip:=CreateWindow(TOOLTIPS_CLASS, nil,
          WS_POPUP or TTS_NOPREFIX or TTS_BALLOON or TTS_ALWAYSTIP,
          0, 0, 0, 0, hWnd, 0, HInstance, nil);
  if (hWndTip<>0) then
  begin
    ToolInfo.cbSize:=SizeOf(ToolInfo);
    ToolInfo.uFlags:=TTF_IDISHWND or TTF_SUBCLASS or TTF_TRANSPARENT;
    ToolInfo.uId:=hWnd;
    ToolInfo.lpszText:=Text;
    SendMessage(hWndTip,TTM_ADDTOOL,1,Integer(@ToolInfo));
    SendMessage(hWndTip,TTM_SETTITLE,IconType,Integer(Title));
  end;
  InitCommonControls();
end;

procedure THintWin.ActivateHint(Rect:TRect;const AHint:string);
begin
   
  if FLastActive<>WindowFromPoint(Mouse.CursorPos) then
  AddTipTool(WindowFromPoint(Mouse.CursorPos),0,'说明:', PChar(AHint));//Application.Hint));
  FLastActive:=WindowFromPoint(Mouse.CursorPos);


end;

initialization
Application.HintPause:=0;
Application.ShowHint:=False;
HintWindowClass:=THintWin;
Application.ShowHint:=True;
end.



在use 添加SherryHint  以前的按钮 等hit 提示就变成气泡型了


但是我发现有个bug, 就是比如勾选框那  我改变了Hit 字提示,  放鼠标上去还是之前的文字提示要等几秒或者久一点才刷新 新的hit 提示

有没有大神帮弄一下 修复这个算bug吗。。。
或者有其他好的办法 改变Hit 提示吗。。 网上找了很多,这种类似的,但都存在这个bug,。。要是完美一点就好了。。。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2017-2-22 17:54:29 | 显示全部楼层
不要用D7 学会用XE 以上的版本,这些版本更新也更新Bug 问题,

有外控件 DevExpressVCL15.2.2
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-18 08:44

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表