473,775 Members | 2,576 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 6061
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
1192
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
11898
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
1347
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
1855
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
1767
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
4559
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
9622
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
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10107
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10048
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9916
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
6718
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2853
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.