473,788 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pyHook or SetWindowsHookE x

I am having trouble with pyHook on python 2.4.1. Basically I have a
python app that uses pyHook to capture keyboard events and write them
straight to a file. The application is running as a service on a
windows machine. If I am at that windows machine the application
works just fine, logging my keystrokes. However, if I use Remote
Desktop to connect to the machine and open up say Notepad it doesn't
capture the keystrokes. Is this a problem with pyHook? or is it he
way Windows handles the events?

Is there a way to setup my own hook without pyHook using just python?
i think the function I am interested in is SetWindowsHookE x.

Thanks in advance.

Feb 27 '07 #1
4 6063
anyone?

Feb 28 '07 #2
:(

Mar 2 '07 #3
On Mar 2, 7:01 pm, "abcd" <codecr...@gmai l.comwrote:
:(
The answer depends on which GUI library you use.

E.g. if you use MFC there is an object called win32ui.PyCWnd that has
methods for hooking key strokes.

Mar 3 '07 #4
On Feb 27, 9:01 am, "abcd" <codecr...@gmai l.comwrote:
I am having trouble with pyHook on python 2.4.1. Basically I have a
python app that uses pyHook to capture keyboard events and write them
straight to a file. The application is running as a service on a
windows machine. If I am at that windows machine the application
works just fine, logging my keystrokes. However, if I use Remote
Desktop to connect to the machine and open up say Notepad it doesn't
capture the keystrokes. Is this a problem with pyHook? or is it he
way Windows handles the events?

Is there a way to setup my own hook without pyHook using just python?
i think the function I am interested in is SetWindowsHookE x.

Thanks in advance.
I'm pretty sure it's not a problem with pyHook. I'm also fairly sure
that you can't log the keystrokes of someone who is logged onto your
machine from another; that would be a major security flaw. The only
way (I think) this would work is if you wrote your own remote desktop
program that logged keystrokes, and then sent it to the remote
computer when logging off.

Cheers,
Jordan

Mar 4 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1193
by: Chris Westbrook | last post by:
I want to use the pyHook module to capture all keyboard input and write it to a file. I have a script that works fine with the command prompt, but I have a few issues I need help with. First, I want to be able to set up an html page that has a link to this script and have it start running and collecting output, and then use some keystroke like alt+f4 to terminate the application. It seems when I run this script from internet explorer...
15
11900
by: bruno | last post by:
I need some help on how write SetWindowsHookEx in vb.net 2005 to hook kb input. this is the statement: hHOOKKb = SetWindowsHookEx( _ WH_KEYBOARD, _ lpfn, _ hMod, _ dwThreadId) And this is from MSDN Library: lpfn Pointer to the hook procedure.
0
1229
by: RayS | last post by:
(Note: there's not a lot of traffic on Win32, so I'm cross-posting here...) To debug pyKeyLogger, I wrote this with pyHook (and compiled with py2exe on Win2K), which prints the ascii codes as expected on Win2K: import pyHook import time import pythoncom def OnKeyboardEvent(event): print event.Ascii
0
2779
by: learner404 | last post by:
Hello, I have a Windows Pyhon-Tk app which need to capture mouse end keyboard events even when the app is not in focus. On Windows so far I've used the excellent PyHook which does the job perfectly: " The pyHook library wraps the low-level mouse and keyboard hooks in the Windows Hooking API for use in Python applications."
0
1348
by: =?ISO-8859-15?Q?Jan_B=F6cker?= | last post by:
Hi, i want to write an app which has to log various user activity, such as opening folders and office documents, to help the user keep an overview about what open windows are related to one task he/she is currently doing. I thought of using a windows shell hook, which notifies the program similar to a keyboard hook when a top-level window is created or destroyed. The pyHook extension shows that this is possible, but only supports...
0
1119
by: randy.tucker7 | last post by:
I use pyhook to monitor user usage of keyboard and mouse. According to pyhook specs, event.time hold the number of seconds since the epoch. However, when I use the example source code I get numbers like 358054093, which translates to 07 May 1981.. Can anyone explain to me what am I doing wrong? Thanks.
1
1856
by: Gandalf | last post by:
hi every one. I have program which uses this pyHook lib, and when I try to compile it using py2exe the pyhook don't work. it gives me no error. the program works fine beside the function of this lib. why does it append ? is their any solution? I would be glad to know if anyone ever experienced this problem and if he solve it eventually
1
1768
by: Gandalf | last post by:
If you want to compile your program the new py2exe release 0.6.8 wont work! the pyhook function will be ignored you'll have to uninstall the 0.6.8 version and to install the 0.6.6 instead it took me 2 days to find the solution. maybe some day someone will bump the same problem and find this
5
4560
krungkrung
by: krungkrung | last post by:
Hi everyone! Im new to vb.net. I'm currently recoding my vb6.0 codes to vb.net(for upgrading purposes), unfortunately some of the codes dont work/execute the way it executes in vb6.0, though I never get any error. That is, the program runs without error but the function being called dont execute. Can anybody help me figure out this matter?? ***HERES WHAT SHOULD THE PROGRAM DO.... message box should always display at the center of the owner...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.