how to load .ani cursor in visual c++?
#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).
精彩评论