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. Application metering

Application metering

Scheduled Pinned Locked Moved C#
questioncsharpc++
4 Posts 3 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.
  • V Offline
    V Offline
    Villgott
    wrote on last edited by
    #1

    What is the easiest way to detect when applications launches and terminates using C#? What I want to do is make a program that monitors my application usage. I've read that this can be accomplished with a c++ dll that uses hooks, but I would preferably use only C#.

    E A V 3 Replies Last reply
    0
    • V Villgott

      What is the easiest way to detect when applications launches and terminates using C#? What I want to do is make a program that monitors my application usage. I've read that this can be accomplished with a c++ dll that uses hooks, but I would preferably use only C#.

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      You can wrap C++ dll up into assembly that can be used in .NET enviroment << >>

      1 Reply Last reply
      0
      • V Villgott

        What is the easiest way to detect when applications launches and terminates using C#? What I want to do is make a program that monitors my application usage. I've read that this can be accomplished with a c++ dll that uses hooks, but I would preferably use only C#.

        A Offline
        A Offline
        Ashok Dhamija
        wrote on last edited by
        #3

        If your purpose is to just record the application usage and that too only for one application [or per application], then you can also consider the simple solution of using the DateTime.Now method at the time of start of your application and the closure of your application. Do it from that application itself. And, store these values in some file or place on the user machine in the form of some log file or otherwise. On the other hand, if your purpose is to "monitor" your application in some other manner (say by way of initiating some other action on the system), then you may consider some other solution depending upon the type of requirement. Regards, Ashok Dhamija _____________________________ Padam Technologies

        1 Reply Last reply
        0
        • V Villgott

          What is the easiest way to detect when applications launches and terminates using C#? What I want to do is make a program that monitors my application usage. I've read that this can be accomplished with a c++ dll that uses hooks, but I would preferably use only C#.

          V Offline
          V Offline
          Villgott
          wrote on last edited by
          #4

          Thank you for the answers but I was hoping that that I could monitor all program (all programs on the computer, not just my application) launches and terminations with pure C#. If this isn’t achievable then I will have to use enjoycrack’s method.

          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