|
-
Nov 27th, 2001, 01:20 AM
#1
Thread Starter
Fanatic Member
Try:
..........................
AppActivate apptitle
SendKeys "%{F4}"
.........................
-
Nov 27th, 2001, 01:22 AM
#2
Frenzied Member
Killing Dos window
Does anybody know how to FORCE a Dos window to close?
I have the code to find the window handle and kill it but it only works properly in Windows2000. In Windows 98 I get the box that says 'Windows cannot shut down this program automatically......". I dont know why it works in Win2k but gives me different results in 98 but i wondered if anyone knew a way to FORCE it to die. Its founf the window OK and has attempted to kill it but because the program i running in the DOS window, Windows is warning me about losing information which i dont care about anyway.
The following code is what I use:
VB Code:
Private Sub KillDosWindow()
Dim WHwnd As Long
Const NILL = 0&
Const WM_SYSCOMMAND = &H112
Const SC_CLOSE = &HF060&
WHwnd = FindWindow(vbNullString, App.Path & "\CDDA32\CDDA32.EXE")
If WHwnd = 0 Then
WHwnd = FindWindow(vbNullString, "CDDA32.EXE")
If WHwnd = 0 Then
WHwnd = FindWindow(vbNullString, "CDDA32")
End If
End If
If WHwnd <> 0 Then
Handle = SendMessage(WHwnd, WM_SYSCOMMAND, SC_CLOSE, NILL)
End If
End Sub
Any help would be top
Thanks in advance
There are 3 types of people in this world.........those that can count, and those that can't.
Blobby
-
Nov 27th, 2001, 04:03 AM
#3
Frenzied Member
Dongaman
Im using Appactivate "CDDA32"
As CDDA32 is the name of my DOSBOX window title. It closes my whole app and leaves the Dosbox open!! It says something about 'You cant use SendKeys to close an app not designed to run in Microsoft Windows' in the MSDN on the microsoft website.
I assume they mean CDDA as its a Dos application. I would have assumed that it would have killed the DOS window though!
Any other suggestions?
Last edited by Blobby; Nov 27th, 2001 at 04:09 AM.
There are 3 types of people in this world.........those that can count, and those that can't.
Blobby
-
Nov 27th, 2001, 04:28 AM
#4
Thread Starter
Fanatic Member
I do not know more about of CDDA32.But it is a 16bit app because it run in DOSBOX.The short key "ALT+F4" can end almost
all 32bit app.
-
Nov 27th, 2001, 04:44 AM
#5
Conquistador
but will not work for DOS programs...
-
Nov 27th, 2001, 04:57 AM
#6
Thread Starter
Fanatic Member
but will not work for DOS programs...
I have not use win98 for a long time.
-
Nov 27th, 2001, 05:06 AM
#7
Frenzied Member
Peeps
OK peeps, thanks for your help. At least I know now its not me doing something stupid or not doing something I should.
Thanks
There are 3 types of people in this world.........those that can count, and those that can't.
Blobby
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
|