Post by roberto on May 13, 2020 14:40:51 GMT -5
' © Dennis McKinney 2002
' You may use this code freely in your own programs.
' This code may not be redistributed, published in whole or in part,
' posted to any group or bulletin board, nor placed on any web site
' without the authors permission.
nomainwin
' toolinfo structure
struct ti, _
cbSize as long, _
uFlags as long, _
hwnd as long, _
uId as long, _
left as long, _
top as long, _
right as long, _
bottom as long, _
hinst as long, _
lpszText as ptr
ti.cbSize.struct = len(ti.struct)
ti.uFlags.struct = 17
WindowWidth = 300
WindowHeight = 200
UpperLeftX = Int((DisplayWidth - WindowWidth)/2)
UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
button #1.btn1, "Red", [x], UL, 5, 5, 40, 25
button #1.btn2, "Blue", [x], UL, 50, 5, 40, 25
button #1.btn3, "Green", [x], UL, 95, 5, 40, 25
open "Easy Tooltips" for window as #1
#1 "trapclose [quit]"
hParent = hwnd(#1)
hTT = CreateTooltip(hParent)
call AddTooltip hwnd(#1.btn1),"Red",hTT
call AddTooltip hwnd(#1.btn2),"Blue",hTT
call AddTooltip hwnd(#1.btn3),"Green",hTT
wait
[quit] close #1 : end
[x] wait
function CreateTooltip(hParent)
style=64 '0=standard box tooltip 64 = balloon tooltip
calldll #user32, "CreateWindowExA",0 as long,"tooltips_class32" as ptr,_
0 as long, style as long,_CW_USEDEFAULT as long,_CW_USEDEFAULT as long,_
_CW_USEDEFAULT as long,_CW_USEDEFAULT as long,hParent as Ulong,_
0 as long,0 as long,0 as long,CreateTooltip as Ulong
end function
sub AddTooltip hWnd, Text$, hTT
ti.uId.struct = hWnd
ti.lpszText.struct = Text$
calldll #user32, "SendMessageA",hTT as long,1028 as long, _
0 As long,ti as ptr,ret as long
end sub
insert code here
In 2002 Dennis McKinney published a small program in LB (or JB) creating "tooltips".
As the original listing is manageable in terms of size. So I put it down here.
The question is: does somebody know how to change / increase the size of the font used in the tooltips?