Solved

How to temporary block mouse and keyboard input to my application?

Posted on 2014-10-31
10
255 Views
Last Modified: 2014-10-31
How to temporary prevent users’ mouse and keyboard input to my application window, for instance, when the application is processing some data? I don’t want to use API BlockInput, as it completely blocks input to ALL applications, which is not good. I only need to block input to MY application, for instance in the manner: user hovers mouse over my app window, the cursor changes to Hourglass, and the mouse/keyboard input to my app window is disabled, until the processing is done, and input again explicitly enabled. Ideally, I should be able to specify handle to the window of my app I wish to block, or perhaps event to have option to block input to all windows belonging to my applications.
0
Comment
Question by:npaun
  • 4
  • 4
  • 2
10 Comments
 
LVL 2

Expert Comment

by:Glen Richmond
ID: 40415474
use variations of enabled=true and false to make controls like text boxes and command buttons inaccesible.
i.e.
MyCommandButton.enabled=false
MyTextBox.enabled=false

then for the duration of the processing use screen.mousepoint=11 to show busy..

example of mouse pointer :-
http://support.microsoft.com/kb/71105
0
 

Author Comment

by:npaun
ID: 40415484
well, that was an obvious approach... problem is, I have A LOT of controls on my form, and I would like not to have to disable/enable each and every of them... I'm looking for a more elegant solution, if there is a such...
0
 
LVL 2

Expert Comment

by:Glen Richmond
ID: 40415487
well i guess im out!
0
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
LVL 2

Expert Comment

by:Glen Richmond
ID: 40415490
you can use a for each to cycles through the controls and set the enable props without having to implicitly name them all..

for each ctrl in form.controls
     ctrl.enabled=false
next ctrl
0
 

Author Comment

by:npaun
ID: 40415496
yes, I'm familiar with that approach too...
0
 
LVL 2

Expert Comment

by:Glen Richmond
ID: 40415501
guess you dont need me then ... still a thanks wouldnt have hurt!
0
 

Author Comment

by:npaun
ID: 40415512
thanks for the post
0
 
LVL 5

Accepted Solution

by:
ReneD100 earned 500 total points
ID: 40415557
I haven't used VB6 in forever, but can't you just use me.enabled to disable the whole form?
0
 

Author Comment

by:npaun
ID: 40415576
it works, just perfect...
Well, this is a little embarrassing, I've never before had this need, and I simply overlooked the simplest possible approach... I never actually noticed before that the Form too has the Enabled property, nor used it... I simply jumped ahead I assumed there probably must be some convoluted approach... LOL
Thanks. Problem solved.
0
 
LVL 5

Expert Comment

by:ReneD100
ID: 40415585
Haha, sometimes the solutions are very easy! I use it in Access sometimes to make sure users cannot make changes while stuff is being processed behind the scenes. VB6 and VBA aren't that far apart. Glad you got it going though!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

803 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