Hi !
I've come up with two problems with my application, which still remain
unresolved.
First off, I'd like to make a toolbar with more than 16-color bitmaps.
As a matter of
fact, CreateToolbarEx can't load other bitmaps, so my toolbar looks
ugly. Is there
another way to make a toolbar (like the one of Winzip) ? Now, a second
problem.
I've never managed to make a button with a bitmap on it. Here is my code
(in RAW
C) :
my_button = CreateWindow ("BUTTON",
"a caption",
WS_CHILD | WS_VISIBLE |
BS_OWNERDRAW,
50, 420,
80, 50,
hWnd,
(HMENU) MY_BUTTON,
hInst,
NULL);
hbmpMyBitmap = LoadBitmap(hInst, MAKEINTRESOURCE(MY_BMP));
hdc = GetDC(my_button);
hdcMemory = CreateCompatibleDC(hdc);
hbmpOld = SelectObject(hdcMemory, hbmpMyBitmap);
BitBlt(hdc, 0, 0, 48, 48, hdcMemory, 0, 0, SRCCOPY);
SelectObject(hdcMemory, hbmpOld);
DeleteDC(hdcMemory);
ReleaseDC(my_button, hdc);
It doesn't work at all, so I guess I haven't understood how the BitBlt's
worked.
Well, I would be very grateful if someone could help me with those
issues.
Thanks in advance,
Mark
I've come up with two problems with my application, which still remain
unresolved.
First off, I'd like to make a toolbar with more than 16-color bitmaps.
As a matter of
fact, CreateToolbarEx can't load other bitmaps, so my toolbar looks
ugly. Is there
another way to make a toolbar (like the one of Winzip) ? Now, a second
problem.
I've never managed to make a button with a bitmap on it. Here is my code
(in RAW
C) :
my_button = CreateWindow ("BUTTON",
"a caption",
WS_CHILD | WS_VISIBLE |
BS_OWNERDRAW,
50, 420,
80, 50,
hWnd,
(HMENU) MY_BUTTON,
hInst,
NULL);
hbmpMyBitmap = LoadBitmap(hInst, MAKEINTRESOURCE(MY_BMP));
hdc = GetDC(my_button);
hdcMemory = CreateCompatibleDC(hdc);
hbmpOld = SelectObject(hdcMemory, hbmpMyBitmap);
BitBlt(hdc, 0, 0, 48, 48, hdcMemory, 0, 0, SRCCOPY);
SelectObject(hdcMemory, hbmpOld);
DeleteDC(hdcMemory);
ReleaseDC(my_button, hdc);
It doesn't work at all, so I guess I haven't understood how the BitBlt's
worked.
Well, I would be very grateful if someone could help me with those
issues.
Thanks in advance,
Mark