hi there again.
i have a new problem. what have I to do to get Access to the Button of a CToolbar. I need a Pointer on the CButton. Is there a way to do this?
Any help will be rated
Printable View
hi there again.
i have a new problem. what have I to do to get Access to the Button of a CToolbar. I need a Pointer on the CButton. Is there a way to do this?
Any help will be rated
When do you need to get access to them?
Wait a minute. A toolbar button is not a control (like a dialog button) so you can't attach it to a CButton. Use CToolbarCtrl member function to manipulate buttons.
to get the CButon try the getDlgItem(...) function
CButton* tp_dlgItem;
tp_dlgItem = GetDlgItem(IDC_BUTTON1);
with the handle you get from there you can manipulate the button. as for toolbar it might be the same but i never tried.
Thank you for the Post
what i try to do is this: a have a Toolbar with some Button (i think its Button). i want todo Action if the USer click on an Icon. This coud be do Easy, but..
When the User clicks on an Icon and waits for some Time (Time for Doubelclick) and hold this time the Mousebutten i will call a another function. This function is not written by me, and i feel not happy when i think about to change this very very large code.
The Problem is i have to call this function with an pointer of this button. i cant believe that's inpossibel.
maybe it would be easier for you if you handled the ON_BUTTON_DOWN and ON_BUTTON_UP windows messagesrelated to your button.
Catch them and then implement your function, from there you can still call the "old" function.
it seems to be true.
it is not possible to catch those things in a Button.
So...
Thanks for all your help.