|
-
Jan 22nd, 2002, 03:05 AM
#1
DOS Window
How do I close a window which is running a DOS-based program?
I used 'SHELL' to run a program (ex. PKZIP) but it doesn't allow me to get the window handle so I couldn't close it. Can you guys give me some ideas on how to do this? Thanks a lot!
-
Jan 22nd, 2002, 05:12 AM
#2
Junior Member
Public Sub close_remote_window()
Dim winTitle As String, hwnd As Long
Const NILL = 0&
Const WM_SYSCOMMAND = &H112
Const SC_CLOSE = &HF060&
'Change winTitle to the title of the window you want to shut.
'example: winTitle = "Untitled - Notepad"
hwnd = FindWindow(vbNullString, winTITLE)
If hwnd <> 0 Then
hwnd = SendMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, NILL)
End If
End Sub
-
Jan 22nd, 2002, 05:18 AM
#3
Junior Member
:-)
if you will ever find out how to OPEN(Resize) a dos window in to its full size mode..
that will be great.
-
Jan 22nd, 2002, 11:55 AM
#4
New Member
i'm not sure
I'm new to api's .. but if u can reference the window for the dos window, can u not send it commands like alt-enter ? that would fullscreen any app. don't flame me, cause i'm just guessing
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
|