Jonathan de Boyne Pollard
2010-03-10 20:28:50 UTC
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<blockquote cite="mid:***@mst.edu"
type="cite">
<p wrap="">There are utilities and scripting languages that can send
keystrokes to a window. <br>
</p>
</blockquote>
<p>Only in a newsgroup like <code>alt.msdos.batch.nt</code> would this
madness be the answer that everyone concentrates upon.</p>
<p>There's a perfectly good window message, <code>WM_SYSCOMMAND</code>
with <code>SC_CLOSE</code> as the parameter, that unambiguously means
"close the window", without all of the mucking around trying to work
out what keystrokes will invoke what on an application's menu to get it
to think that the user has commanded a close. And there's no shortage
of command-line tools for sending such a message (or <code>WM_CLOSE</code>),
from <a href="http://nirsoft.net./utils/nircmd.html">NirCmd</a> to the
<a href="http://beyondlogic.org./consulting/processutil/processutil.htm"><code>process</code>
utility from Beyond Logic</a>. JP Software's TCC even has a built-in
command for doing this: <a href="http://jpsoft.com./help/activate.htm"><code>ACTIVATE</code></a>,
with the <code>CLOSE</code> option.<br>
</p>
</body>
</html>
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<blockquote cite="mid:***@mst.edu"
type="cite">
<p wrap="">There are utilities and scripting languages that can send
keystrokes to a window. <br>
</p>
</blockquote>
<p>Only in a newsgroup like <code>alt.msdos.batch.nt</code> would this
madness be the answer that everyone concentrates upon.</p>
<p>There's a perfectly good window message, <code>WM_SYSCOMMAND</code>
with <code>SC_CLOSE</code> as the parameter, that unambiguously means
"close the window", without all of the mucking around trying to work
out what keystrokes will invoke what on an application's menu to get it
to think that the user has commanded a close. And there's no shortage
of command-line tools for sending such a message (or <code>WM_CLOSE</code>),
from <a href="http://nirsoft.net./utils/nircmd.html">NirCmd</a> to the
<a href="http://beyondlogic.org./consulting/processutil/processutil.htm"><code>process</code>
utility from Beyond Logic</a>. JP Software's TCC even has a built-in
command for doing this: <a href="http://jpsoft.com./help/activate.htm"><code>ACTIVATE</code></a>,
with the <code>CLOSE</code> option.<br>
</p>
</body>
</html>