Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Outlook add-in toolbar and ribbon custom icons

0 views
Skip to first unread message

Tomas

unread,
Nov 26, 2009, 8:37:35 AM11/26/09
to
Hi!,
can someone please advise how do I add custom bitmaps to buttons on a
toolbar / ribbonbar?

This is what I do for the toolbar:

HBITMAP hBmp =(HBITMAP)::LoadImage(_Module.GetResourceInstance(),
MAKEINTRESOURCE(IDB_BITMAP),IMAGE_ICON,0,0,LR_LOADMAP3DCOLORS);

// put bitmap into Clipboard
::OpenClipboard(NULL);
::EmptyClipboard();
::SetClipboardData(CF_BITMAP, (HANDLE)hBmp);
::CloseClipboard();
::DeleteObject(hBmp);
// set style before setting bitmap

hr = spCmdButton->PasteFace();

The picture is a 256 color bitmap. The problem is that the background
color is substitued for the WINDOW color (grey) but on Outlook 2007
the background is in a shade of blue - how do I create a true
transparent picture?

For the ribbon I know that I can do:

<button id="..." imageMso="..." /> but that only shows a predefined
Office picture, what do I do to show my own custom bitmap that is
saved in my resources (ie under the ID_BITMAP name)? Can you post
source code here that would show how to load the bitmap resource
please?

Many thanks,
Tomas Nemec

Hans Schmidt

unread,
Nov 27, 2009, 4:36:12 AM11/27/09
to
Hi,

i'm not totally sure but i think i solve this problem that way (in
Delphi)

I've created a Bitmap 16 x 16. Per Canvas i filled the Bitmap with the
color clBtnFace.
Then draw the icon on the canvas area. Copy that Bitmap into the
Clipboard and then
Button.PasteFace.

I hope this works for you.

Greets Hans

0 new messages