• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

Code Gods Only...How to Mask the Windows Desktop w/ Alpha Mask, need to set pixel luminance / transparancy from bitmap source...

I need a method to set the Luminance or Transparency of the display (i.e. the desktop and all the stuff on it) on a pixel by pixel basis, so that a reference grayscale bitmap is used to set the desktop pixels to 100%  visibility (unchanged desktop pixel values) down to 0% visibility (black) according to the luminance value of the grayscale reference pixel (Alphablend ?!?)

Another words, I want to mask the desktop as if I had painted the glass surface of the display with an airbrush, some areas being completely unpainted, some being totally blacked out, and others merely dimming down the display some...

This needs to be an active state of the desktop, allowing the desktop to behave normally behind (or through) the mask without flickering, redrawing or bogging down. (SetRop2 ?!?) Kind of a Luminance / transparency AND or NAND function for the display context...

I know the first question that comes to mind is "Why on earth would anyone want to do this?". Well, for business reasons I can't tell you, but I assure you that this is a serious application issue and not just a frivolous request. I also understand that it may not be possible, I've never seen anything like it done...

Solutions in VisB.net are appreciated, but C++ is also acceptable. (I just don't know C that well)
If you require clarification about any of this please don’t hesitate to ask.

Thanks for your help,
Bill@Whitehorsevideo.com
0
Whitehorsevideo
Asked:
Whitehorsevideo
  • 2
  • 2
1 Solution
 
wguerramCommented:
I don't think this is posible.

The Desktop is basically a ListView

I think the only way to accomplish this is to set a window on top of the desktop but you won't be able to set transparency, just luminance.

and you would have to handle the click events on your mirror window so that if you click the mirror window you have to get the coordinate of the mouse, then check what item is in that coordinate and send the action to that item.

through the handle of the desktop, probable using the SendMessage API.

It will be very complicated to handle it.

Also i don't think you can subclass the desktop window using SetWindowLong, if posible you could handle destop WM_PAINT

On the other hand

If you can do all stuff asking for with a listview then you can apply it to the desktop.

You can do some stuff over the desktop using the Graphics object of the .NET Framework, like brushing, draw rectangles and so on.

you can use this apis:

GetDesktopWindow - Handle of the desktop
GetWindowDC
ReleaseDC

dim hdc as intptr = GetWindowDC(GetDesktopWindow)
dim g as graphics = Graphics.fromhdc(hdc)

g.drawrectangle(...)

releaseDC(GetDesktopWindow,hdc)

g.dispose

0
 
WhitehorsevideoAuthor Commented:
LearnedOne,

Please allow this unique question / challenge to remain active as theere is a chance somebody may someday come up with a method. I would be willing to add more points to the bounty if allowed...

 wguerram seems to understand the issues involved but has not offered anything in the way of an answer, so I did not feel a response was required. Hopefully over time this thread will become a meeting place for ideas on the subject of display control.

Thanks in advance

Bill@Whitehorsevideo.com
0
 
wguerramCommented:
I don't thinks this is possible as i told you, maybe you have to pay microsoft to give the OS this capabilities just for your porpouse!
0
 
WhitehorsevideoAuthor Commented:
I would like the moderators to consider either leaving this thread open or deleting it as unanswered, no points awarded. I stated in my original post that I didn't think this was currently possible, but I have heard rumors that lead me to believe that it may be possible in the next generation API. I'm hoping to attract the attention of someone with inside information to expidite our implementation when the new OS (longhorn?) is released.

The comments posted by wguerram, although appreciated, are merely statements of his opinion that it can't currently be done and therefore aren't "answers" per se.

Thanks
0
 
ee_ai_constructCommented:
Question answered by asker or dialog valuable.
Closed, 500 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now