M
M
Mik922015-06-03 15:49:42
Delphi
Mik92, 2015-06-03 15:49:42

[Delphi] How to constantly generate a new form window class?

Is it possible to automatically generate a new window class each time a program is started?
Form1 according to the standard, how to make any random? (not the name of the form, but its class) Is it possible? How?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mercury13, 2015-06-04
@Mik92

If you meant window class (WinApi concept) - override TWinControl.CreateParams.

type
  TfmMain = class (TForm)
  .....
  protected
    procedure CreateParams(var Params : TCreateParams); override;
  end;

procedure TfmMain.CreateParams(var Params : TCreateParams);
begin
  inherited;
  // а затем подкорректируй Params по собственному желанию.
end;

By the way, what are you writing? Virus? :)
If you meant class as an OOP concept, no way.
PS And still write your task. Protect yourself from FindWindow? I just wrote how. Protect the "guts" of the program from patches? Come up with a hack-resistant API?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question