Vizible’s Blog

C# – Setting window alway on bottom

Posted in Uncategorized by wearetherock on July 17, 2009

Instruction from http://www.aeroxp.org/board/lofiversion/index.php?t4983.html

// Declaration
[DllImport(“user32.dll”)]
static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
const UInt32 SWP_NOSIZE = 0x0001;
const UInt32 SWP_NOMOVE = 0x0002;
static readonly IntPtr HWND_BOTTOM = new IntPtr(1);
const UInt32 SWP_NOACTIVATE = 0x0010;

// Use
System.Diagnostics.Process[] xbmc = System.Diagnostics.Process.GetProcessesByName(“XBMC”);
IntPtr hWnd = xbmc[0].MainWindowHandle;
SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);

Advertisements
Tagged with:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: