c# - Fullscreen overlay over desktop -


i'm trying create full screen overlay on entire screen, change colors / saturation etc. of entire screen , add text , effects. want "replace" entire screen, while user still has ability interact windows.

solution 1

the problem is, if create topmost window on entire screen, user not able interact whatever beneath window.

solution 2

simply drawing on desktop buffer doesn't solve issue either. give nasty effects when windows moved , result in heavy motion blur effects well. never good.

solution 3

hooking "desktop draw event" not possible in c# have inject dll explorer.exe. not @ pretty solution , not work c#. anti virus programs detect harmfull.


the closest thing saw this, user not able "click through" overlay. in example overlay entirely transparent. using color other transparency key result in problem of solution 1.

question: how can overlay entire screen effects efficiently?

untested

it sounds problem clicking. in order pass through mouse messages, have considered intercepting mouse click on top window, (assuming has been set transparent window), hiding window, fire same mouse message using user32 import sendmessage, , showing window again? if don't want hide window, can call sendmessage directly various other window handles.

the following link shows how cycle through windows on desktop of application:

http://support.microsoft.com/kb/183009

i think can override createparams if have made form transparent. doing may allow mouse events pass through.

// may simpler protected override createparams createparams {         {         createparams createparams = base.createparams;         createparams.exstyle |= 0x00000020; // ws_ex_transparent          return createparams;     } } 

you can make form transparent in newer windows forms like:

public void makeseethru() {    frmtransparentform.opacity = 0.83; } 

the above works on form. on child controls takes more work. first have set style support transparent color.

public transparentcontrol() {     setstyle(controlstyles.supportstransparentbackcolor, true);     this.backcolor = color.transparent. } 

if control transparent, not stop overriding onpaintbackground , onpaint methods , custom drawing if like. draws default see-through background.

i've done before , there bit of blur if moves around. if entire thing huge transparent form covers desktop there should no motion blur.

if has performance problems , want custom draw desktop, can grab screenshot like:

screencapture sc = new screencapture(); // capture entire screen, , save file image img = sc.capturescreen(); 

you need hide form first though, cause flicker.


Comments