I have solved it!
First, I must say BIG "thank you" to member Jochen Arndt for suggesting me to owner draw the control, and providing detailed suggestions in his comment.
UPDATE #1:
************************************************************
Jochen Arndt's solution works perfect if the background of a window is not a bitmap.
I haven't found a way to apply it when bitmap is window's background.
Any help on this one is greatly appreciated,since I believe his solution is better ( and I would prefer to solve my problem this way!).
************************************************************
I have converted icon that I needed to load as static control's background into bitmap online, and drew it with function TransparentBlt( ... ).
For people with same, or similar problems, here is the code snippet:
#pragma comment( lib, "Msimg32.lib")
static HBITMAP hbSymbol = LoadBitmap( GetModuleHandle(NULL),
MAKEINTRESOURCE(IDB_BITMAP2) );
case WM_CREATE:
{
HWND hStatic1 = CreateWindowEx( NULL, "STATIC", "", WS_CHILD | WS_VISIBLE | SS_NOTIFY | SS_OWNERDRAW, 450,150, 25, 25, hwnd, (HMENU)2000, GetModuleHandle(NULL), NULL);
}
break;
case WM_DRAWITEM:
{
switch( (UINT)wParam)
{
case 2000:
{
BITMAP bp;
LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT)lParam;
HDC hMemDC = CreateCompatibleDC( lpDIS->hDC);
GetObject( hbSimbol, sizeof(bp), &bp);
SelectObject(hMemDC, hbSimbol);
TransparentBlt( lpDIS->hDC, lpDIS->rcItem.top,
lpDIS->rcItem.left,
lpDIS->rcItem.right - lpDIS->rcItem.left,
lpDIS->rcItem.bottom - lpDIS->rcItem.top,
hMemDC, 0, 0, bp.bmWidth, bp.bmHeight,
RGB( 255, 0, 255) );
DeleteDC(hMemDC);
}
break;
default:
break;
}
}
break;
case WM_CLOSE:
DeleteObject(hbSimbol);
DestroyWindow(hwnd);
break;
case WM_DESTROY:
DeleteObject(hbSimbol);
PostQuitMessage(0);
break;