Just load it in as a resource. In resource.h you define a bitmap name. In script.rc you:
Code:
#include "resource.h"
//you should have done #define IDB_PIC 101 in resource.h
IDB_PIC BITMAP "pic.bmp"
then in your main program you do:
Code:
#include "resource.h"
#include <windows.h>
HBITMAP pic = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_PIC));
....and you should know how to use BitBlt()
if you want more specific code I'll post an example when I get home
oh and alex, i think in your example you're going to have a resource leak because you never select the defaults back into dc. i dunno, i could be wrong.
and benny, make sure you have "GetModuleHandle(NULL)" as the first param, not just "NULL" otherwise it won't work. and of course you know that is not a full main.cpp. put that line i gave (loadbitmap one) under WM_CREATE.
just a quick example for blitting:
Code:
HDC hDC = GetDC(hWnd);
HDC hDCMem = CreateCompatibleDC(hDC);
HDC hDCBuffer = CreateCompatibleDC(hDC);
HBITMAP hbmBuffer = CreateCompatibleBitmap(hdc, prc->right, prc->bottom);
HBITMAP hbmOldMem = (HBITMAP)SelectObject(hDCMem, pic);
HBITMAP hbmOldBuff = (HBITMAP)SelectObject(hDCBuffer, hbmBuffer);
FillRect(hdcBuffer, prc, GetStockObject(WHITE_BRUSH));
BitBlt(hDCBuffer, x, y, width, height, hDCMem, 0, 0, SRCAND);
BitBlt(hDC, 0, 0, prc->right, prc->bottom, hDCBuffer, 0, 0, SRCAND);
SelectObject(hDCBuffer, hbmOldBuff);
SelectObject(hDCMem, hDCOldMem);
DeleteObject(hbmBuffer);
DeleteDC(hDCBuffer);
DeleteDC(hDCMem);
like i said when i get home i'll post a whole program example if you want
btw, i just typed this quick at school, so there might be some stupid errors or somethign