Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Detect API Calls

Detect API Calls

Scheduled Pinned Locked Moved C#
questioncsharpjsontutorial
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    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.

    C 0 2 Replies Last reply
    0
    • L Lost User

      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.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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 )

      L 1 Reply Last reply
      0
      • C Christian Graus

        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 )

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        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

        T 1 Reply Last reply
        0
        • L Lost User

          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

          T Offline
          T Offline
          Thomas Weller 0
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • L Lost User

            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.

            0 Offline
            0 Offline
            0x3c0
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups