-1

I want to make the desktop dull/blur in my application using c# unmanaged code like User32.dll and GDI32.dll. Which function do I need to call in the User32.dll and Gdi32.dll?

burning_LEGION
  • 13,246
  • 8
  • 40
  • 52
  • 1
    Waht have you tried? what didn't work? and why does it have to be unmanaged if there's a managed version would that be a valid solution to your problem? – Rune FS Sep 06 '12 at 12:01
  • Permanently of only while the program is running? You could get the desktop image from the registry and then blur it and overwrite the old image with the blurred one. – vulkanino Sep 06 '12 at 12:01

1 Answers1

0

The question being a little unspecific I am assuming that you want to manipulate the desktop using GDI+ or similar. Since you specify doing it using unmanaged API calls the first part of my answer focuses on this. However, if the question also applies to doing it in using the .Net framework, please scroll down.

Unmanaged drawing

Googling a little bit, I found this discussion describing how to draw directly to the desktop's DC (drawing context) here using unmanaged API calls.

You should be able to similarly manipulate the color, transparency or similar using other GDI+ functions (the Blur class might be the kind of effect you are looking for).

Managed drawing using System.Drawing

However, before diving into unmanaged drawing using pinvoke or similar I would seriously consider trying the same using classes from the System.Drawing namespace. These classes are .Net implementations of the unmanaged GDI+ API and would be much nicer to work with from managed code.

I apologize for not giving any good code examples or pointing to the exact classes/methods to use, will try to update my answer later if I get the time to experiment a bit. :-)

Hans Løken
  • 407
  • 1
  • 6
  • 15