473,775 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pyHook equivalent for WH_SHELL hooks?

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 keyboard and mouse hooks.

My own experiments have not succeeded, as I never have programmed in C/C++
before, let alone a python extension, but I am willing to learn. (I managed to
do a test extension without any useful functionality).

I have difficulties understanding how my hook will cope with multithreading. As
far as I understand, a windows hook dll is loaded into the address space of
every running program. How does a hook handle concurrency and how exactly does
it call the python function? Will the python function run on another thread? How
do I call a python function on another thread?

pyHook claims to be open source, but I could only find the python part of the
source, the C part seems to be missing on sourceforge.net (correct me if I am
wrong).

Is there already something like pyHook for WH_SHELL hooks?
If not, how does pyHook work internally and is its C source available?

I would be glad if anybody could help or point me in the right direction. I
already tried the de.comp.lang.py thon and a web forum full of nerds ;)

Regards,
Jan Böcker
Apr 21 '07 #1
0 1347

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

Similar topics

0
5141
by: yaktipper | last post by:
WH_JOURNALPLAYBACK and WH_JOURNALRECORD These hooks are difficult to get working in C#, but after much piecing together of various code snippets from different language examples across the Net, I have working code. If anyone is interested in the code, please email me. It's not perfect, but it does work. I had a need to send keys and mouse events to an app that checked the
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...
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."
4
6061
by: abcd | last post by:
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...
1
2597
by: JJ | last post by:
I'd like to know whether or not I can use a global WH_SHELL hook in Vista? Thanks
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
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...
1
7464
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
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
5360
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4017
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

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.