|
发表于 2020-3-13 20:30:02
|
显示全部楼层
重载Form的虚拟函数CreateParams,改变TCreateParams的成员WndParent
class TForm2 : public TForm
{
__published: // IDE-managed Components
private: // User declarations
protected:
virtual void __fastcall CreateParams(TCreateParams & Param);
public: // User declarations
__fastcall TForm2(TComponent* Owner);
};
void __fastcall TForm2::CreateParams(TCreateParams & Param)
{
//调用基类的函数
TForm::CreateParams(Param);
Param.ExStyle |= WS_EX_TOPMOST;
Param.WndParent = GetDesktopWindow();
}
|
|