0

I want to place a bitmap on a button. All I can find on the internet is to use BS_BITMAP as button style and then SendMessage() with BM_SETIMAGE. My problem: these 2 defines are not defined in my winuser.h.

The target runs Windows CE version 6.00, in my stdafx.h it says "#define WINVER _WIN32_WCE" (which is 0x600). But winuser.h doesn't even contain any BS_BITMAP or BS_SETIMAGE define.

So i tried to paint the bitmap on the button at "case WM_PAINT" with BitBlt() (without knowing if I can still press the button if the bitmap is placed above it), but the bitmap is hidden behind the button. So the appearance doesn't change at all and I still see the grey standard button.

Is there any other possibility to place a bitmap or icon on a button than using those missing defines? Or even better, do you know why those defines are missing or how I get them?

Adding those defines by hand to my code didn't help at all of course.

Andreas P
  • 53
  • 2
  • 7
  • MFC work-around for Windows-CE; you should be able to adapt it: http://stackoverflow.com/questions/27451274/c-mfc-want-to-add-bitmap-to-cbutton-cbutton-has-no-member-setbitmap-and-b . Looks like you have to do it owner draw. – Richard Critten Apr 27 '17 at 17:18
  • 1
    "*But winuser.h doesn't even contain any BS_BITMAP or BS_SETIMAGE define*" - then you must be using an outdated version, because winuser.h DOES define them (as `#define BS_BITMAP 0x00000080L` and `#define BM_SETIMAGE 0x00F7`, respectively). They are defined only if `WINVER >= 0x0400`. WinCE does not support `BS_BITMAP`, though, so you have to use `BS_OWNERDRAW` instead. – Remy Lebeau Apr 27 '17 at 17:21
  • @RichardCritten: I know the question is about WinCE. But that is an old OS, and the defines do exist in every version of winuser.h I have ever seen, which implies an old version is being used. Unless Microsoft provides a whole different set of headers just for WinCE compilations that are different than the headers provided for Win32 compilations. I don't know, I don't use Microsoft SDKs directly. – Remy Lebeau Apr 27 '17 at 17:25
  • Send [`BCM_SETIMAGELIST`](https://msdn.microsoft.com/en-us/library/windows/desktop/bb775975(v=vs.85).aspx) to regular button. Don't know if available on Win CE 6.0 though. – zett42 Apr 27 '17 at 19:25

0 Answers0