Some time ago, Andy Piper wrote...
|+
| This at least makes the mswindows menubar Cut, Copy and Paste do the right
| thing. Activation is not correct as yet since there are no C hooks for
| determining this.
|-
There's no system-wide concept of "selection" in MS Windows at all, so
this is ok. Normally, selection is retained by a program when some other
program has selected something. Some programs un-highlight selection
when lose focus and highlight the region again when focus is regained,
others do not even unhighlight it, but selected region is never cleared,
except for user action in the same window.
Here's an exceprt from Interface Guidelines, "Scope of Selection":
The scope of a selection is the area, extent, or region in which, if other selections are
made, they will be considered part of the same selection set. For example, you can select
two
document icons in the same folder window. However, the selection of these icons is
independent
of the selection of the window�s scroll bar, a menu, the window itself, or selections made
in
other windows. So, the selection scope of the icons is the area viewed through that
window.
Selections in different scopes are independent of each other. For example, selections in
one
window are typically independent of selections in other windows. Their windows define the
scope of each selection independently. The scope of a selection is important because you
use
it to define the available operations for the selected items and how the operations are
applied.
-- end of quote --
I think that selection-owner-p must return the same as (region-active-p) under
Windows, and that selection-exists-p should check if CF_TEXT is available from
clipboard. Using (null (mswindows-get-clipboard)) looks too expensive for the
latter, so we must have a separate lisp primitive for it.
Btw, how about using lstreams to exchange clipboard data? There is some fiddling
with CR/LF stuff in select-msw.c.
Kirill