核心提示:1、首先将delphi中Controls单元提取2、修改Controls单元中如下部分:procedure TWinControl.CreateParams(var Params: TCreatePa...
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;