CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2007
    Posts
    30

    Detect application execution

    Hi, I don't think this is possible, but is there a way to prevent executables from running until the user allows them to run? When an executable is launched, it's intercepted and a msgbox/form pops up and asks the user if it really should run.

    Like a firewall does with the internet. As soon as an application tries to connect to the internet, the firewall blocks the connection and asks the user if it's ok to let the application access the internet.

    I know you can set group policies in Windows to stop certain executables from running, but I'm wondering if can be done with VB6.

  2. #2
    Join Date
    Dec 2006
    Location
    Pune, India.
    Posts
    579

    Re: Detect application execution


  3. #3
    Join Date
    Oct 2007
    Posts
    30

    Re: Detect application execution

    Thank you Shaikh.Riyaz.a, but that code is missing declarations and some other necessary code.

    It seems I need to look for HSHELL_WINDOWCREATED.

    With a google search I found this and it works fine.
    http://www.diybl.com/course/3_progra...31/107858.html

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Detect application execution

    i don't recommend this, as it's easy to lock yourself out as well
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Oct 2007
    Posts
    30

    Re: Detect application execution

    I know I have to be careful with it. As a test I'm only checking a single excutable, but it doesn't seem to be fast enough. When I use the SuspendThread API, it's fast enough to make sure the Form_Load event of the test application doesn't fire, but the Form_Initialize event still does.

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