吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1077|回复: 0
收起左侧

[求助] 让菜单提示消失的代码加在哪里呢?

[复制链接]
冥界3大法王 发表于 2021-4-18 18:47
本帖最后由 冥界3大法王 于 2021-4-18 20:01 编辑

[Delphi] 纯文本查看 复制代码
  
    Application.ShowHint := False;



[Delphi] 纯文本查看 复制代码

  { Private declarations }
  public
    HintWindow: THintWindow;
    procedure DisplayHint(Sender: TObject);
    { Public declarations }
  end;


var
  Form1: TForm1;
  ID: Integer;
  id_A1: Integer;  //为Ctrl+下箭头定义一个变量
  p: TPoint;       //在光标处弹出我们的菜单来

uses
  ActnList, Clipbrd, ShellAPI;


procedure TForm1.DisplayHint(Sender: TObject);
var
  point1: TPoint;
  width: integer;
  size1: size;
  hintstr: string;
begin
  hintstr := GetLongHint(application.Hint);
  if hintstr <> '' then
  begin
    //计算宽度;
    GetTextExtentPoint32(getdc(form1.Handle), pchar(hintstr), length(hintstr) + 6, size1);
    getcursorpos(point1);
    //得到位置;
    HintWindow.ActivateHint(Rect(point1.x, point1.y, point1.X + size1.cx, point1.y + size1.cy + 6), hintstr);
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.ShowHint := true;
  Application.OnHint := DisplayHint;
  HintWindow := THintWindow.Create(self);
end;


procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  if Assigned(HintWindow) then
    HintWindow.ReleaseHandle;
end;

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止回复与主题无关非技术内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-4-20 12:03

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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