Hi

I have a commandbar and i want to show a bitmap on the commandbar when
a function is enabled.

The only way i know how to do this is to hide or show a button.
I do not want the button to become depressed when it is clicked on by
the user. IS there anyway to do this?

I do not want the button to be grayed, so making it disabled is ruled
out.

In the calendar program that comes with any pocket pc, when someone
clicks on date on the commandbar, it is not depressed, or clicked, or
however u wanna describe the button sinking down.

Is there anyway to replicate this behavior?

Thanks a lot for the help!!!

Regards,
Li

Re: Make button on commandbar unclickable by Stephen

Stephen
Tue Nov 11 07:03:12 CST 2003

Are you saying that you want to display a bitmap on the toolbar, and have
your program be notified when the user clicks on the bitmap?

"Yuhua Li" <liyuhua@mailandnews.com> wrote in message
news:2deaf361.0311102232.503d4b23@posting.google.com...
> Hi
>
> I have a commandbar and i want to show a bitmap on the commandbar when
> a function is enabled.
>
> The only way i know how to do this is to hide or show a button.
> I do not want the button to become depressed when it is clicked on by
> the user. IS there anyway to do this?
>
> I do not want the button to be grayed, so making it disabled is ruled
> out.
>
> In the calendar program that comes with any pocket pc, when someone
> clicks on date on the commandbar, it is not depressed, or clicked, or
> however u wanna describe the button sinking down.
>
> Is there anyway to replicate this behavior?
>
> Thanks a lot for the help!!!
>
> Regards,
> Li



Re: Make button on commandbar unclickable by liyuhua

liyuhua
Tue Nov 11 19:29:37 CST 2003

I can display a bitmap on the toolbar, but i don't want the user to be
able to click on it. As in i don't want the button to sink when the
user clicks on it.

As for how the program reacts, that i can take care of. I just don't
know how to make the button behave the way i want.

Thanks for the help!



"Stephen Bye" <.> wrote in message news:<OyohUQFqDHA.2512@TK2MSFTNGP09.phx.gbl>...
> Are you saying that you want to display a bitmap on the toolbar, and have
> your program be notified when the user clicks on the bitmap?
>

Re: Make button on commandbar unclickable by r_z_aret

r_z_aret
Wed Nov 12 10:24:56 CST 2003

On 11 Nov 2003 17:29:37 -0800, liyuhua@mailandnews.com (Yuhua Li)
wrote:

>I can display a bitmap on the toolbar, but i don't want the user to be
>able to click on it. As in i don't want the button to sink when the
>user clicks on it.
>
>As for how the program reacts, that i can take care of. I just don't
>know how to make the button behave the way i want.

In eVC, you can disable a button by using the TB_SETSTATE message to
set the state of the button to 0 (disabled) or TBSTATE_ENABLED. You
can get the HWND (target for the message) from the SHMENUBARINFO
structure used in SHCreateMenuBar. You will need to provide a bitmap
for the disabled state. I do all but the latter; for my purposes,
having a nice icon for the enabled state and a grey box for the
disabled state is sufficient.

>
>Thanks for the help!
>
>
>
>"Stephen Bye" <.> wrote in message news:<OyohUQFqDHA.2512@TK2MSFTNGP09.phx.gbl>...
>> Are you saying that you want to display a bitmap on the toolbar, and have
>> your program be notified when the user clicks on the bitmap?
>>

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com

Re: Make button on commandbar unclickable by liyuhua

liyuhua
Fri Nov 14 17:06:18 CST 2003

Hi, perhaps a better description of my problem would help.

>In eVC, you can disable a button by using the TB_SETSTATE message to
>set the state of the button to 0 (disabled) or TBSTATE_ENABLED. You
>can get the HWND (target for the message) from the SHMENUBARINFO
>structure used in SHCreateMenuBar. You will need to provide a bitmap
>for the disabled state. I do all but the latter; for my purposes,
>having a nice icon for the enabled state and a grey box for the
>disabled state is sufficient.

I've tried using a list of images for the disabled button, but nothing
is
shown when the button is made disabled.

I'm adding images to the toolbar using CommandBar_AddBitmap, and then
adding buttons to the commandbar using CommandBar_AddButtons.

The button i'm concerned with is using image of index 0, meaning it is
the
first image added using CommandBar_AddBitmap. How do i set up the
disabled
image list such that the exact same image i added using
CommandBar_AddBitmap will be displayed when the button is disabled?

I used this code:
But nothing shows up when the button is disabled....

HIMAGELIST himlDisabled = ImageList_Create (16,16, ILC_COLOR, 1,10);

HBITMAP hBmp = (HBITMAP) LoadImage(hInst,
MAKEINTRESOURCE(IDB_PLUS_ONE_ICON), IMAGE_BITMAP, 0, 0,
LR_DEFAULTCOLOR);
ImageList_Add(himlDisabled, hBmp, NULL);
SendMessage(hwndButtonBand, TB_SETDISABLEDIMAGELIST, 0,
MAKELONG(himlDisabled, 0));