15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Wait Cursor and mouse movement

Alix -- AARGUELL@sys1.com
Tuesday, August 20, 1996


Environment: Windows95, VC++ 4.0

I am having a problem with the wait cursor.

I call BeginWaitCursor(), and as along as I do not move the mouse, the   
cursor is an hourglass.  The minute I move the mouse, it turns back to   
the arrow, without me having called EndWaitCursor().

I am not handling the message WM_MOUSEMOVE anywhere.

Has anyone else experienced this? Or does anyone have any suggestions on   
how to make the wait cursor stay a wait cursor?


Alix Arguelles
AARGUELL@SYS1.COM



MICHAEL@datatree.com
Sunday, August 25, 1996

[Mini-digest: 4 responses]

Since you are displaying the wait cursor, this seems to indicate
that  your program is executing a lengthy process.

Presumably, you have a function that contains a call to PeekMeesage.
Or, some similar method of allowing other messages to be
processed while your "wait cusor" is being displayed.

Simply add RestoreWaitCursor to this functionality. You
might also consider using  WaitMessage in your loop.
As the name suggests, you will only return from  WaitMessage
when a message occurs - like a mouse movement. You might
want to put your RestoreWaitCursor after the WaitMessage call.

>
>Environment: Windows95, VC++ 4.0
>
>I am having a problem with the wait cursor.
>
>I call BeginWaitCursor(), and as along as I do not move the mouse, the   
>cursor is an hourglass.  The minute I move the mouse, it turns back to   
>the arrow, without me having called EndWaitCursor().
>

Michael Thal        michael@datatree.com                              
Data Tree Corp.     http://www.datatree.com


-----From: Joern Dahl-Stamnes 

I have had the opposit problem. Sometime, when I call EndWaitCursor, the
cursor remain a hour glass until I move the cursor. I have to call
EndWaitCursor twice before the cursor return to normal state.

-- 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Joern Yngve Dahl-Stamnes, Norwegian University of Science and Technology  |
| e-mail: Jorn.Dahl-Stamnes@fysel.unit.no                                   | 
| phone : +73 59 44 12, fax: +73 59 14 41                                   |
| Surfing the net? Try http://www.fysel.unit.no/dahls/dahls.html            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-----From: Tim Hagemann 

You should use the CWaitCursor class of the mfc which is very fine. Have =
you created a window class of your own and registered a mouse cursor in =
this class ? If so, this might be the problem !

Tim Hagemann
ifa informationssysteme

-----From: "MHENRY.UMI.COM" 

Did you try using the CWaitCursor class?   
If you put 
 
CWaitCursor wait; 
 
It creates a wait cursor until the object "wait" goes out of scope.  More 
convenient than using BeginWaitCursor() stuff. 
 
 
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\    
*  Matthew Henry  -- UMI          *  
*  mhenry@umi.com                 * 
\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/   
  




| Вернуться в корень Архива |