At first glance, this is out of your control.
On second though, you can try to do it, even though this might be pretty difficult.
You will need to do all the work using raw Window API and P/Invoke. First, you need to get a handle of desktop window (it is a window), using
GetDesktopWindow
. After that, you will need to get an existing
Window Function of this window. Use
GetWindowLong
, with the obtained handle (first parameter) and the index of
GWL_WNDPROC
(second parameter). Write your own Window Function and perform all the special processing (mouse handling, etc.) using some semi-transparent Window form you can use to simulate selection. When you need default processing in the Window Function, call the one you obtained via
GetWindowLong
. Install your new Window Function onto the desktop window using
SetWindowLong
with the same parameters you used with
GetWindowLong
.
See:
GetDesktopWindow[
^],
GetWindowLong[
^],
SetWindowLong[
^],
Messages and Message Queues[
^].
Major trick will be to write your modified Window Function for a desktop. You will need to learn a lot about raw Windows message processing and all the messages which are involved in selection. Not easy at all. Do you really want to bother?
—SA