Click here to Skip to main content
15,889,858 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Does anyone have an idea on how to make a program, where when you click and drag on a win. XP desktop, it'll have a blue transluant selection box? instead of the gray outlined box?
Like this:http://freewebcite.webs.com/Untitled.jpg[^]
but on Win XP?

I have no idea where to start. All i can think is that it has to do something with pictures boxes.
Posted

1 solution

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
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900