Hmm, I hadn't considered the Vista implications.
suited to the technology. On XP ControlPaint is fine.
All new articles provide code in C# and VB.NET.
"Joergen Bech @ post1.tele.dk>" <jbech<NOSPAMNOSPAM> wrote in message
news:sr61k2le8id3qfl98o67pg5e5em2f3gpj6@4ax.com...
>
> Yes, that function does the same (although one is limited
> to two styles then).
>
> But the thing is: It still obtains/releases a handle to the
> desktop DC under the covers. I understood from the article
> I linked to in my previous post
> (
http://blogs.msdn.com/greg_schechter/archive/2006/05/02/588934.aspx)
> that you should avoid writing to/reading from the screen (at
> least for something as realtime as this, though a screen capture
> program would be ok)?
>
> I have a component where I currently draw some selection
> rectangles directly on the screen (which is similar in nature to
> what the original poster is attempting). Trouble is: When I run
> this on Vista with Aero enabled, dragging those rectangles around
> happen at a few frames a second, whereas it runs smooth
> on XP (or Vista with the standard, non-Aero theme).
>
> Wouldn't the original poster have the same problem if using
> ControlPaint.DrawReversible...?
>
> I have considered solving my own problem this way:
>
> 1. On MouseDown, grab a snapshot containing the portion of the screen
> my interface occupies. Only one desktop GetDC required.
>
> 2. Put this snapshot on an overlay and display this on top of my
> interface.
>
> 3. On MouseMove, draw my rectangles on the overlay.
>
> 4. On MouseUp, remove the overlay.
>
> This would make the rectangles part of my application and would
> not constantly force Vista in and out of DirectX10.
>
> I am not convinced that ControlPaint.DrawReversible...
> is as appropriate today as it has been in the past. Also remember that
> this method *only* draws on the desktop. If you need to draw such
> rectangles on other device contexts, you have to implement it
> yourself.
>
> Any thoughts?
>
> /Joergen Bech
>
>
>
> On Thu, 26 Oct 2006 12:52:19 +0200, "Bob Powell [MVP]"
> <bob@_spamkiller_.bobpowell.net> wrote:
>
>>Just use ControlPaint.DrawReversiblexxx. That draws directly on the
>>desktop
>>and can draw outside of windows etc.
>