当然能,不过你要在application的onshowhint事件中进行处理

解决方案 »

  1.   

    My_first(海浪) :能把你的程序给我mail一份吗?  [email protected]  谢谢!
      

  2.   

    我的email是[email protected] 把原码给我就给分!!!
      

  3.   

    去下载一个我的软件试试如何?您立该就能看到具有图形的Hint,源码本人暂时还舍不得,不过我可以把我的实现方法对所有关心此问题的朋友公开。
    如果您喜欢请到www.netgocn.com
      

  4.   

    以下是我的一段源码,原来是要修改Hint内容的,
    现修改为图片
    unit unt1;interface
    uses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, math,
      ExtCtrls, StdCtrls, comCtrls;Type
      TMyHintWindow = Class(THintWindow)
      private
        FRegion: THandle;
        Fbmp: TBitmap;
        Procedure  FreeCurrentRegion;
      public
        constructor Create(AOwner: TComponent); override;
        procedure ActivateHint(Rect: TRect; Const AHint: string); override;
        procedure Paint; override;
      end;implementation{ TMyHintWindow }procedure TMyHintWindow.ActivateHint(Rect: TRect; const AHint: string);
    begin
      With Rect do
      begin
        Right := Left + Fbmp.Width;
        Bottom := Top + Fbmp.Height;
      end;
      BoundsRect := Rect;
      FreeCurrentRegion;
      with BoundsRect do
        Fregion := CreateRectRgn(0, 0, Width, height);
      if Fregion <> 0 then
        SetWindowRgn(Handle, FRegion, True);
      Inherited;
    end;constructor TMyHintWindow.Create(AOwner: TComponent);
    begin
      inherited;
      Fbmp.LoadFromFile(''); //代替的图片
    end;procedure TMyHintWindow.FreeCurrentRegion;
    begin
      if Fregion <> 0 then
      begin
        SetWindowRgn(Handle, 0, True);
        DeleteObject(Fregion);
        Fregion := 0;
      end;
    end;procedure TMyHintWindow.Paint;
    var
      r: Trect;
      pt: PaintStruct;
    begin
      r := Rect(Fbmp.Left, Fbmp.Top, Fbmp.Left + Fbmp.Width, Fbmp.Top + Fbmp.Height);
      BeginPaint(handle, pt);
      Canvas.CopyRect(FRegion, FBmp.Canvas, r);
      EndPaint(Handle, pt);
    end;initialization  if Application <> nil then
      begin
        Application.ShowHint := False;
        HintWindowClass := TMyHintWindow;
        Application.ShowHint := True;
      end;finalizationend.
      

  5.   

    不好意思,上面的未测试,新修改为
    unit unt1;interface
    uses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, math,
      ExtCtrls, StdCtrls, comCtrls;Type
      TMyHintWindow = Class(THintWindow)
      private
        FRegion: THandle;
        Fbmp: TBitmap;
        Procedure  FreeCurrentRegion;
      public
        constructor Create(AOwner: TComponent); override;
        Destructor Destroy; override;
        procedure ActivateHint(Rect: TRect; Const AHint: string); override;
        procedure Paint; override;
      end;implementation{ TMyHintWindow }procedure TMyHintWindow.ActivateHint(Rect: TRect; const AHint: string);
    begin
      With Rect do
      begin
        Right := Left + Fbmp.Width;
        Bottom := Top + Fbmp.Height;
      end;
      BoundsRect := Rect;
      FreeCurrentRegion;
      with BoundsRect do
        Fregion := CreateRectRgn(0, 0, Width, height);
      if Fregion <> 0 then
        SetWindowRgn(Handle, FRegion, True);
      Inherited;
    end;constructor TMyHintWindow.Create(AOwner: TComponent);
    begin
      inherited;
      Fbmp := TBitmap.Create;
      Fbmp.LoadFromFile(''); //代替的图片
    end;destructor TMyHintWindow.Destroy;
    begin
      FBmp.Free;
      inherited;
    end;procedure TMyHintWindow.FreeCurrentRegion;
    begin
      if Fregion <> 0 then
      begin
        SetWindowRgn(Handle, 0, True);
        DeleteObject(Fregion);
        Fregion := 0;
      end;
    end;procedure TMyHintWindow.Paint;
    var
      r: Trect;
      pt: PaintStruct;
    begin
      r := Rect(0, 0, Fbmp.Width, Fbmp.Height);
      BeginPaint(handle, pt);
      Canvas.CopyRect(Self.BoundsRect, FBmp.Canvas, r);
      EndPaint(Handle, pt);
    end;initialization  if Application <> nil then
      begin
        Application.ShowHint := False;
        HintWindowClass := TMyHintWindow;
        Application.ShowHint := True;
      end;finalizationend.
      

  6.   

    基本方法是正确的,提问者应该给分。不过没有必要用
    initialization ....
    这段代码。