Hey guys, I've been lurking around and found some answers for related stuff but I'm currently stuck at this point. I'm creating a WS_EX_LAYERED window with no borders / title bar etc. The background of the window is transparent using a PNG image I'm loading on WM_CREATE and assigning alphablending accordingly with this function:
BLENDFUNCTION blend = {0};
blend.BlendOp = AC_SRC_OVER;
blend.BlendFlags = 0;
blend.SourceConstantAlpha = 255;
blend.AlphaFormat = AC_SRC_ALPHA;
POINT ptPos = {left, top};
SIZE sizeWnd = {500, 300};
POINT ptSrc = {0, 0};
UpdateLayeredWindow(hWnd, hdcScreen, &ptPos, &sizeWnd, hDC, &ptSrc, 0, &blend, ULW_ALPHA);
SelectObject(hDC, hBmpOld);
DeleteObject(hBmp);
DeleteDC(hDC);
ReleaseDC(NULL, hdcScreen);
As a part of the GUI I'm using custom images for buttons placed on the same WM_CREATE because well, I'm treating em like background, they will never change (sort of). This is the code for the buttons
Image xxxImage(L"Images\\xxx.png");
graphics.DrawImage(&xxxImage, 245, 130, 30, 20);
Until that point, everything is working. I've got a decent background with full / partial transparency as my image and buttons - text as needed.
However, I'm trying to make some hover effects for the buttons. I'm catching WM_MOUSEMOVE event to change the cursor and changing or showing an image on those coordinates. At first I thought I could simply draw the hover image on top of my buttons but it didn't work. I tried using the same code above for my hover-image but nothing happened. I read somewhere about creating a new transparent-window on top of my Main Window and draw controls there. The best thing I could do was draw my new images but I couldn't delete them afterwards. I tried using InvalidateRect and FillRect and nothing, even tried FillRect with solid colors just to see if something happened, I couldn't erase the contents of the transparent window.