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; pbuttonarray=buttonarray; int iIndex = -1; char *buff="My button!\0\0"; iIndex = SendMessage(TBHandle,TB_ADDSTRING,NULL,(long)buff); buttonarray.fsState=TBSTATE_ENABLED; buttonarray.fsStyle=BTNS_BUTTON | BTNS_AUTOSIZE | BTNS_SHOWTEXT; buttonarray.dwData=0; buttonarray.iString=iIndex; buttonarray.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?
btw...sorry for the bad formatting, it is fine in VC, but it hasn't shown up as well...