Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello all,

OLD CONTENT
Years ago I made a couple of services which used a dll to set a system wide hook to prevent the user to use the mouse or keyboard while our program was not loaded into memory (a kind of kiosk mode*).

I've tested the two services again in a windows XP virtual machine and they work perfectly.

I've tested both of them in Windows 7 and no way.

Anyone know about differences between system wide hooking in both operating systems?

*About kiosk mode and my specific needs:
- I need to auto logon into the computer. (already done by the machine software).
- After logon some services start, and after one service is started my application must be started (which is already done by the machine software).
- I need to work using administrator user. (need from the machine software).
- I don't want the user to be allowed to access the operating system unless a specific password is set into my application.
- I don't want the user to be able to move the mouse unless a specific password is entered in my application.

NEW CONTENT
As far as I've seen, if I start the hook from a normal app it works like charm, but if I start the hook from the service it fails miserably. This looks like services are not running in the "user space" anymore... I've tried also to use XYNTService to start the application normally from a service and the same result...

Any advice?

As always thank you in advance!
Posted
Updated 3-Feb-15 4:34am
v4
Comments
Philippe Mori 30-Jan-15 12:40pm    
Reconsider your decision. Not a good idea to do that anyway as it can cause additionnal failure points in the system. If you need kiosk mode, then why are you trying to reinvent the wheel?
Joan M 30-Jan-15 15:03pm    
Yes, kiosk mode is probably what I need, I've tried to find out a guide on how to deploy the kiosk mode on a windows 7 computer and I've found several guys explaining tricks to do it, but it looks like not enough...
Those two hooks are preventing the user to use the mouse at all while our application is not loaded and also deleting all the keyboard shortcuts that are dangerous (alt+f4...).
Do you know of a good kiosk mode resource to start tampering with it?
Thank you!
Jochen Arndt 2-Feb-15 7:23am    
Regarding the mouse you can try to disable/enable the device itself (not all drivers support this). This can be done using the SetupDixxx functions or using the devcon.exe command line utility from the Windows Driver Kit (WDK). When using this method you can also disable at shutdown so that the mouse is disabled at boot time until re-enabled.
Joan M 2-Feb-15 7:55am    
I'll take a look at it this afternoon after reaching the office again! thank you Jochen.
My "problem" is that I'm making special machine prototypes and I try to keep the user away from configurations...
So I developed a couple of services that started automatically before the user logged in and that started those keyboard and mouse hooks, after my application started I disabled the mouse hook.
But... this is not working at all.
A pity, in XP have worked without touching a code line... :(
Mike Nordell 2-Feb-15 18:03pm    
I wonder... could implementing your own GINA help? I.e. not even allowing any user but "your application" to log in (interactively)? That would void the need to "lock out" mouse and keyboard input. On the other hand, we have these clickable "Change keyboard language" and "Accessibility" icons even on the login screen in Win7. Could those interfere with your app, or could they perhaps even be useful?

As for the service working in XP but not 7, could it be due to stricter security in Win7 (probably also Vista)? Maybe grab a copy of a checked Win7 (should be readily available from MS) and attach a serial or 1394 debugger?

1 solution

Maybe this helps?
Not a good new anyway... :-(
 
Share this answer
 
v2
Comments
Joan M 30-Jan-15 9:44am    
Not at all... the registry settings are not helping and I don't plan to create a separate thread...
I'm looking into raw input, which it doesn't look like what I do need... but...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900