Hi there,
I'm trying to add my own button to an existing toolbar (not created by me). However, I just either get a seperator, or some other button from the toolbar...here's the code I'm using:
Code:
LRESULT success;
_TBBUTTON *pbuttonarray;
_TBBUTTON buttonarray[1];
pbuttonarray=buttonarray;
int iIndex = -1;
char *buff="My button!\0\0";
iIndex = SendMessage(TBHandle,TB_ADDSTRING,NULL,(long)buff);
buttonarray[0].fsState=TBSTATE_ENABLED;
buttonarray[0].fsStyle=BTNS_BUTTON | BTNS_AUTOSIZE | BTNS_SHOWTEXT;
buttonarray[0].dwData=0;
buttonarray[0].iString=iIndex;
buttonarray[0].iBitmap=0;
success=SendMessage(TBHandle,TB_ADDBUTTONS,1,(LPARAM)pbuttonarray);
if(success)
cout<<"ok\n";
else
cout<<"bad\n";
now it always adds the string to the stringpool okay, and it also always ends in success. But for the life of me I just cannot get just a simple button with just some text on saying "My Button"...
Anyone want to just appear out of cyberspace and solve it with a wave of a magic wand?
Uni
btw...sorry for the bad formatting, it is fine in VC, but it hasn't shown up as well...