Link to home
Start Free TrialLog in
Avatar of Xiaoyang
Xiaoyang

asked on

How to disable the mouse input in CView?

I use BeginWaitCursor() and EndWaitCursor() to set the cursor as an hourglass when I am opening many files in my application. Now I want to disable the mouse input of all the views when I am opening files. How can I do that? Can I get the information of the cursor to decide whether the mouse input is valid, that is, if the cursor is an hourglass, the view cannot be updated and cannot receive any mouse message? Or is there a better way to do it? Thank you!!! :1
Avatar of Nosfedra
Nosfedra

Why trying to see if the cursor is a hour-glass? I think it would be better and simpler to set a global variable or a member in your MainFrame class that would indicate that currently there is a time-consuming file operation in progress.

You'd clear that variable (set it to false, for instance) once the operation is done.

Then, override the OnUpdate member of your view class and check for the variable. If it is true (fileOpInProgress), don't do anything.

Hope this helps.
--Razvan
ASKER CERTIFIED SOLUTION
Avatar of williamcampbell
williamcampbell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Xiaoyang

ASKER

Thank you so much, guys :)

 Your welcome .. Small matter of accepting answer :)