Solved

BlockInput not working on Windows 7

Posted on 2011-02-11
8
2,828 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

OfficeMate Freezes on login or does not load after login credentials are input.
While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

756 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