Results 1 to 3 of 3

Thread: is there an api call to get tooltip text?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2000
    Posts
    215
    Hiyas,

    I was just wondering if there was an api call to actually get the tooltip text of an object on another window when you have the objects hwnd.

    any help is appreciated.

    thanx.

  2. #2
    Lively Member
    Join Date
    Aug 2000
    Location
    quebec
    Posts
    81

    Cool

    once you have a handle to the object you can use the API
    to tooltip functions to manipulate it in just about any
    way you wish. You can add a tooltip to an object using the
    TTM_ADDTOOL message with a CreateWindow call.

    Check out this page for examples:

    http://msdn.microsoft.com/library/ps...ngTooltips.htm

    Declare :
    Type TOOLINFO
    cbSize As Long ' sizeof structure
    uFlags As Long ' see TTM_ constants
    hwnd As Long ' Handle to the window that contains the tool
    uId As Long ' uId must specify the window handle to the tool
    r As RECT ' Tool's bounding rectangle coordinates
    hinst As Long ' pointer to string resource or null
    lpszText As String ' buffer that contains the text
    lParam As Long
    End Type

    fill in the structure

    Dim ti as TOOLINFO

    After this you can use call like:

    SendMessage(hWnd,TTM_ADDTOOL, 0, ti)

    to create the tooltip.

    To get the values for the TTM_ constants you'll have to sift through the SDK .h files since I don't think they're
    available on the ms site.

    Hope this helps.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2000
    Posts
    215
    thanx for all the info hitcga

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width