Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Windows Kill Application (WKA)
◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
Command: Windows Kill Application (WKA)
Syntax: WKA
Summary: Simulates a fatal error in the current task.
Description:
There may be times when you want to halt your program immediately.
You can force an immediate interrupt of a CVW session by pressing
CTRL+ALT+SYSREQ. You then have the opportunity to change debugging
options, such as setting breakpoints and modifying variables. To
resume continuous execution, press F5; to single-step, press F10.
You should take care when you interrupt the CVW session. For
example, if you interrupted the session while Windows code or
other system code was executing, attempting to use the Step or
Trace functions will produce unpredictable results. When you
interrupt the CVW session, it is usually safest to set breakpoints
in your code and then resume continuous execution, rather than
using Step or Trace.
An infinite loop in your code presents a special problem. Again,
since you should avoid using Step or Trace after interrupting your
program, you should try to locate the loop by setting breakpoints
in places you suspect are in the loop.
Terminating Your Application with WKA
At times, you may have to terminate the application. The WKA
command terminates the currently executing task. Since this task
is not necessarily your application, you should use the WKA
command only when your application is the currently executing
task.
If your application is the currently executing task and is
executing a module containing CodeView information, the Source
window highlights the current line or instruction. However, if
your application contains modules that are compiled without
CodeView information, it is more difficult to determine whether
the assembly-language code displayed in the Source window belongs
to your application or to another task.
In this case, use the Windows Display Global Heap (WDG) command,
with the value in the CS register as the argument. CVW displays a
listing that indicates whether the code segment belongs to your
application.
If the current code is in your application, you can safely use the
WKA command without affecting other tasks. However, the WKA
command does not perform all the cleanup tasks associated with the
normal termination of a Windows application.
For example, GDI objects created during the execution of the
program but not destroyed before you terminated the program remain
allocated in the global heap. This reduces the amount of memory
available during the rest of the Windows session. Because of this,
you should use the WKA command to terminate the application only
if you cannot terminate it normally.
NOTE: The WKA command simulates a fatal error in your application,
causing Windows to display an Unexpected Application Error
message box. After you close this message box, Windows may
not release subsequent mouse input messages from the system
queue until you press a key.
If this happens, the mouse pointer moves on the Windows
screen but Windows does not respond to the mouse. After you
press any key, Windows responds to the queued mouse events.
-♦-