F
So, ich habs hinbekommen
Zwar schon vor ein paar Tagen, aber erst heute habe ich mal wieder die Zeit gefunden ins Forum zu sehen und etwas zu schreiben...
Also, vielleicht hilft es irgendwann irgendwem:
case WM_PAINT:
{
hdc = BeginPaint(hWnd1, &ps);
bmpExercising = (HBITMAP)LoadImage(NULL, Background,
IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
// Create a memory device compatible with the above DC variable
MemDCExercising = CreateCompatibleDC(hdc);
// Select the new bitmap
SelectObject(MemDCExercising, bmpExercising);
// Copy the bits from the memory DC into the current dc
BitBlt(hdc, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), MemDCExercising, 0, 0, SRCCOPY);
// Restore the old bitmap
DeleteDC(MemDCExercising);
DeleteObject(bmpExercising);
RedrawWindow(hWnd1, NULL, NULL, RDW_ERASENOW | RDW_ALLCHILDREN | RDW_INVALIDATE);
DeleteObject(hWnd1);
EndPaint(hWnd1, &ps);
}break;
Und jedes mal, wenn man den Hintergrund ändern möchte, einfach Background = "" und RedrawWindow()...
MFG und Danke an alle
FERNman