LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Get Tooltip Text, 3rd Party App

All,

Has anyone ever tried to get the tooltip text from a third party
application's button? (I'm working with an application called "Research
Wizard," but the code works just as well for Internet Explorer). I'm willing
to post the code (which is rather lengthy) if someone feels they can help
(but please read on to see if you think that you should reply to this post).
[Besides, this post is rather lengthy to begin with, even without the code.]

I am able to do the following (with help from a number of other posts):
- Enumerate the windows to get the target window handle
- Get the toolbar handle from the window handle
- Count the number of buttons on the toolbar (for looping purposes)
- Loop through each button
- Click each button

Despite being able to click the button, I can't seem to get the tooltip text
for the button.

To give you an idea of some of the APIs involved, I'm using the following:
FindWindow
EnumChildWindows
GetClassName
SendMessage
OpenProcess
VirtualAllocEx
VirtualFreeEx
ReadProcessMemory
CloseHandle
GetWindowThreadProcessId

Here are some of the SendMessage wMsg arguments Im using:
TB_BUTTONCOUNT
TB_GETBUTTON
WM_COMMAND
TTM_ENUMTOOLS (trying to get this to work properly)
TTM_GETTEXT (trying to get this to work properly)

Structures used:
TBBUTTON
TOOLINFO

I found a post that suggests sending TTM_ENUMTOOLS with a pointer to the
TOOLINFO structure (Type TOOLINFO...End Type) and then passing TOOLINFO with
TTM_GETTEXT to get lpszText. The post also mentioned that memory needs to be
allocated that both processes can access. (Unfortunately, the post didn't
provide any syntax, just the concept written down). I have been unsuccessful
in this getting lpszText from TOOLINFO (despite being able to get
TBBUTTON.idCommand or TBBUTTON.iString when sending TB_GETBUTTON). (Maybe
the toolbar class I'm working with doesn't provide information for TOOLINFO).

As an aside: This code (and the concept behind it) is completely new to me,
and Ive had to do a lot of learning along the way. There is a lot of
information that I'm still picking up.

Let me know if you can help.

Thanks,

Matthew Herbert

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
To show the whole text in a tooltip text Pierre Archambault Excel Programming 4 January 19th 06 01:19 AM
Change the tooltip text for a datapoint Hayeso Charts and Charting in Excel 4 December 16th 05 01:33 PM
tooltip text Duraiswamy Lingappan Links and Linking in Excel 1 April 7th 05 07:51 AM
Tooltip text over a label John Robinson[_2_] Excel Programming 4 February 27th 05 07:33 PM
How to add Tooltip text to Treeview Duraiswamy Lingappan Excel Programming 0 August 6th 04 12:06 PM


All times are GMT +1. The time now is 02:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"