Solved

BlockInput not working on Windows 7

Posted on 2011-02-11
8
2,842 Views
Last Modified: 2012-05-11
Hi

I have a program in VB6 that use the BlockInput API, however on Windows 7 , that api doesn't work. I have searched on google and i found that.

But no solution is provided, do you have an alternate api to block the keyboard and mouse on Windows 7 ?

thank you very much !
Mariano.
0
Comment
Question by:kidspc
[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
  • 4
  • 3
8 Comments
 
LVL 4

Accepted Solution

by:
HawyLem earned 500 total points
ID: 34875695
That requires administrative privileges on Win7
0
 

Author Comment

by:kidspc
ID: 34875732
we have done that, give administrative privileges to the accounts and nothing, we also used the Adminitrator account and didn't work
0
 
LVL 4

Expert Comment

by:HawyLem
ID: 34878388
The system will unblock input in the following cases:

The thread that blocked input unexpectedly exits without calling BlockInput with fBlock set to FALSE. In this case, the system cleans up properly and re-enables input.
The user presses CTRL+ALT+DEL or the system invokes the Hard System Error modal message box (for example, when a program faults or a device fails).

Is any of these your case?
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 13

Expert Comment

by:5g6tdcv4
ID: 34878927
Try turning UAC off, for testing purposes only, and  see if your program works then turn UAC back on
0
 

Author Comment

by:kidspc
ID: 34890751
@HawyLem, no those are not our case.  We just try to block the computer and the api is called without the result we expect, only on Windows 7.  If we try to do that on XP, 98 or Vista it works perfectly.
0
 
LVL 4

Expert Comment

by:HawyLem
ID: 34894444
Return Value

Type: BOOL

If the function succeeds, the return value is nonzero.

If input is already blocked, the return value is zero. To get extended error information, call GetLastError.

Please check the return value to realize if the function has succeeded. Otherwise check the error
0
 

Author Comment

by:kidspc
ID: 34931036

thanks all of you for your opinions to resolve this.

HawyLem,  your last message give us a clue about what was wrong.  Your first answer was right, however due to some "if" the code was not runing to the BlockInput API.

So, thanks again for your help, i give the points to HawyLem.
0
 

Author Closing Comment

by:kidspc
ID: 34931042
in the way to check the return value of BlockInput API we discover why the function was not called
0

Featured Post

SuperAntiSpyware Licenses Discounted by 25% !

Exclusive offer to Experts Exchange Members!
Buy SuperAntiSpyware License(s) from us and save 25% on the regular purchase price.
- Includes Full SuperAntiSpyware Vendor Support Entitlements
- Your Subscription does not begin until you activate your license
- Buy for your friends

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA code for SubFolders 11 49
Changing Monitor IDs 3 54
msiexec won't run 4 31
WSUS Kb4012212 and Kb4012215 not applicable 14 37
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

751 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