Solved

How uses Animation Cursor  ?

Posted on 1998-04-09
10
640 Views
Last Modified: 2012-06-27
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
Comment
Question by:jhjeon
10 Comments
 
LVL 11

Expert Comment

by:alexo
ID: 1258063
Seems OK to me.
Run it under a debugger and see what error it reports.
0
 

Author Comment

by:jhjeon
ID: 1258064
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
 
LVL 2

Expert Comment

by:lortega
ID: 1258065
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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:jhjeon
ID: 1258066
I changed LoadCursorFromFile to LoadCursor..(Iortga's comment)
but result is same ..(system down).
Is there anyone know this problem ?
HELP ~~~~... T.T
0
 

Author Comment

by:jhjeon
ID: 1258067
I want to solve this problem.
if you are technical programer,
please send me your answer....

0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1258068
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
 

Author Comment

by:jhjeon
ID: 1258069
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
 
LVL 10

Accepted Solution

by:
RONSLOW earned 100 total points
ID: 1258070
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
 

Author Comment

by:jhjeon
ID: 1258071
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
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1258072
you're welcome .. good luck with your project

0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question