Results 1 to 2 of 2

Thread: Kill program which was started with CreateProcess

  1. #1
    Member
    Join Date
    Jan 10
    Posts
    52

    Kill program which was started with CreateProcess

    Hello,
    I need a way to kill a program which was started with CreateProcess.
    My CreateProcess line:
    Code:
    CreateProcess sA, sB, ByVal 0&, ByVal 0&, 1, 0&, ByVal 0&, vbNullString, si, pi
    I want to send WM_CLOSE with PostMessage, wait for 2 seconds and if program is still running use TerminateProcess.

    I had no luck in doing any of that. TerminateProcess is working only if I call it straight after CreateProcess, if I want 1 second for example it is no longer working. EnumWindows API is somehow also not working, so I cannot use PostMessage.

  2. #2
    Member
    Join Date
    Jan 10
    Posts
    52

    Re: Kill program which was started with CreateProcess

    Anyone?
    I know why TerminateProcess was not working for me as expected. It was not killing child processes. Question is how to find them.

Posting Permissions

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