thank for your quick reply again ,but there have no way to get ID of the selected
button on toolbar by use of API? how does SPY++ check out the ID
with codes? i just need the code!! i want to realize a program when mouse
points to the button on toolbar,the caption of the corresponding button can
be retrieved ,whether the button is in my application or in other one. for
exmaple ,when mouse move to IE's toolbar,the corresponding button caption
can be shown in my statusbar.this program have two key problem:
(1) retrieve the buttonID with VB codes ;i need the VB codes
(2)GPF will be aroused when tring to send message directly to toolbar in
another application . This involves the problem in communicating with external
process. ALLOC external memory can realize in window NT with API ¡°VirtualAllocX¡±
,however in windowX is difficult¡£



Tom Esh <tjeshGibberish@earthlink.net> wrote:
>On 19 Nov 2002 23:35:41 -0800, <vb.@127.0.0.1> wrote:
>>when retrieving the caption of button on the toolbar ,the ID of button
>>must be set to wParam parameter of API "sendmessage",
>>ie . wParam =idbutton, according to SDK document.
>>how can i get the IDbutton if i add two button on toolbar by its property
>>dialog box?
>>IDbutton = what???????????
>>##############################################################
>>Str=Space$(256)
>>throw = SendMessage(GetWindow(Toolbar1.hwnd, GW_CHILD), TB_GETBUTTONTEXTW,IDbutton,Str)
>>##############################################################

>
>The ID is how the Api keeps track of the buttons, and although VB has
>to assign the IDs, it doesn't expose them. Been awhile since I played
>with it, but IIRC VB assigns the button IDs starting with 100 in the
>sequence they're added (including separators). An easy way to check is
>to fire up the Spy++ utility and watch WM_COMMAND for the toolbar
>parent window.
>
>
>-Tom
>MVP - Visual Basic
>(please post replies to the newsgroup)