-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: Vinil
Message 2 in Discussion

A few questions:
1. Is your external Win32 App a .NET assembly?
2. Do you have access to the sources of the Win32 App ?

If answers to both the questions are NO, you have something on your hands.
If your Win32 App doesn't have any mechanism to support the invocation of 
another application (like a plugin approach or extending some interface) then 
the few available means are slightly complex.
May I ask here what exactly is that you want to do on button click of the Win32 
App? Is it something that has to happen synchronously along with the button 
click?


Some of the ways that immediately come to mind (although might not be 
appropriate ones) are:
* Using IDA32 or W32DASM, you would need to modify Win32 App's button_click to 
provide some info. outside (like setting a registry or db value or writing to a 
file.) Then in your C# app. you will be polling one of these locations (i.e. 
put the loop inside a timer to check for either the reg. value or db value or 
file value) for a change, and when the change occurs, clear the change and then 
do whatever you wanted to do in your C# code (I think a critical section would 
be needed here)
* The second approach is to write a System Wide Hook for Button click and then 
determine whether your app and the intended button has the focus and then 
invoke your C# code
* The third approach is somewhat intensive and longwinded, but is an approach 
anyways. Simply put, it is what the original definition of screen scraping is. 
You will have to scan the interface of the Win32 App and determine a button 
press based on changes in two consecutive images. To make your life easier, 
just capture the window which has the button, of the Win32 App (using the hWnd 
of the main Form, you can get that using Spy++ that comes with Visual Studio) 
and then apply a XOR filter on the two subsequent images to get a button press. 
The XORing will detect only the mouse cursor and any change in the image.

Hope I didn't confuse you :) But unless you have access to the sources, it is 
going to be very difficult if not impossible. And, mind you, unless you own the 
Intellectual Property Rights of the Win32 App, you could be venturing into 
illegal territory with the above approaches. Approach #1 is out and out illegal 
in most of the cases!

In case you need more clarifications lemme know,
Thanks and regards,
Vinil

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to