Try:
..........................
AppActivate apptitle
SendKeys "%{F4}"
.........................:rolleyes:
Printable View
Try:
..........................
AppActivate apptitle
SendKeys "%{F4}"
.........................:rolleyes:
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
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?
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.
but will not work for DOS programs...
I have not use win98 for a long time.:mad:Quote:
but will not work for DOS programs...
OK peeps, thanks for your help. At least I know now its not me doing something stupid or not doing something I should.
Thanks