954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

need help with the cursor creating

I want to create my own cursor image by importing an exsiting .ico file, but every time the VS6.0 automatically imported it into resources as ICON file, even I name it as IDC_CURSOR1, I can not use " wndclass.hCursor = LoadCursor (hInstance, MAKEINTRESOURCE (IDC_CURSOR1)) ;" to create my own cursor

linq
Light Poster
32 posts since Sep 2006
Reputation Points: 57
Solved Threads: 0
 

You have to include it in the resource .rc file and the resource.h file like this.
Assume the icon file is iconfile.ico
resource.h:
#define IDC_CURSOR1 1001
resource.rc:

#include "resource.h"
IDC_CURSOR1 ICON "iconfile.ico"


Then you have to compile it using the rc.exe which is included in the platform sdk bin folder. rc.exe resource.rc
this results a resource.res file in your source folder.

after that you have to link the resource.res file to the executable when building. cl /EHsc source.c /link resource.res

What is the IDE that you are using?

WolfPack
Postaholic
Moderator
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You