[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Turning off the hint for a tree node

Posted on 2001-08-20
11
Medium Priority
?
315 Views
Last Modified: 2010-04-04
Hi,
Can anyone tell me how i can turn off the hint that pops up everytime my mouse moves on the tree node of a tree view (provided that it is cut). I want to suppress that. Is there anyway i can accomplish that.
Note: it has nothing to do with Showhint property.

Thanx in advance.
Hammad
0
Comment
Question by:hammadmajeed
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
  • 2
  • +1
11 Comments
 
LVL 4

Accepted Solution

by:
fva earned 800 total points
ID: 6405356
It's a tooltip, not a hint. Very annoying.
My workaround:

unit UTVPatch;
// deactivates tooltip for TTreeView
// Usage: Call PatchTreeView once, after creating the TreeView, somewhere in the Show section of the form (where there is a "true" TreeView handle)

interface

uses Windows,Messages,Classes,ComCtrls,commctrl;

procedure PatchTreeView(atv:TTreeView);

implementation

var FTVList:TList;
    hhook:THandle;

function HookProc(nCode:integer;wPar:WPARAM;lPar:LPARAM):LRESULT;stdcall
var idx:integer;
begin
     if nCode=HC_ACTION then begin
        with PCWPStruct(lPar)^ do begin
             idx:=FTVList.IndexOf(Pointer(hwnd));
             if idx>=0 then begin
                // target is one of our monitored TTreeViews
                if message=WM_NOTIFY then begin
                   if PNMHdr(lParam)^.code=TTN_NEEDTEXTW then begin
                      SendMessage(PNMHdr(lParam)^.hwndFrom,TTM_ACTIVATE,0,0);
                      FTVList.Delete(idx);
                      if FTVList.Count=0 then begin
                         UnhookWindowsHookEx(hhook);
                         hhook:=0;
                      end;
                   end;
                end;
             end;
        end;
        Result:=0;
     end else
        Result:=CallNextHookEx(hhook,nCode,wPar,lPar);
end;

procedure PatchTreeView(atv:TTreeView);
begin
     if FTVList.IndexOf(Pointer(atv.Handle))>=0 then exit;
     FTVList.Add(Pointer(atv.Handle));
     if hhook=0 then
        hhook:=SetWindowsHookEx(WH_CALLWNDPROC,HookProc,0,MainThreadID);
end;

initialization
   FTVList:=TList.Create;
   hhook:=0;
finalization
   FTVList.Free;
   if hhook<>0 then begin
      UnhookWindowsHookEx(hhook);
      hhook:=0;
   end;
end.

Basically it "knocks out" the tooltip window the first time it wants to pop-up.

F.
0
 
LVL 17

Expert Comment

by:inthe
ID: 6405386
i havent tried it but dont see why it wouldnt work:
in object inspector set tooltips to false.

or on a mouse event
treeview1.tooltips := false;
0
 
LVL 4

Expert Comment

by:fva
ID: 6405410
Depends on Delphi version.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:smurff
ID: 6405463
Havent tried it but its what Ive ot listed as doing the job... worth a try.
regards
Smurff

procedure TForm1.FormCreate(Sender: TObject);
 begin
   SetWindowLong(TreeView1.Handle,
                              GWL_STYLE,
                              GetWindowLong(TreeView1.Handle,GWL_STYLE) or $80);
 end;
0
 
LVL 4

Expert Comment

by:fva
ID: 6405494
Well, I admit, I was overkilling. Version 4.70 and above of commctrl (I think IE 3.0 and above) support the TVS_NOTOOLTIPS which is $80 and unless you are using a very old version of the library smurff is right.

F.
0
 
LVL 4

Expert Comment

by:fva
ID: 6405501
And it works, too. Nice to learn new things.
0
 

Author Comment

by:hammadmajeed
ID: 6407198
the codes u ppl wrote only work in win2k, if u try that code in win95/98, it still is displaying tooltip. i think it is coz of older version of commctrl, is it right?

Hammad
0
 
LVL 4

Expert Comment

by:fva
ID: 6408747
Installing a newer Internet Explorer (e.g. 5.0 or later) _will_ fix it even on 95/98.

F.
0
 

Author Comment

by:hammadmajeed
ID: 6409304
cant it is possible with the default version that is installed with 95/98(without any kind of upgradation).

Hammad
0
 
LVL 3

Expert Comment

by:smurff
ID: 6409509
I guess not. If the functions not in the .dll then you`ll have to upgrade if you want this functionality. If I were you put something in your app. that will check the version number and if its the wrong one then automatically run the upgrade.

regards
Smurff
0
 
LVL 4

Expert Comment

by:fva
ID: 6412495
Thank you Hammad for accepting my comment as answer. It's a nice thing to get points while learning new tricks, too :)

F.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question