• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 658
  • Last Modified:

How uses Animation Cursor ?

hello ~
I am programming  animation cursor..

program is well running but when program is closed.
system is down. I don't know why system is down...?

this is my code ..

  case WM_CREATE :
       //load my animation cursor
       cur=LoadCursorFromFile("my.ani");                    
       SetSystemCursor(cur,OCR_NORMAL);
       break;

  case WM_PAINT :
       hdc=BeginPaint(hwnd,&ps);
       EndPaint(hwnd,&ps);
       break;

case WM_DESTROY :
       //set original cursor shape              
       cur=LoadCursorFromFile((LPWSTR)OCR_NORMAL);
       SetSystemCursor(cur,OCR_NORMAL);

       PostQuitMessage(0);
       break;

I will wait your answer....
thanks.
0
jhjeon
Asked:
jhjeon
1 Solution
 
alexoCommented:
Seems OK to me.
Run it under a debugger and see what error it reports.
0
 
jhjeonAuthor Commented:
I'm wondering about programming of animation cursor now.
I have spended on much time in it.
Thus, I tired of it.
If you have any source related in animation cursor,
please send Loading and Deleting part to me.

0
 
lortegaCommented:
The only line that i will change is

       cur=LoadCursorFromFile((LPWSTR)OCR_NORMAL);

for

       cur=LoadCursor(hInstance,IDC_ARROW);

this just let me load normal system cursor...

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jhjeonAuthor Commented:
I changed LoadCursorFromFile to LoadCursor..(Iortga's comment)
but result is same ..(system down).
Is there anyone know this problem ?
HELP ~~~~... T.T
0
 
jhjeonAuthor Commented:
I want to solve this problem.
if you are technical programer,
please send me your answer....

0
 
RONSLOWCommented:
The second LoadCursorFromFile (that is supposed to load the default system animated cursor) will fail and return a NULL handle if there is not animated system cursor (just an ordinary cursor).  Then the SetSystemCursor call will fail.

0
 
jhjeonAuthor Commented:
Function return to NULL or not
my problem is why system is down...

use or not use secound SetSystemCursor..
happen to same result that system is down ..

I think that secound SetSystemCursor is not related to
this problem.

before you send me answer. run this simple source and
examine your answer is correct or not.
0
 
RONSLOWCommented:
I have run it.

Your code causes the system to hang.

This code does not...

at start of program...

#define OCR_NORMAL          32512
HCURSOR hcur;
hcur = ::LoadCursorFromFile ("C\\WINDOWS\\CURSORS\\APPLE.ANI");                    
::SetSystemCursor(hcur,OCR_NORMAL);
      
at end of program...

hcur = ::LoadCursor(NULL,IDC_ARROW);
::SetSystemCursor(hcur,OCR_NORMAL);

It appears that the second LoadCursorFromFile in your code was at fault.

The above code was adapted from a MS KB article that shows how to modify the system cursor.

If you have any other problems, they are not due to the changing and restoring of the cursor
0
 
jhjeonAuthor Commented:
I am Sorry RONSLOW ..

fault was my program mistake
your source is right !!

thanks for your kindness and sincere answer..
have a good time !.
bye bye.. (^.^)

0
 
RONSLOWCommented:
you're welcome .. good luck with your project

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now