Posted by Met@ on August 31, 2002 In Reply to: Re: Closing a program posted by Met@ on August 31, 2002 --------------------------------------------- Hey! IT DOES WORK! It just doesn't work with the windows that just opened.......LOL Look: procedure TForm1.Button1Click(Sender: TObject); Var IExplore : Thandle; begin ShellExecute(Handle, 'open', PChar('D:\Program Files\Microsoft Office\Office\OUTLOOK.EXE'), nil, nil, SW_SHOW); ShellExecute(Handle, 'open', PChar('D:\Program Files\Outlook Express\MSIMN.EXE'), nil, nil, SW_SHOW); ShellExecute(Handle, 'open', PChar('D:\Program Files\Internet Explorer\IEXPLORE.EXE'), PChar('http://thesimssite.endoria.net/indexECHT.htm'), nil, SW_SHOW); ShellExecute(Handle, 'open', PChar('D:\Program Files\Internet Explorer\IEXPLORE.EXE'), PChar('http://thesimssite.endoria.net/CC/phpBB2/index.php'), nil, SW_SHOW); ShellExecute(Handle, 'open', PChar('D:\Program Files\Internet Explorer\IEXPLORE.EXE'), PChar('http://www.the-forums.nl'), nil, SW_SHOW); IExplore := FindWindow('IEFrame',nil); If IExplore <> 0 Then PostMessage(IExplore, WM_SYSCOMMAND,SC_CLOSE,0); end; That DOES work, but it only closes the windows that were already open! But nevermind that ;) I thought of another way......LOL I wanted my IE to close for some weird reasons......... had to do with the order of the programs on my start bar LOL IE opened faster than my mail programs, so IE had to close... LOL But I can build in a timer! *DUH* Met@
Find related articles Search for: shellexecute Delphi Forum :: Tutorials :: Source code :: Tips |
|