0

I want to loging all programs and files what user had opened, to create own frequently used programs list in Windows using C# programming language. Thanks for helping.

Arthur
  • 3
  • 2

2 Answers2

1

There is no easy way to accomplish this. Windows does not provide such events.

What you can do is:

  1. Each couple of seconds loop thru all opened windows or running processes and get their informations. For windows enumeration you can use logic from: http://www.codeproject.com/KB/cs/WindowTabifier.aspx

  2. You can use methods like injecting dll into the taskmanager, hooking the TerminateProcess in Kernel32.. etc.. Related sample: http://www.codeproject.com/KB/threads/taskex.aspx,

HABJAN
  • 9,212
  • 3
  • 35
  • 59
0
Process[] processlist = Process.GetProcesses();

foreach(Process theprocess in processlist){
Console.WriteLine(“Process: {0} ID: {1}”, theprocess.ProcessName, theprocess.Id);
}

This will give you the details of the process that is currently running, can't you periodically review this list to find new applicatons launched.

KBBWrite
  • 4,373
  • 2
  • 20
  • 22