开发者

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 RESOUR开发者_C百科CE_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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜