开发者

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 开发者_如何学Pythonchanging the screen working area...

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


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜