Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

About hooks and NT services.

Posted on 1999-09-14
11
Medium Priority
?
354 Views
Last Modified: 2008-02-01
How can I install a keyboard hook in a NT service?
0
Comment
Question by:cvmilitaru
[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
  • 3
  • 2
  • 2
  • +3
11 Comments
 
LVL 3

Expert Comment

by:BudVVeezer
ID: 2045877
Ok, I could be WAY off, but if I am thinking correctly,. it's not possible to install a keyboard hook, or mouse hook, or any hook on an NT service.  My reasoning is this, it's all over a network, with multiple people using the same program.  Your hook would quickly get consfused with all of the input coming in from different directions...  To ease this, I think Microsoft decided to not allow you to install hooks.  I'm not posting this as an answer yet, but after I do some checking, I might have to come back....  What is it you're trying to accomplish?  Maybe there's a work around.

~Aaron
0
 
LVL 3

Expert Comment

by:BudVVeezer
ID: 2047112
ok, i seem to be way off.  you can implement a keyboard hook in NT.  =)  What are you having troubles with?  I have code to install the hook...

~Aaron
0
 
LVL 1

Expert Comment

by:Aggarwal
ID: 2047347
u can find this code in online MSDN .

search for win32 hooks and will reach the sample code for the same .

save those files and run the sample .

i have tried it ..it works fine .

regards
0
Technology Partners: 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!

 
LVL 1

Author Comment

by:cvmilitaru
ID: 2047671
For BudWeezer and Aggarwal:
I have already done a keyboard proc in a dll for installing in the hook chain. If I load it from a normal application, it works.
 
When I try to load my function from a NT service all seems to be ok, there is none error messege, but the hooks doesn't work.

My questions is what is happen ?
Why the function doesn't work, even if I dont't receive any error messege?

Regards
0
 
LVL 1

Expert Comment

by:Aggarwal
ID: 2048119
can u please post the code !!!
0
 
LVL 3

Expert Comment

by:BudVVeezer
ID: 2048656
part of it could be with my earlier statement of apps running the hook at the same time.  When you debug it, does the hook even get initialized?  Post code por favor.  =)

~Aaron
0
 
LVL 1

Expert Comment

by:syscyk
ID: 2120501
NT Services allow you to interact from the desktop; set the service's profile to Allow Interaction with the Desktop. There is one problem, though, if you allow desktop interaction, you cannot access the network from the service. One or the other, you choose.
0
 
LVL 1

Author Comment

by:cvmilitaru
ID: 2126851
syscyk, your comment is OK. Send it as an answer. And thanks.
cvmilitaru
0
 
LVL 1

Accepted Solution

by:
syscyk earned 800 total points
ID: 2127116
NT Services allow you to interact from the desktop; set the service's profile to Allow Interaction with the Desktop. There is one problem, though, if you allow desktop interaction, you cannot access the network from the service. One or the other, you choose. And thanks to you also, cvmilitaru!
0
 

Expert Comment

by:Daquel
ID: 4761521
Hello, is anyone out there!  I also have run into some problems in NT with the WH_GETMESSAGE hook.  It allows me to look at the message, but I cannot modify it like you normally can outside of NT.  Even more puzzling than that, it only seems to happen when hooking MSWord.  Points being offerred!!
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6820424
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects that and the expert will now receive these points, all verified.
Moondancer
Moderator @ Experts Exchange
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

662 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