Class Win32
{
[DllImport ("user32.dll", EntryPoint = "SetWindowPos")]
Public static extern bool SetWindowPos (
Int hWnd, // window handle
Int hWndInsertAfter, // placement-order handle
Int X, // horizontal position
Int Y, // vertical position
Int cx, // width
Int cy, // height
Uint uFlags); // window positioning flags
Public const int HWND_BOTTOM = 0x1;
Public const uint SWP_NOSIZE = 0x1;
Public const uint SWP_NOMOVE = 0x2;
Public const uint SWP_SHOWWINDOW = 0x40;
}
Private void ShoveToBackground ()
{
Win32.SetWindowPos (int) this. Handle,-1, this. Location. X, this. Location. Y, this. Size. Width, this. Size. Height, 1 );
// Win32.SetWindowPos (
// (Int) this. Handle,
// (Int ),
// 0, 0, 0, 0,
// Win32.SWP _ NOMOVE | Win32.SWP _ NOSIZE | Win32.HWND _ BOTTOM );
}
Private void Bar_Activated (object sender, EventArgs e)
{
// Always at the top
ShoveToBackground ();
}
Private void Bar_Leave (object sender, EventArgs e)
{
// Always at the top
ShoveToBackground ();
}