Brandon Corfman | 5 Dec 2000 04:48
Picon

Re: Any wrappers available for Animated Cursors?

Ken,
You can bind any binary file type into the VC++ resource editor. When 
you use Import, simply create a new resource type like "ANICURSORS". 
You'll see the binary data in the editor.

To load and use the cursor:
const DWORD VERSION_NUM = 0x00030000;
HRSRC hrsrc = FindResource(NULL, MAKEINTRESOURCE
(IDR_ANICURSORS1), "ANICURSORS");
DWORD dw_size = SizeofResource(NULL, hrsrc);
HGLOBAL hglob = LoadResource(NULL, hrsrc);
LPBYTE p_bytes=(LPBYTE)LockResource(hglob);
HCURSOR h_cursor = (HCURSOR)CreateIconFromResource(p_bytes, dw_size, 
FALSE, VERSION_NUM);

Regards,
Brandon

--- In wtl@..., "Ken Ostrin" <keno <at> p...> wrote:
> Hello,
> 
> I am looking for a quick and easy way to display an animated cursor 
> in my application.
> 
> After poking through some help files, I found the 
> LoadResourceFromFile function correctly loads a .ANI file and 
> converts it into a usable cursor. However, I would prefer to bind 
> the file into my resources. 
> 
> Any ideas?
> 
> Thanks
> 
> Ken


Gmane