Re: closing any program and getting the handle to close it or the window name...


[ Related Articles and Replies ] [ DelphiLand FAQ ] [ Delphi Tutorials ]

Posted by WAllison on December 17, 2002 at 20:09:49:

In Reply to: closing any program and getting the handle to close it or the window name... posted by al_Lan on December 12, 2002 at 11:03:49:

: this is what i have managed to do...
: I'm trying to get this program to open and close half-life...

: var
: Form1: TForm1;
: y : TDateTime;
: x : real;
: z , showtime : integer;
: CSHndl : Thandle;

: implementation

: {$R *.dfm}

: procedure TForm1.Button1Click(Sender: TObject);
: var
: code : integer;
: begin
: y := time;
: y := y + strtotime(edit1.text);
: edit1.Text := timetostr(y);
: label3.caption := timetostr(y);
: x := ShellExecute(CSHndl,NIL,PChar(label1.caption), nil,nil,SW_SHOWNORMAL);
: z := 0;
: end;

: procedure TForm1.Timer1Timer(Sender: TObject);
: begin
: label2.caption := timetostr(time);
: if y < time then
: [and so on...]

It all seems a bit long winded to me m8 - you could have a look at ENumWindows and ENumWindowsProc (build a list of all windows and HANDLES)


Related Articles and Replies:


 


[ Related Articles and Replies ] [ DelphiLand FAQ ] [ Delphi Tutorials ]