here an example.
Code:
//script.rc
#include "resource.h"
IDR_MYMENU MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit", ID_FILE_EXIT
END
END
IDI_MYICON ICON "myicon.ico"
IDB_BALL BITMAP "ball.bmp"
Code:
//resource.h
#define IDR_MYMENU 101
#define IDI_MYICON 102
#define ID_FILE_EXIT 103
#define IDB_BALL 104
//i don't think you need all this stuff below but just put it in
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40004
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
Code:
//main.cpp
//......
case WM_CREATE:
{
BITMAP bm;
HBITMAP Ball = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BALL));
HBITMAP BallMask = CreateBitmapMask(Ball, RGB(255,0,255));
GetObject(Ball, sizeof(bm), &bm);
ball.width = bm.bmWidth;
ball.height= bm.bmHeight;
ball.dx = 1;
ball.dy = 1;
ball.lastx = 4;
ball.lasty = 4;
ball.x = 5;
ball.y = 5;
ball.speed = 1;
}
break;
//.....
wc.lpszMenuName = MAKEINTRESOURCE(IDR_MYMENU);
wc.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MYICON));
wc.hIconSm = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MYICON));
wc.hCursor = LoadCursor(NULL, IDC_ARROW); //make a cursor just the same as the other resources i showed an example with
and there you have it, any questions?