473,465 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Grabbing handles on another process' forms

Hello! I was hoping to write a program that could monitor another
process' controls, but I know nothing about it. So this program would
spawn the monitored program, and it could grab a handle on all its
windows and components and actually read them (like read values in
TextBox's, for instance). I used winspy++ to see how it looks, but
the code for winspy++ is closed so I can't see how he did it. I would
like to do this in C# on the .NET framework. Does anyone know where I
could get started?

Thanks!
Nov 16 '05 #1
1 1935
n!
> the code for winspy++ is closed so I can't see how he did it. I would
like to do this in C# on the .NET framework. Does anyone know where I
could get started?


The functions required to perform this aren't available in the .NET
framework as standard AFAIK. You'll need to P/Invoke them. IIRC spy++ use
the Win32 API methods EnumWindows to retrieve the top level windows along
with EnumChildWindows. Finally installing a hook using the SetWindowsHookEx
method with the WH_CALLWNDPROC hook id and the window handle. Memories a bit
hazy, so it may not be entirely correct but should give you something to
look\think about.

n!
homepage: http://www.btinternet.com/~nfactorial/
blog: http://nfactorial.blogspot.com
Nov 16 '05 #2

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

Similar topics

0
by: Matthew Leiderman | last post by:
Hello, I am working on automating a workflow process for my company. Part of the process requires the user to send a snapshot of their benefits from a secure web site to their manager. I am trying...
11
by: Rohit | last post by:
Hi, Threads in the .NET Framework 1.1 (and possibly in 1.0 also) leak "Event" handles, by Event handles I mean Win32 Event handles which can be monitored using the ProcessExplorer from...
1
by: B Moor | last post by:
Hello, I am quite bogged down with this problem and would like some tips/help if any one has any. Thanks in advance. The Problem ----------- This system initially seemed quite stable for...
4
by: Tony Liu | last post by:
Hi, how can I create multiple new file handles of a file without having to share to file to the other processes? I have a file that will be accessed by multiple threads in my application, each...
5
by: Andrew Baker | last post by:
If you have every had the following error when trying to use load a form in the IDE then read on!!! An exception occurred while trying to create an instance of GSL.Windows.Forms.BrowserFormBase....
18
by: Conrad F | last post by:
Hello all, I am waiting for receipt of files in a directory. I use the FileSystemWatcher to detect when files arrive in said folder. I need to read the data from these files ASAP but the files...
7
by: Simon Verona | last post by:
I have a problem in my application which I believe is due to open handles.. . The symptom that users report is that after they have been using the application for a while, it will randomly just...
29
by: Amer Neely | last post by:
I've got a dynamically built form with checkboxes for each element ( a list of file names in a directory). I need to grab only those checkboxes that are checked, so I can then delete those files. ...
2
by: ngr | last post by:
I have come across a problem because I have too many controls on a form. It says that it cannot create a handle. Now I know that there is a limit of how many windows handles which can be used...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
1
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...
0
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.