Hallo,
I am trying to use a picture as the background for my windows program but cant seem to find any resources on it.
Does anyone have any experience with it?
Regards,
Printable View
Hallo,
I am trying to use a picture as the background for my windows program but cant seem to find any resources on it.
Does anyone have any experience with it?
Regards,
There are many ways to realize this.
You can do it in this way ...
Or you can handle it in the WM_PAINT of the window proc ...Code:WNDCLASSEX WndClass ;
WndClass.style = CS_HREDRAW | CS_VREDRAW | 0x00020000 ;
WndClass.hInstance = hInstance ;
WndClass.lpfnWndProc = WindowProc ;
WndClass.cbSize = sizeof (WNDCLASSEX) ;
WndClass.cbClsExtra = 0 ;
WndClass.cbWndExtra = 0 ;
WndClass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
WndClass.hIconSm = LoadIcon (NULL, IDI_APPLICATION) ;
WndClass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
WndClass.lpszMenuName = NULL ;
// The Background Picture
WndClass.hbrBackground = (HBRUSH) CreatePatternBrush((HBITMAP)LoadImage(NULL, TEXT("backpic.bmp"),
IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)) ;
WndClass.lpszClassName = szClassName ;
if (!RegisterClassEx (&WndClass))
return 0 ;
EDIT:
http://www.c-plusplus.de/forum/viewt...ntergrund.html
Greetz
That worked great. Thank you