Solved

BlockInput not working on Windows 7

Posted on 2011-02-11
8
2,781 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
  • 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
 
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Lost sound on my Windows 7 PC 3 31
How do I hook up a bluetooth speaker? 20 87
EaseUS Todo back-up doing multiple versions? 8 35
Word Directory is not in the drop down list 4 24
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

948 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now