Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2975
  • Last Modified:

BlockInput not working on Windows 7

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
kidspc
Asked:
kidspc
  • 4
  • 3
1 Solution
 
HawyLemCommented:
That requires administrative privileges on Win7
0
 
kidspcAuthor Commented:
we have done that, give administrative privileges to the accounts and nothing, we also used the Adminitrator account and didn't work
0
 
HawyLemCommented:
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
5g6tdcv4Commented:
Try turning UAC off, for testing purposes only, and  see if your program works then turn UAC back on
0
 
kidspcAuthor Commented:
@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
 
HawyLemCommented:
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
 
kidspcAuthor Commented:

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
 
kidspcAuthor Commented:
in the way to check the return value of BlockInput API we discover why the function was not called
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.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now