c++.windows.32-bits - LoadBitmap
- Steve & Denise De Chellis (30/30) Jun 20 2002 I'm having trouble with LoadBitmap when used to register a brush in the
I'm having trouble with LoadBitmap when used to register a brush in the window class. when I run the program in WinMe, Win 98, NT everything works fine when I run in Win95 The bitmap loads as a large black blob. The bitmap is mostly black. I tried changing over to LoadResource with the same arguments but then it did not load anything... I'm confused as I recall reading something about this problem in one of my books but I can't track it down. if ((hLibrary = LoadLibrary (TEXT ("graph.dll"))) != NULL) { hBitmap=LoadBitmap (hLibrary, MAKEINTRESOURCE (IDB_BITMAP1)); } hBrush=CreatePatternBrush (hBitmap); DeleteObject (hBitmap); wndclass.style = CS_HREDRAW | CS_VREDRAW ; wndclass.lpfnWndProc = WndProc ; wndclass.cbClsExtra = 0 ; wndclass.cbWndExtra = 0 ; wndclass.hInstance = hInstance ; wndclass.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE (IDI_ICON1)) ; wndclass.hCursor = LoadCursor (hInstance, MAKEINTRESOURCE (IDC_CURSOR1)) ; wndclass.hbrBackground = hBrush; wndclass.lpszMenuName = szAppName ; wndclass.lpszClassName = szAppName ; if (!RegisterClass (&wndclass)) Thanks Steve De Chellis
Jun 20 2002