Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi! I just want to ask if how can I retrieve the dwData or the application defined value in a toolbar button clicking of that button, I read about using TB_SETBUTTONINFO and TB_GETBUTTONINFO, but I do not know where will I place those messages. The toolbar buttons that I have, has custom button idCommand values. I'm working on native implementation of toolbar in Windows. Please help. Thank you.
Posted
Updated 6-Nov-14 22:51pm
v2
Comments
BillWoodruff 7-Nov-14 2:15am    
What are you developing in WinForms, WPF ... or, ? C# ? C++ ?

Are you talking about hooking into lower-level Windows OS behavior here ?

Details, please.
jj0820 7-Nov-14 2:37am    
Hi,
I'm developing in Windows Form, its C++ code, I got to read MSDN, but I do not know how can I be able to use those. I just want to know how can I get the dwData value, upon click on the toolbar button. Its is not hooking on lower-level Windows. Below is the code I have:
TBBUTTON tbButtons[] =
{
{ count, IDM_BUTTONSTART + count, TBSTATE_ENABLED, BTNS_AUTOSIZE, {0}, "User defined value", att },
};

I have a couple of buttons to add to the toolbar, each has different dwData value

1 solution

As with most Windows issues this just requires you to send a message to the component in question. So you send the TB_GETBUTTONINFO message to the toolbar, as described in the documentation for this message[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900