 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
HotKeyIt
Joined: 18 Jun 2008 Posts: 2195 Location: GERMANY
|
Posted: Tue May 12, 2009 1:59 pm Post subject: |
|
|
Hi Superfraggle, we've got one small issue/problem.
If only 1 Control is associated with ToolTip, ToolTip will not pop up again after it has been hidden by system (not by mouse movements)
Any ideas?
| Code: |
; ### Example Code #####
Gui,Add,Button,hwndbutton1,Test Button 1
AddTooltip(button1,"Press me to change my tooltip")
Gui,show,,Test Gui
Return
GuiClose:
Guiescape:
Exitapp
; ### End Example Code #####
AddToolTip(con,text,Modify = 0){
Static TThwnd,GuiHwnd
If (!TThwnd){
Gui,+LastFound
GuiHwnd:=WinExist()
TThwnd:=CreateTooltipControl(GuiHwnd)
}
Varsetcapacity(TInfo,44,0)
Numput(44,TInfo)
Numput(1|16,TInfo,4)
Numput(GuiHwnd,TInfo,8)
Numput(con,TInfo,12)
Numput(&text,TInfo,36)
Detecthiddenwindows,on
If (Modify){
SendMessage,1036,0,&TInfo,,ahk_id %TThwnd%
}
Else {
Sendmessage,1028,0,&TInfo,,ahk_id %TThwnd%
SendMessage,1048,0,300,,ahk_id %TThwnd%
}
}
CreateTooltipControl(hwind){
Ret:=DllCall("CreateWindowEx"
,"Uint",0
,"Str","TOOLTIPS_CLASS32"
,"Uint",0
,"Uint",2147483648 | 3
,"Uint",-2147483648
,"Uint",-2147483648
,"Uint",-2147483648
,"Uint",-2147483648
,"Uint",hwind
,"Uint",0
,"Uint",0
,"Uint",0)
Return Ret
} |
_________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
Tilex
Joined: 01 Jun 2009 Posts: 1 Location: Germany
|
Posted: Mon Jun 01, 2009 9:05 pm Post subject: |
|
|
first to say: thanks for that feature
but I have one problem:
I want to set a tooltip for an edit-box, which is disabled.
How do I do that? It only shows the tooltip, when it is enabled again.
bye,
Tilex |
|
| Back to top |
|
 |
Superfraggle
Joined: 02 Nov 2004 Posts: 1019 Location: London, UK
|
Posted: Thu Jun 04, 2009 10:20 pm Post subject: |
|
|
HotKeyIt,
Sorry about the delay in getting back to you, I have not been on the forum for a while. Not sure what you mean there.
If you mean let the tooltip close itself, then move mouse to bring it back. If I move the mouse off the control and back on the tooltip reappears.
I am on vista, so that could be an XP bug.
Tilex,
I believe that is standard windows and cannot be bypassed, you would have to write custom tooltips as suggested in the manual. _________________ Steve F AKA Superfraggle
http://r.yuwie.com/superfraggle |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 2195 Location: GERMANY
|
Posted: Thu Jun 04, 2009 10:36 pm Post subject: |
|
|
| Superfraggle wrote: | HotKeyIt,
Sorry about the delay in getting back to you, I have not been on the forum for a while. Not sure what you mean there.
If you mean let the tooltip close itself, then move mouse to bring it back. If I move the mouse off the control and back on the tooltip reappears.
I am on vista, so that could be an XP bug.
|
Try this, do not move your mouse until the ToolTip disappears and it will not come back.
I fixed this already in ToolTip() by adding a tool for Gui hWnd, give it a try, many thanks to you.
| Code: |
; ### Example Code #####
Gui,Add,Button,hwndbutton1 Gbut1,Test Button 1
AddTooltip(button1,"Press me to change my tooltip")
Gui,show,,Test Gui
Return
But1:
AddTooltip(button1,"Wasn't that easy `;)",1)
REturn
GuiClose:
Guiescape:
Exitapp
; ### End Example Code #####
AddToolTip(con,text,Modify = 0){
Static TThwnd,GuiHwnd
If (!TThwnd){
Gui,+LastFound
GuiHwnd:=WinExist()
TThwnd:=CreateTooltipControl(GuiHwnd)
}
Varsetcapacity(TInfo,44,0)
Numput(44,TInfo)
Numput(1|16,TInfo,4)
Numput(GuiHwnd,TInfo,8)
Numput(con,TInfo,12)
Numput(&text,TInfo,36)
Detecthiddenwindows,on
If (Modify){
SendMessage,1036,0,&TInfo,,ahk_id %TThwnd%
}
Else {
Sendmessage,1028,0,&TInfo,,ahk_id %TThwnd%
SendMessage,1048,0,300,,ahk_id %TThwnd%
}
}
CreateTooltipControl(hwind){
Ret:=DllCall("CreateWindowEx"
,"Uint",0
,"Str","TOOLTIPS_CLASS32"
,"Uint",0
,"Uint",2147483648 | 3
,"Uint",-2147483648
,"Uint",-2147483648
,"Uint",-2147483648
,"Uint",-2147483648
,"Uint",hwind
,"Uint",0
,"Uint",0
,"Uint",0)
Return Ret
} |
Fix for your function:
| Code: |
; ### Example Code #####
Gui,Add,Button,hwndbutton1 Gbut1,Test Button 1
AddTooltip(button1,"Press me to change my tooltip")
Gui,show,,Test Gui
Return
But1:
AddTooltip(button1,"Wasn't that easy `;)",1)
REturn
GuiClose:
Guiescape:
Exitapp
; ### End Example Code #####
AddToolTip(con,text,Modify = 0){
Static TThwnd,GuiHwnd
If (!TThwnd){
Gui,+LastFound
GuiHwnd:=WinExist()
TThwnd:=CreateTooltipControl(GuiHwnd)
Varsetcapacity(TInfo,44,0)
Numput(44,TInfo)
Numput(1|16,TInfo,4)
Numput(GuiHwnd,TInfo,8)
Numput(GuiHwnd,TInfo,12)
;Numput(&text,TInfo,36)
Detecthiddenwindows,on
Sendmessage,1028,0,&TInfo,,ahk_id %TThwnd%
SendMessage,1048,0,300,,ahk_id %TThwnd%
}
Varsetcapacity(TInfo,44,0)
Numput(44,TInfo)
Numput(1|16,TInfo,4)
Numput(GuiHwnd,TInfo,8)
Numput(con,TInfo,12)
Numput(&text,TInfo,36)
Detecthiddenwindows,on
If (Modify){
SendMessage,1036,0,&TInfo,,ahk_id %TThwnd%
}
Else {
Sendmessage,1028,0,&TInfo,,ahk_id %TThwnd%
SendMessage,1048,0,300,,ahk_id %TThwnd%
}
}
CreateTooltipControl(hwind){
Ret:=DllCall("CreateWindowEx"
,"Uint",0
,"Str","TOOLTIPS_CLASS32"
,"Uint",0
,"Uint",2147483648 | 3
,"Uint",-2147483648
,"Uint",-2147483648
,"Uint",-2147483648
,"Uint",-2147483648
,"Uint",hwind
,"Uint",0
,"Uint",0
,"Uint",0)
Return Ret
} |
_________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|