Solved

BlockInput not working on Windows 7

Posted on 2011-02-11
8
2,767 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

708 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