Delphi 实现程序 动态 类名


本文整理自网络,侵删。

  1、首先将delphi中Controls单元提取
2、修改Controls单元中如下部分:
procedure TWinControl.CreateParams(var Params: TCreateParams);
begin
FillChar(Params, SizeOf(Params), 0);
with Params do
begin
    Caption := FText;
    Style := WS_CHILD or WS_CLIPSIBLINGS;
    AddBiDiModeExStyle(ExStyle);
    if csAcceptsControls in ControlStyle then
    begin
      Style := Style or WS_CLIPCHILDREN;
      ExStyle := ExStyle or WS_EX_CONTROLPARENT;
    end;
    if not (csDesigning in ComponentState) and not Enabled then
      Style := Style or WS_DISABLED;
    if FTabStop then Style := Style or WS_TABSTOP;
    X := FLeft;
    Y := FTop;
    Width := FWidth;
    Height := FHeight;
    if Parent <> nil then
      WndParent := Parent.GetHandle else
      WndParent := FParentWindow;
    WindowClass.style := CS_VREDRAW + CS_HREDRAW + CS_DBLCLKS;
    WindowClass.lpfnWndProc := @DefWindowProc;
    WindowClass.hCursor := LoadCursor(0, IDC_ARROW);
    WindowClass.hbrBackground := 0;
    WindowClass.hInstance := HInstance;
    //////////////////
   StrPCopy(WinClassName, IntToStr(GetTickCount));
    //StrPCopy(WinClassName, ClassName);

end;
end;

相关阅读 >>

Delphi中webbrowser问题集锦

Delphi 常用函数单元 umyfunctions

Delphi 的内存操作函数(6): 跨进程的内存分配

Delphi android实例-trectangle加载图片(xe8+小米2)

Delphi createthread的线程传参数(小熊论坛的)

Delphi中实现文件拷贝的三种方法

Delphi cxgrid 通过字段名取得列

Delphi opentextfiledialog用法

Delphi设置窗口透明

Delphi xe10实现移动端支付宝、微信支付接口

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...