Results 1 to 4 of 4

Thread: Determin when EXE's load

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    LewZer-LanD
    Posts
    120

    Arrow

    I know there is a way to do this, this i what i want to do:
    1) Determine when an EXE, COM, or BAT file is loaded.
    2) Tell windows to cancel running it.
    3) Allow my program to scan it.
    4) Then make my program run it.

    (i bet it's all API! hehe)

    Any help is worth thanking... :)

    -da404LewZer
    Kid A

    18 Year Old Programmer
    Visual Basic 6 & .NET Enterprise, ASP, WinXP (Advanced Server) Administration, HTML, Graphic Arts, Winsock, Learning VC++ and now maybe C#.. heh
    [vbcode]
    'back in the day vb6 code
    Private Sub My_Life()
    If Hour(Now) > 3 And Hour(Now) < 13 Then
    Status = "Sleeping"
    Else
    Status = "Computing"
    End If
    End Sub
    [/vbcode]

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Do you want to get an event or is timer ok?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    LewZer-LanD
    Posts
    120

    Anyone??

    C'mon i need to know how... and yes i will most likely be using a timer, unless it's not needed. I got the exe scanning thing already werking.. i just wanna know how 2 do 1,2,and 4.

    Please help.
    Kid A

    18 Year Old Programmer
    Visual Basic 6 & .NET Enterprise, ASP, WinXP (Advanced Server) Administration, HTML, Graphic Arts, Winsock, Learning VC++ and now maybe C#.. heh
    [vbcode]
    'back in the day vb6 code
    Private Sub My_Life()
    If Hour(Now) > 3 And Hour(Now) < 13 Then
    Status = "Sleeping"
    Else
    Status = "Computing"
    End If
    End Sub
    [/vbcode]

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    You can do this by editing the registry. If you have a look under the HKEY_CLASSES_ROOT you will find all registred file types including BAT, COM and EXE. Take a look at the key .bat and you will see a value in the right pane (probably batfile). Then scroll down to that key (batfile) and change the value under shell\open\command from "%1" %* to YourProgramPathAndName "%1" %*. Now every time you try to start a .BAT file you program starts and you will get the path and filename of the .BAT file as a command argument.

    Use the Command$() function to read the command line. Run your scan of the file and then use the Shell function to launch the .BAT file.

    Now do the same for .COM and .EXE files in the registry.

    Good luck!

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