简体   繁体   中英

how to load .ani cursor in visual c++?


Ok so here are the steps i followed in creating a custom .ani cursor but no luck!
1. I created a resource.h file and added

#ifndef RESOURCE_H
#define RESOURCE_H

#define MyCustomBusyCursor 100

#endif

2 Then i created .rc file (by right clicking the project name and selecting Resource File). But now i do not know how to add path to my .ani file. How would I load my cursor in main? I am guessing i will have to use LoadCursor() function.

Thank you.

Ok, in case anyone is curious i used this code to load a custom cursor:

HCURSOR hCurBusy =  LoadCursorFromFile(TEXT("myAnimCursor2.ani"));
HCURSOR hCurStandard =  LoadCursorFromFile(TEXT("C:\\Windows\\Cursors\\arrow_m.cur"));


    SetSystemCursor( hCurBusy, 32512);
    Sleep(1500);
    /* or whatever you wanna do...*/
    DestroyCursor(hCurBusy);
    SetSystemCursor( hCurStandard, 32512);
    DestroyCursor(hCurStandard);

You do not need to do resource stuff. But the stuff i did is for changing system cursor, maybe for an app you might have to use LoadCursor function(s).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM