• C

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.
jhjeonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Get Cisco Certified in IT Security

There’s a high demand for IT security experts and network administrators who can safeguard the data that individuals, corporations, and governments rely on every day. Pursue your B.S. in Network Operations and Security and gain the credentials you need for this high-growth field.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.