0

I am making an application which reacts as a windows startup program.

It shows different icons on it so that user can open only the allowed ones.

Now when user open 2 programs consecutively first opened program goes at the back of my wpf app.

As app is maximized and user cant minimize it so it becomes hidden.

In windows forms we can set a form send to back so that every program float over it but unluckily there is no such property in wpf.

How to do it?

Adel Khayata
  • 2,717
  • 10
  • 28
  • 46
zafar shakeel
  • 61
  • 1
  • 5

1 Answers1

-1

Try this:

using System.Runtime.InteropServices;


const UInt32 SWP_NOSIZE = 0x0001;
const UInt32 SWP_NOMOVE = 0x0002;
const UInt32 SWP_NOACTIVATE = 0x0010;"

static readonly IntPtr HWND_BOTTOM = new IntPtr(1);

static void ShowWindowBack(Window window)
{
    var x= new WindowInteropHelper(window).Handle;
    SetWindowPos(x, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE");
}
Nadeem_MK
  • 7,533
  • 7
  • 50
  • 61