Powered by |
How to add animated cursor (ANI) to an application?A standard situation: I'd like to add You can see yourself that you couldn't add this file in project resourses without confusing. After some iterations what I found out is - it is better to make everything manually: A. Define ID for the resource in //resource.h #define IDR_ANICURSORBUSY 134 //whatever id not used B. Add next line to the project //MyProject.rc IDR_ANICURSORBUSY ANICURSOR "res\\hourglas.ani" Only this method allows having To change cursor I use this: // In the program // To load file cursor I use this: HCURSOR hCurBusy = ::LoadCursor(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ANICURSOR)); HCURSOR hCurStandard = ::LoadCursor(NULL, IDC_ARROW); //... // To set at place you need SetCursor(hCurBusy); //... // Revert to standard SetCursor(hCurStandard);
|