Ramzes » 21.12.2007 (Пт) 15:56
public partial class Form1 : Form
{
private const int HWND_BOTTOM = 1;
private const int HWND_TOPMOST = -1;
private const int HWND_NOTOPMOST = -2;
private const int SWP_NOSIZE = 1;
private const int SWP_NOMOVE = 2;
private const int SWP_NOACTIVATE = 16;
private const int SWP_SHOWWINDOW = 64;
[DllImport("User32")]
private static extern void SetWindowPos(int hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, int wFlags);
public Form1()
{
InitializeComponent();
}
private void Form1_Activated(object sender, EventArgs e)
{
SetWindowPos(this.Handle.ToInt32(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
}
private void Form1_Resize(object sender, EventArgs e)
{
SetWindowPos(this.Handle.ToInt32(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
}
}