SVN r852
SVN-Revision: r852
This commit is contained in:
@@ -327,33 +327,7 @@ namespace Lskj.Main.Model
|
|||||||
MessageBox.Show("无法获取启动程序的主窗口句柄");
|
MessageBox.Show("无法获取启动程序的主窗口句柄");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const int GWL_STYLE = -16;
|
HandleHelper.SetFormNoneStyle(exeMainHandle, tp);
|
||||||
const int WS_BORDER = 0x00800000;
|
|
||||||
const int WS_DLGFRAME = 0x00400000;
|
|
||||||
const int WS_CAPTION = WS_BORDER | WS_DLGFRAME;
|
|
||||||
const int WS_THICKFRAME = 0x00040000;
|
|
||||||
const int WS_MINIMIZE = 0x20000000;
|
|
||||||
const int WS_MAXIMIZEBOX = 0x00010000;
|
|
||||||
const int WS_SYSMENU = 0x00080000;
|
|
||||||
const int SWP_NOZORDER = 0x0004;
|
|
||||||
const int SWP_NOACTIVATE = 0x0010;
|
|
||||||
const uint SWP_FRAMECHANGED = 0x0020;
|
|
||||||
// 移除窗口边框和标题栏
|
|
||||||
int style = HandleHelper.GetWindowLong(exeMainHandle, GWL_STYLE);
|
|
||||||
style &= ~WS_CAPTION;
|
|
||||||
style &= ~WS_THICKFRAME;
|
|
||||||
style &= ~WS_MINIMIZE;
|
|
||||||
style &= ~WS_MAXIMIZEBOX;
|
|
||||||
style &= ~WS_SYSMENU;
|
|
||||||
HandleHelper.SetWindowLong(exeMainHandle, GWL_STYLE, style);
|
|
||||||
// 使样式更新生效
|
|
||||||
HandleHelper.SetWindowPos(exeMainHandle, IntPtr.Zero, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);
|
|
||||||
// 将exe窗口设置为panel的子窗口
|
|
||||||
HandleHelper.SetParent(exeMainHandle, tp.Handle);
|
|
||||||
// 调整大小填充panel
|
|
||||||
HandleHelper.ResizeEmbeddedWindow(exeMainHandle, tp);
|
|
||||||
// 自动响应panel大小变化调整嵌入窗口大小
|
|
||||||
tp.Resize += (s, e) => HandleHelper.ResizeEmbeddedWindow(exeMainHandle, tp);
|
|
||||||
tp.Text = module.Name;
|
tp.Text = module.Name;
|
||||||
tp.Tag = guid;
|
tp.Tag = guid;
|
||||||
tp.AutoScroll = true;
|
tp.AutoScroll = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user