Menu

Win32-Update TOOLTIP text by EditControl text

2003-01-22
2012-09-26
  • Nobody/Anonymous

    Can anyone give me a hand here?
    I need to detect when the content of Edit_Control_2 has changed (or maybe if the controls has just lost focus, something like that) and update the tooltip for Static_Control_1 with the content of Edit_Control_2.

    Yeah, i know it sound complicated. Its not: I go to the Edit Control, type some text there, move my mouse to a Static Control and the text i have just types in the Edit Control shows as the TOOLTIP for the Static Control. Thats what im trying to do.

    I wont post the entire code here cause the program is huge, but i think you can get what im talking about by this example (hope so).

    I was thinking that maybe i could do it in other way: I could intercept the TTN_NEEDTEXT notification, get the actual content of Edit_Control_1 (with GETTEXT) and update the szText member of the the TOOLTIPTEXT STRUCTURE with that but im just not skilled enough to make it work.

    Anyway, maybe you can have some other ideas or help me make any of the above ideas work if you can post some example or something.

    Thanks!

     
    • Nobody/Anonymous

      Solved lol, i always do that:
      a)waste a hole night trying to figure something out.
      b)give up and post a question
      c)find the answer myself 5 minutes later.

      It sux, anyway heres what i did:

      Im intercepting tcn_selchange at wm_notify to call a updatetooltips() function which gets the content of the edit controls with GETTEXT to strings, sets the ti.lpszText of each TOOLINFO struct by each string i got earlier and sending TTM_ADDTOOL to each tooltip control to activate the whole crap. Done.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.