|
-
Apr 16th, 2001, 05:08 PM
#1
Thread Starter
Junior Member
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
-
Apr 17th, 2001, 12:07 AM
#2
Thread Starter
Junior Member
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?
-
Apr 17th, 2001, 01:14 AM
#3
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!
-
Apr 17th, 2001, 03:41 AM
#4
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|