Results 1 to 4 of 4

Thread: winoldap left in taskmanager when using shell

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Posts
    26

    Angry

    Hi

    I'm running shell commands from my program and I want to keep them hidden from the user. My code is:

    Shell "c:\windows\cmdproc.bat", vbHide

    However when I do this the program remains running and winoldap appears in the task manager. I tried closing it using the DestroyWindow, but I don't think it's working because DestoryWindow can only kill windows I create.

    Do

    hWnd = FindWindow(vbNullString, "Finished - cmdproc")
    DestroyWindow (hWnd)

    Loop While (hWnd <> 0) = False

    Is there anyway for me to either close the shell box automatically when it finishes?

    Maybe by having the program hit the "x" button, or use the "close" menu command? If these are possibilitys can someone point me to an example program. Also would that work while the window was hidden?

    thanks

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Posts
    26
    well I've been reading similar posts about my problem and they say to set the properties of my cmdproc.bat to close on exit. I tried this and it worked, however is there a way to set this property from VB?

  3. #3
    TheSarlacc
    Guest
    try this instead:

    Dim winHwnd As Long, rval As Long
    winHwnd = FindWindow(vbNullString, "winoldapp")
    If winHwnd <> 0 Then
    rval = PostMessage(winHwnd, WM_CLOSE, 0&, 0&)
    End If

    ================
    it will close winoldapp when executed! be sure to include the declarations for the API call!

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Posts
    26
    wow, that worked great, thank you. one thing however, i've been using vbapi.com for API refference, but vbapi.com seems to be lacking some API functions. anyone have other sources be them online or possible in book form?

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