473,378 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Trapping Another Windows Events

Heya Everyone,

I am currently creating an application audit system that will log how
much use an application will be used by employees of my company, and
the type of features they use...so I wanted to have a .NET program or
service running in the background that would log what actions they
perform in specified applications and update our main database...but I
am running into problems trapping the events of when people click on
buttons etc.,

I can currently trap where the mouse is on the screen and do a dodgy
report, but it is limited by many other extenuating factors so...

What I am looking for a way to trap another Window's message events.
I.e., I want to create a program that will log when someone clicks on
a specified application's button, or find out when someone changes the
selection from a listbox...

I don't know if this is at all possible. I have tried subclassing
examples, but they never work or lock up my machine and only seem to
want to subclass on an application form, but I wqant to go down to the
level of the controls

Does anyone know of any C#, VB.NET or even VB6 source code that can do
this or could possibly point me in the right direction..
Thanks in advance and keep up the good work :D
Nov 15 '05 #1
2 4907
Hi,

Seems that global Windows message hook is what you need. This can be
achieved in C# but it seems to me that unmanaged languages are better for
this purposes as you'll most likely be doing much raw API calls. You may try
to search the Net for so-called "keyloggers" and for setting up global hooks
(Google Groups search would be suitable here too).

It is also quite possible you'll find most of the examples written in C/C++
but VB6 ones should also exist.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

"Mr Sparkles" <pr***********@hotmail.com> wrote in message
news:e9**************************@posting.google.c om...
Heya Everyone,

I am currently creating an application audit system that will log how
much use an application will be used by employees of my company, and
the type of features they use...so I wanted to have a .NET program or
service running in the background that would log what actions they
perform in specified applications and update our main database...but I
am running into problems trapping the events of when people click on
buttons etc.,

I can currently trap where the mouse is on the screen and do a dodgy
report, but it is limited by many other extenuating factors so...

What I am looking for a way to trap another Window's message events.
I.e., I want to create a program that will log when someone clicks on
a specified application's button, or find out when someone changes the
selection from a listbox...

I don't know if this is at all possible. I have tried subclassing
examples, but they never work or lock up my machine and only seem to
want to subclass on an application form, but I wqant to go down to the
level of the controls

Does anyone know of any C#, VB.NET or even VB6 source code that can do
this or could possibly point me in the right direction..
Thanks in advance and keep up the good work :D


Nov 15 '05 #2
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote in message news:<eQ**************@TK2MSFTNGP12.phx.gbl>...
Hi,

Seems that global Windows message hook is what you need. This can be
achieved in C# but it seems to me that unmanaged languages are better for
this purposes as you'll most likely be doing much raw API calls. You may try
to search the Net for so-called "keyloggers" and for setting up global hooks
(Google Groups search would be suitable here too).

It is also quite possible you'll find most of the examples written in C/C++
but VB6 ones should also exist.

--


Hi Dmitriy,

Thanks for the speedy reply :D

Yeah I have been playing around with such things, however, I have not
had much luck getting this kind of thing to work. Windows seems to
have issues with releasing the sub-class from a control...and I can;t
even get the damn thing to peek at the messages correctly. I don't
actually want to trap the keyboard input...I don't believe in spying
on my workmates and that would be a massive security breach which I am
not going to facilitate, but rather I would trap when the click on a
button in a particulart program that I select...For example, if my
boss wants me to do a software audit for the next year's budget, and
we are cutting back (Like everyone is nowadays) and most of our staff
use MS Word, but we find out they are not using the extra
functionlaity and just typing things out and using spell checkers,
then we could get alternatives with lower costs and better
training...so the only way I could do that is by finding a way to trap
the notifications that go in and out of the controls to find out how
the staff are using the software...

I can find out what software they are using by peeking into the window
name...and I can find out the locations of the controls in regards to
the screen, but I just can't read when a user clicks on a button, or
selects a particular option from a drop-down box etc., these are the
core things I need to know for this thing to work and work well...

so again, if anyone has any ideas how to do this, then please let me
know...
Nov 15 '05 #3

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

Similar topics

4
by: Wugi | last post by:
I'm trying to find an equivalent of key-event trapping which is easy in QBasic. Several of my programs build up a geometric figure with two parameter line families, eg with two nested for..next...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
2
by: Kevin | last post by:
Hi, I need to trap when a workstation is locked. I saw this article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/winlogon_notification_packages.asp, but i...
5
by: Jeff Ptak | last post by:
Can anyone tell me how to trap mouse click events in the Image control? I am trying to implement an image zoom feature using JavaScript where the user could "draw" a zoom box (aka rubber band...
1
by: Chirag Malvi | last post by:
hello all, I am developing the web application using ASP.net and VS.2003 IDE. here is the situation which i want to implement. 1) User is browsing some webform. I want to trap this event....
0
by: Hanover | last post by:
I have a very weird situation. I have several controls on a form, all of them have on-changed events that are supposed to pass their values to a dataset. The problem is, their events suddenly...
1
by: Elmo Watson | last post by:
Up until now, I've done all the work (gui/front end programming, classes, etc) I've done all my error trapping (try/catch) in the methods in the code behind. Now I've got an opportunity to do...
1
by: jan.loucka | last post by:
I'm developing WinForms application in .NET 2.0 that talks to web service. The automatically generated proxy (reference class) has got methods for both synchronous and asynchronous invocations of...
19
by: zacks | last post by:
I have a .NET 2.0 MDI application where the child form has a Tab Control. Each of the Tab in the Tab Control has a Validating event to handle what it should do when the user changes tabs. But...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.