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
}