Application always on bottom

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.
 
J

Jonas Ericsson

[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);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top