重载TForm的CreateParams函数即可
void __fastcall TForm2::FormCreate(TObject *Sender)
{
void *Handle = MainForm-> Handle;
long dwstyle = GetWindowLong(Handle,GWL_STYLE);
this-> ParentWindow = GetDesktopWindow();
SetWindowLong(this-> Handle,GWL_STYLE,dwstyle);
SetActiveWindow(this-> Handle);
}
本文介绍了一种在 Delphi 中通过重载 TForm 的 CreateParams 函数来自定义窗体创建过程的方法。具体实现包括获取主窗体句柄、设置窗体样式及激活窗口等步骤。
2085

被折叠的 条评论
为什么被折叠?



