Application always on bottom

  • Thread starter Thread starter Sean Dudley
  • Start date Start date
S

Sean Dudley

Hi, I would like my application to be always on the bottom (like the
desktop). I tried always setting it to the lowest ZOrder whenever there is
a ZOrder change but this doesn't seem like the best approach to me.
 
[DllImport("User32.dll")]
public static extern Int32 FindWindow(String lpClassName,String
lpWindowName);
[DllImport("user32.dll")]
static extern int SetParent(int hWndChild, int hWndNewParent);

In constructor:

this.SendToBack();
int pWnd = FindWindow("Progman",null);
int tWnd = this.Handle.ToInt32();
SetParent(tWnd, pWnd);
 
Back
Top