Hello everybody:)

My toolbar is in a rebarband the button bitmap is gray and I'm using windows 98. Here are two questions I've not been able to figure out:

1) To make a button appear grayed and disabled I use:

invoke SendMessage,hTBhandle,TB_ENABLEBUTTON,TB_ID,FALSE

This works great under windows 98 but a friend of mine recently tried my program but any button which should have appeared gray were displayed as black rectangles. Anybody see this before or have any suggestions or links?


2) Anybody know of a method to change toolbar button text? I want the user to be able to define a button name and this will then be new button text label. I've tried TB_DELETEBUTTON; TB_ADDBUTTONS; TB_INSERTBUTTON message combinations without success. Is there any method short of destroying and creating a new toolbar of doing this.

best regards,

czDrillard
Posted on 2003-03-28 09:34:44 by czDrillard
1. What OS was your friend using and did he have any themes or default colors changed ?

2 The TB_SETBUTTONINFO message allows you to change the information including strings for individual buttons, it uses the TBBUTTONINFO structure :
TBBUTTONINFO struct

cbSize DWORD ?
dwMask DWORD ?
idCommand dwMask DWORD ?
iImage dwMask DWORD ?
fsState dwMask DWORD ?
fsStyle dwMask DWORD ?
lx dwMask WORD ?
lParam dwMask DWORD ?
pszText dwMask DWORD ?
cchText dwMask DWORD ?
TBBUTTONINFO ends

sTBI TBBUTTONINFO <?>

mov sTBI.cbSize , SIZEOF TBBUTTONINFO
mov sTBI.dwMask , TBIF_TEXT
mov sTBI.pszText , pszTEXT ; the address of your text buffer
invoke SendMessage, hTB, TB_SETBUTTONINFO, idBUTTON, ADDR sTBI
Posted on 2003-03-28 10:02:50 by donkey
Thanks donkey for your reply.

My friend was using Windows ME. (I should read my own posts more carefully.)

best regards,


czDrillard
Posted on 2003-03-29 10:18:44 by czDrillard
Hello everybody,

TB_SETBUTTONINFO causes undefined symbol error. Do I need to define it in the windows.inc file? and how to do that?

best regards,

czDrillard
Posted on 2003-03-29 21:30:18 by czDrillard
TB_SETBUTTONINFO is already in the Windows.inc file (mine is Version 1.25e), it may be that you have mispelled it in your code. If you need the equate :

TB_SETBUTTONINFO equ WM_USER + 66
Posted on 2003-03-29 21:42:42 by donkey
Thanks donkey,

I have windows.inc (Version 1.25b) Where did you get 1.25e?

best regards,

czDrillard
Posted on 2003-03-30 03:20:32 by czDrillard
:stupid: BTW I just looked at the structure that I gave you, I used copy&paste for the DWORD ? parts and looks like I copied the dwMask part as well. It is actually like this :
TBBUTTONINFO struct

cbSize DWORD ?
dwMask DWORD ?
idCommand DWORD ?
iImage DWORD ?
fsState DWORD ?
fsStyle DWORD ?
lx WORD ?
lParam DWORD ?
pszText DWORD ?
cchText DWORD ?
TBBUTTONINFO ends
Posted on 2003-03-30 04:38:00 by donkey