Detect API Calls
-
-
How can I detect, another application API calls ? An example: Microsoft Notepad calls GetAsyncKeyState(); I want to "detect" it in C#. And write it to in a message box "Notepad called GetAsyncKeyState !"... How can I do it in C# ? Thanks, Best Regards.
You can rewrite the dlls that house the APIs to add some sort of logging that you can refer to. Otherwise, no.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
-
You can rewrite the dlls that house the APIs to add some sort of logging that you can refer to. Otherwise, no.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
First of all, thanks for your reply. but I don't understand you clearly. rewrite dlls ? I don't want to touch windows dlls that includes APIs. I want to make an exe with C#. When you run it, it will detect notepad running, And wait until "notepad.exe calls GetAsyncKeyState(); from user32.dll
-
First of all, thanks for your reply. but I don't understand you clearly. rewrite dlls ? I don't want to touch windows dlls that includes APIs. I want to make an exe with C#. When you run it, it will detect notepad running, And wait until "notepad.exe calls GetAsyncKeyState(); from user32.dll
That's just not possible AFAIK. Out of curiosity: What are you trying to do? Regards Thomas
www.thomas-weller.de Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Programmer - an organism that turns coffee into software. -
How can I detect, another application API calls ? An example: Microsoft Notepad calls GetAsyncKeyState(); I want to "detect" it in C#. And write it to in a message box "Notepad called GetAsyncKeyState !"... How can I do it in C# ? Thanks, Best Regards.
You can't. When another application makes an API call, the only thing that knows about it is the OS itself. Other processes aren't notified. You could rewrite [kernel32.dll|user32.dll|etc] provided you understand assembly language, but AFAIK that would be illegal and System File Protection would kick up an error. So, in short: No, you can't