|
-
Jan 10th, 2010, 01:25 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Can't get TTM_GETTEXT to work
I have successfully created a tooltip using TOOLINFO structure, and changed its time on, changed the title, changed the text, using SendMessage and the proper TTMs. However I want to be able to read the text back using TTM_GETTEXT but I cannot get it to work, anyone here have any experience with this message?
TTM_GETTEXTA = Wm_User + 11
Public Type
cbsize as long
uFlags as Long
hwnd as long
uID as long
rc as RECT
hInstance as Long
lpszText as String
lParam as long
End Type
Dim parentHwnd as long 'handle of the control I want the tooltip to trigger over
Dim tipHwnd as Long 'returned from CreateWindow(tooltip setup styles)
------------
Sub GetTipText()
Dim ti as TOOLINFO
Dim tipBuffer as String
tipBuffer = Space$(80)
With ti
.lpszText = StrPtr(tipBuffer)
.Uflags = TTF_SUBCLASS or TTF_IDISHWND
.hwnd = parentHwnd
.Uid = parentHwnd
.hInstance = App.hInstance
.lParam = 0
.cbSize = Len(ti)
end With
SendMessage tipHwnd, TTM_GETTEXTA, 0, ti
Me.Caption = tipBuffer
End Sub
it returns an empty string,well the spaces are in the buffer of course.
What am I doing wrong???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|