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

Posted on 2006-04-01
Last Modified: 2012-08-13
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
    Left := 0;
    Top := 10;
    Text := 'Help me No 1';

this is for remove of the Hintwindow

 for i := 0 to 8 do begin

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

Question by:erwingosepa
    LVL 65

    Expert Comment

    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
    LVL 8

    Accepted Solution

    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

      HintWnd :array[0..8] of THintwindow;
      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
              Left := 0;
              Top := 10;
              Text := 'Help me No 1';
       end; // for loop


      for i := Low(HintWnd) to High(HintWnd) do begin




    Author Comment

    nepostojeci the only thing missing is that the Hintwindows are not showing on the screen.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Title # Comments Views Activity
    improve Shell script 5 115
    wait notify demo infinite loop 3 67
    scoreUp challenge 14 40
    Excel object stays open 19 56
    I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
    Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now