Saladino (Member)
Pro
Messaggi: 90
Iscritto: 30/05/2010
|
Questa è specifica per windows :
Codice sorgente - presumibilmente Delphi |
program Project1; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes ,windows { you can add units after this }; {$R *.res} var Ok : boolean; ercode : longint; Thr ,th : longword; procedure procedura1; begin // //todo // MessageBox(0 ,'Thread in funzione' ,'' ,0); end; function Thread(P : pointer) : longint; stdcall; begin Ok := True; procedura1; Thread := 0; end; procedure procedura2; begin // //todo // end; begin // .... Thr := CreateThread(nil, 0, @Thread, nil, 0, Th); repeat getexitcodethread(Thr ,@ercode); until OK or (ercode <>still_active); //if ok<>still_active then errore procedura2; readln; //..... end.
|
|