Solved

Program that hooks another program's thread, having problems....

Posted on 2003-10-31
3
207 Views
Last Modified: 2010-04-17
I have inherited a program written in Visual C++ 6 that works behind the scenes to hook another application and monitor the user's keystroke activity in that target program.  The hooking program was originally written for Windows 95.  I have been asked to upgrade it and migrate it to Windows 2000 and Windows XP.  However, I have a problem.  The hooking program cycles in the background looking for instances of the target application and then hooks the process and thread of the given instance, allowing the target program to have as many instances up on the desktop as the user wants.  The hooking program saves off process and threadids, along with window ids to a collection object and when a specific window in a particular instance of the target application has focus, the hooking application monitors that instance of the target application.  This is how the program works on Windows 95.  However, when I run this program on a machine with either Windows 2000 or Windows XP I cannot activate more than one instance of the target program, otherwise I get the "Switch To", "Retry", "Cancel" error box and the desktop freezes up.  This hooking program was patterned after code found in the book, Programming Applications for Microsoft Windows by Jeffrey Richter, using much of Chapter 22 quidance.  This is a program that uses API hooking and the API functions to locate instances of specific windows.  However, no matter what I try to do to debug this program, I cannot figure out why it does not allow more than one instance of the target application to appear on the desktop at any given moment on a computer using the Windows 2000 or Windows XP operating systems, and why any effort to increase the number of instances of the target application running on the desktop freezes up the computer.  Any information, or help would be greatly appreciated.

Thank you.
0
Comment
Question by:Hawkeye67
  • 2
3 Comments
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9657913
It's rather difficult to help without looking at the code in this case.
I can only recommend the following link:
http://www.codeproject.com/system/hooksys.asp
0
 
LVL 6

Accepted Solution

by:
GloomyFriar earned 500 total points
ID: 9657978
Just register (it's free) to get source codes there.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
topping1 challenge 7 93
listing all functions in JavaScript 19 202
egit plugin on eclipse 8 64
What are programming codes and how do they work? 7 95
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

809 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