SetWindowPos can make windows AlwaysOnTop. Most likely it can give the opposite result. Try something along these lines:
[DllImport("user32.dll")]
static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X,
int Y, int cx, int cy, uint uFlags);
public const uint SWP_NOSIZE = 0x0001;
public const uint SWP_NOMOVE = 0x0002;
public const uint SWP_NOACTIVATE = 0x0010;
public const int HWND_BOTTOM = 1;
SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
Note:
- Haven't tested this approach (for making windows always on bottom)
- If it happens to work, then most likely the show desktop operation will hide the window. So maybe you should go even deeper into this 'nice' API.
EDIT: Done some searching along these lines to confirm whether it will do the trick and found something interesting - a duplicate.