Results 1 to 3 of 3

Thread: Closing an Application Window

  1. #1

    Thread Starter
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349

    Closing an Application Window

    Hi Guys,
    I am running an external app from my prog and on some systems, its window remains open after it has finished. I don't want this to happen, so my question is: How do i ensure that the app window is closed when it finishes?
    We don't know what's wrong. . . So the best bet might be to remove something surgically.

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Coventry, England
    Posts
    169

    Re: Closing an Application Window

    Originally posted by Blinky Bill
    Hi Guys,
    I am running an external app from my prog and on some systems, its window remains open after it has finished. I don't want this to happen, so my question is: How do i ensure that the app window is closed when it finishes?
    Hehe, I just posted a similar question. What method are you using to run the external application?

  3. #3

    Thread Starter
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349
    This is the code i'm using
    VB Code:
    1. Public Function ExecCmd(cmdline$)
    2.     Dim proc As PROCESS_INFORMATION
    3.     Dim start As STARTUPINFO
    4.     Dim ret&
    5.     start.cb = Len(start)
    6.     ret& = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
    7.     ret& = WaitForSingleObject(proc.hProcess, INFINITE)
    8.     ret& = CloseHandle(proc.hProcess)
    9. End Function

    This is courtesy of MuzzaD who provided me with it earlier today.
    We don't know what's wrong. . . So the best bet might be to remove something surgically.

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