How to display multiple THintwindows and them remove the from the screen. for example when hit a button.

Could some body help with some code for display multiple THintwindows and them remove the from the screen.

this is for creation of the Hintwindow

 for i := 0 to 8 do begin
  with THintwindow.create(self) do
  Begin
    Left := 0;
    Top := 10;
    Text := 'Help me No 1';
    Show;
   end;
   end;
 end;


this is for remove of the Hintwindow

 for i := 0 to 8 do begin
   THintwindow.ReleaseHandle;
 end

it will remove only one. I want it to remove all.


erwingosepaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rockiroadsCommented:
Is this like Delphi code or something. Apologies if Im talking crap. Just trying to help by making educated guesses.

Not really a Delphi expert, but looking at your code

does the first loop create 9 windows?
if so, does THintwindow.create return a value, this value representing the handle of the window? Are these handle values different or same?

reason why I say this is because your close loop just specifies releasing something but not sure what. Is it supposed to delete all open windows

If create returns different handle values then perhaps you need to capture all the window handles created by the create call
nepostojeci_emailCommented:
wow, you're doing it in a very wrong way!

you are creating hint windows without keeping the info about any
of it, and with "THintwindow.ReleaseHandle" you actually destroy
the last created window, because of the luck.

here is a proper way to go with:

// make this a global variable

var
  HintWnd :array[0..8] of THintwindow;
...
begin
  for i := Low(HintWnd) to High(HintWnd) do begin
  // same as:  "for i := 0 to 8 do begin" but better if you change the limits later
      HintWnd[i] := THintWindow.Create(nil);
      with HintWnd[i] do
      Begin
          Left := 0;
          Top := 10;
          Text := 'Help me No 1';
          Show;
      End;
   end; // for loop

...

  for i := Low(HintWnd) to High(HintWnd) do begin
     HintWnd[i].ReleaseHandle;
...

end


 end;



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
erwingosepaAuthor Commented:
nepostojeci the only thing missing is that the Hintwindows are not showing on the screen.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.