Bonjour, j'ai un petit problème de création de thread.
Je souhaiterai lancer le thread lorsqu'on appuie sur enter, mais ca bloque dès la crétion sur "inherited Create(CreateSuspended);"
Je ne comprend pas :(
Voici mon code simplifé :
//---- Fonction récupérant la touche Enter-----
procedure Tmario.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
sauter:Tsaut;
begin
if Key=VK_RETURN then
begin
sauter.Create(False); //False pour éxécution directe
end;
end;
//---- Classe THREAD ----
type
TSaut = class(TThread)
public
constructor Create(CreateSuspended:boolean);
end;
implementation
constructor TSaut.Create(CreateSuspended:boolean);
begin
inherited Create(CreateSuspended);
FreeOnTerminate := True;
Priority := tpLower;
end;