CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: block another program from running?

    even if you can identify a process by not looking at its filename (ie internal name, original name, or some kind of signatures like crc2, etc) you will still have a problem in terms of performance, as far as i know. because constant polling for running applications may cause a lot overhead to the system.

    i think what you need is a "notification/event" from the system that an application has started, somekind of a "hook" which i guess is not for .Net world.

    Busy

  2. #17
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: block another program from running?

    Quote Originally Posted by Thread1
    ...
    i think what you need is a "notification/event" from the system that an application has started, somekind of a "hook" which i guess is not for .Net world.

    Regarding global hooking in C# look at this very interesting article
    http://www.codeproject.com/KB/system...obalHooks.aspx this is a very nice approach to do global hooking, using C# with a small workarround using a very small part C++
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

  3. #18
    Join Date
    Jul 2005
    Posts
    141

    Re: block another program from running?

    Quote Originally Posted by Thread1
    even if you can identify a process by not looking at its filename (ie internal name, original name, or some kind of signatures like crc2, etc) you will still have a problem in terms of performance, as far as i know. because constant polling for running applications may cause a lot overhead to the system.

    i think what you need is a "notification/event" from the system that an application has started, somekind of a "hook" which i guess is not for .Net world.

    hmmm.. how do we look at the internal/original name of the filename? thanks

  4. #19
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: block another program from running?

    Quote Originally Posted by imin
    hmmm.. how do we look at the internal/original name of the filename? thanks
    you may use FileVersionInfo...

    Code:
    System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(@"filename");
    MessageBox.Show(String.Format("Original Filename: {0}\rInternal Filename: {1}", fvi.OriginalFilename, fvi.InternalName));
    Busy

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured