type<br> TCustomEDoForm = class (TForm)<br> protected<br> procedure SpecifyWinClassName(var WinClassName: string); virtual;<br> procedure CreateParams(var Params: TCreateParams); override;<br> end;<br><br>procedure TCustomEDoForm.CreateParams(var Params: TCreateParams);<br>var<br> clsName: string;<br>begin<br> inherited;<br> clsName := Self.ClassName;<br> SpecifyWinClassName(clsName);<br> if Length(clsName) > 0 then<br> StrLCopy(Params.WinClassName, PChar(clsName), SizeOf(Params.WinClassName) - 1);<br>end;<br><br>procedure TCustomEDoForm.SpecifyWinClassName(var WinClassName: string);<br>var<br> fmText: string;<br>begin<br> {删除创建的窗体类名开头的字母T}<br> if (WinClassName <> '') and (UpperCase(WinClassName[1]) = 'T') then<br> Delete(WinClassName, 1, 1);<br> {删除创建的窗体类名开头的fm或者frm}<br> fmText := LowerCase(Copy(WinClassName, 1, 3));<br> if fmText = 'frm' then Delete(WinClassName, 1,3)<br> else if Copy(fmText, 1, 2) = 'fm' then Delete(WinClassName, 1, 2);<br>end;<br><br>仅供参考!