?
Solved

How to disable the mouse input in CView?

Posted on 2003-04-01
7
Medium Priority
?
223 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:Xiaoyang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
7 Comments
 
LVL 3

Expert Comment

by:Nosfedra
ID: 8246922
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
0
 
LVL 12

Accepted Solution

by:
williamcampbell earned 300 total points
ID: 8247983

  You can disable all the mouse input by creating a hidden control and using SetCapture.

  pMyHiddenEdit->SetCapture ();

  no all mouse input will go to *only* that window. when you operation is done

  pMyHiddenEdit->ReleaseCapture ();

 

 
0
 

Author Comment

by:Xiaoyang
ID: 8254801
Thank you so much, guys :)
0
 
LVL 12

Expert Comment

by:williamcampbell
ID: 8255089

 Your welcome .. Small matter of accepting answer :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

765 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