Ash
Ash

Reputation: 23

Maximizing windows underneath my form

I have a toolbar that is always on the top (topmost = true) but when i maximize other programs the top of their windows is hidden behind it. I want them to maximize BENEATH my toolbar so i can close/minimize them etc... Like an upside down taskbar, literally changing the screen working area...

Is this possible? I have seen it done in "Cairo Shell"

Upvotes: 2

Views: 754

Answers (2)

Stefan
Stefan

Reputation: 11519

If you want to reserve an area on the desktop for your program and make all other programs not use that area when maximized, then you have to register your app to Window's appbar list with the API SHAppBarMessage

I havent found any good code to do this in .Net but if you google it maybe you'll be lucky.

Here are one: http://www.tek-tips.com/viewthread.cfm?qid=1202570&page=1

Upvotes: 1

Anuraj
Anuraj

Reputation: 19618

I don't think you achive by use TopMost property of Form. Instead you may need to use SetWindowPos() WIN32 API call

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, SetWindowPosFlags uFlags);
static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);

Upvotes: 1

Related Questions