dev-cpp icon issue

B

bob

I'm trying to change the icon in the corner of my window, and I'm
having trouble. I'm using Dev-C++, and I noticed it created this .RC
file for me when I specified that I wanted to use a "Game" icon for the
program itself. It contains this:

/* THIS FILE WILL BE OVERWRITTEN BY DEV-C++ */
/* DO NOT EDIT! */


A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "reversi.ico"

So, I tried changing the icon for the window like so:

WNDCLASS wc;
wc.hIcon = LoadIcon (hInstance, "reversi.ico");

It doesn't seem to work. Anyone know what's up?
 
M

mlimber

I'm trying to change the icon in the corner of my window, and I'm
having trouble. I'm using Dev-C++, and I noticed it created this .RC
file for me when I specified that I wanted to use a "Game" icon for the
program itself. It contains this:

/* THIS FILE WILL BE OVERWRITTEN BY DEV-C++ */
/* DO NOT EDIT! */


A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "reversi.ico"

So, I tried changing the icon for the window like so:

WNDCLASS wc;
wc.hIcon = LoadIcon (hInstance, "reversi.ico");

It doesn't seem to work. Anyone know what's up?

I'd suggest posting in a newsgroup related to Dev-C++ or your platform.
This newsgroup is for standard C++ language issues, and icons fall
outside of that scope.

Cheers! --M
 
E

enki

Hope this helps, this is from a program that I wrote.

wincl.hIcon = LoadIcon (hin, MAKEINTRESOURCE(IDI_ICONB));
wincl.hIconSm = LoadIcon(hin, MAKEINTRESOURCE(IDI_ICONS));

You will need to do a resource.h:
#define IDB_IMAGE1 100
#define IDB_IMAGE2 101
#define IDB_IMAGE3 102
#define IDB_IMAGE4 103
#define IDB_IMAGE5 104

#define IDI_ICONS 200
#define IDI_ICONB 201

#define IDC_CURSOR 300

#include "resources.h"

IDB_IMAGE1 BITMAP "tank.bmp"
IDB_IMAGE2 BITMAP "tank2.bmp"
IDB_IMAGE3 BITMAP "tank3.bmp"
IDB_IMAGE4 BITMAP "board.bmp"
IDB_IMAGE BITMAP "inf.bmp"

IDI_ICONS ICON "tank.ico"
IDI_ICONB ICON "myicon.ico"

resource.rc

IDC_CURSOR CURSOR "cursor1.cur"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top