AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tooltip with hwnd

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
haichen



Joined: 05 Feb 2007
Posts: 99
Location: Osnabrück, Germany

PostPosted: Sun Mar 30, 2008 11:09 am    Post subject: Tooltip with hwnd Reply with quote

I don't know if this is possible and if someone asked before, but I like to see hwnd as a parameter for ToolTip. So you can bind it directly at controls.
Back to top
View user's profile Send private message
tic



Joined: 22 Apr 2007
Posts: 1318

PostPosted: Sun Mar 30, 2008 6:03 pm    Post subject: Reply with quote

Code:
Tooltip, % " "
hwnd := WinExist("ahk_class tooltips_class32")
Tooltip


that not good enough for you?
Back to top
View user's profile Send private message
haichen



Joined: 05 Feb 2007
Posts: 99
Location: Osnabrück, Germany

PostPosted: Mon Mar 31, 2008 12:24 am    Post subject: Reply with quote

Hm, sorry ..I know my english is not very well, but mostly I understand the meaning of someones writing. .. This time I don't understand your answer..
Maybe you also don't understand my question.
Confused
For clarification, I mean something like this pseudocode:
Code:
Gui, Add, Edit, hwndhe1  w200 vMyEdit1
Gui, Add, Button, HWNDhb1 , Test Button1
ToolTip, hb1, hallo Button
Gui, Show,, test


If your code do something like this, please explain it for me.

In the meantime I found a nice code from corrupt wich i change to the following:
Code:
test1=testtext1
test2=testtext2
test3=testtext3
test4=testtext4
test5=testtext5
test6=testtext6
TTControls=MyEdit,MyEdit2,B1,B2,T1,T2
TTTextVars=test1,test2,test3,test4,test5,test6

Gui, Add, Text, vMoveAnywhere, Move your mouse anywhere in this window.
Gui, Add, Edit, w200 vMyEdit
Gui, Add, Edit, w200 vMyEdit2
Gui, Add, Button, vB1 gb1, Test Button1
Gui, Add, Button, vB2, Test Button2
Gui, Add, text, vT1 hwndt1 gvoid, This is a test
Gui, Add, Text, vT2 gvoid , ... another test...
Gui, Show,, test


WinSet, Transparent, 200, test
OnMessage(0x200, "WM_MOUSEMOVE")
Return


b1:
test1= changing the tooltip
return

void:
return

WM_MOUSEMOVE(wParam, lParam)
{
   global
  ShowToolTips(TTControls,TTTextVars)
}

ShowToolTips(ctr,txt)
{
   StringSplit, ctr, ctr, `,,%a_space%
   StringSplit, txt, txt, `,,%a_space%
  loop,%ctr0%
  {
     tooltip
     TTText := txt%a_index%
     TTText := %TTText%
      If (A_GuiControl = ctr%a_index%)
      {
         tooltip, %TTText%
         break
      }
   }
}
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 3942
Location: Pittsburgh

PostPosted: Mon Mar 31, 2008 1:57 am    Post subject: Reply with quote

You should move all the static work out of the message handler to reduce flicker. Something like this
Code:
txt1=testtext1
txt2=testtext2
txt3=testtext3
txt4=testtext4
txt5=testtext5
txt6=testtext6
TTControls=MyEdit,MyEdit2,B1,B2,T1,T2
StringSplit ctr, TTControls, `,,%a_space%

Gui, Add, Text, vMoveAnywhere, Move your mouse anywhere in this window.
Gui, Add, Edit, w200 vMyEdit
Gui, Add, Edit, w200 vMyEdit2
Gui, Add, Button, vB1 gb1, Test Button1
Gui, Add, Button, vB2 gb2, Test Button2
Gui, Add, text, vT1 hwndt1 gvoid, This is a test
Gui, Add, Text, vT2 gvoid , ... another test...
Gui, Show,, test

WinSet, Transparent, 200, test
OnMessage(0x200, "MOUSEMOVE")
Return

b1:
   txt3 = changed %txt3%
Return

b2:
   txt4 .=  " ?!"
Return

void:
   txt5 .=  "."
Return

MOUSEMOVE() {
   Global ctr0, txt0
   Loop %ctr0%
      If (A_GuiControl = ctr%A_Index%) {
          ToolTip % txt%A_Index%
          Return
      }
   ToolTip
}
Back to top
View user's profile Send private message
haichen



Joined: 05 Feb 2007
Posts: 99
Location: Osnabrück, Germany

PostPosted: Mon Mar 31, 2008 2:03 am    Post subject: Reply with quote

Ahh thanks, that's much smoother. Very Happy
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 3942
Location: Pittsburgh

PostPosted: Mon Mar 31, 2008 2:07 am    Post subject: Reply with quote

But, your wish is actually a moving, constantly redrawn tooltip. The ToolTip command is static: it puts up a single tooltip, so binding it to any control will not do what you want. A moving tooltip would really be a nice feature, saving message handling in many scripts.
Back to top
View user's profile Send private message
haichen



Joined: 05 Feb 2007
Posts: 99
Location: Osnabrück, Germany

PostPosted: Mon Mar 31, 2008 10:11 am    Post subject: Reply with quote

You explain my wish very well. Such a "dynamic" ToolTip would simplify adding more usebility to the script. More Tooltips to explain my script (and myself).
Back to top
View user's profile Send private message
Superfraggle



Joined: 02 Nov 2004
Posts: 770
Location: London, UK

PostPosted: Tue Apr 01, 2008 2:04 am    Post subject: Reply with quote

Something like this

http://www.autohotkey.com/forum/viewtopic.php?t=30300
_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle
Back to top
View user's profile Send private message MSN Messenger
Laszlo



Joined: 14 Feb 2005
Posts: 3942
Location: Pittsburgh

PostPosted: Tue Apr 01, 2008 1:50 pm    Post subject: Reply with quote

Superfraggle wrote:
Something like this
There is a difference. You show a tooltip at the place the mouse arrives at a control, and the tooltip stays there. By monitoring the mouse the tooltip can be moved with the mouse.
Back to top
View user's profile Send private message
Superfraggle



Joined: 02 Nov 2004
Posts: 770
Location: London, UK

PostPosted: Tue Apr 01, 2008 4:33 pm    Post subject: Reply with quote

I didnt actually read the rest of the thread, just the original request. It looks like the final request varies from the original.

Edit, I see what you mean now. I was just loking to add basic tooltip support as it is implemented in most of windows apps. There is a lot more to the tooltips over on MSDN, however I havent had the time/knowledge to take it all in yet.
_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group