如何运行,如何关闭其他应用程序.

解决方案 »

  1.   

    如果是用API函数调用,要如何声明,格式怎样.
      

  2.   

    uses shellapi;
    ShellExecute(handle, NULL, path_to_folder, NULL, NULL, SW_SHOWNORMAL);
    or
    ShellExecute(handle, "open", path_to_folder, NULL, NULL, SW_SHOWNORMAL);
      

  3.   

    findwindow 找出hwnd
    关闭时 sendmessage wm_close
      

  4.   

    var ExeHandle:Thandle; 
    begin 
    //获得句柄-->标题不确定 
    ExeHandle:=FindWindow('notepad',nil);//'');//返回句柄 
    //关闭程序 
    if ExeHandle<>0 then 
    SendMessage(ExeHandle,WM_Close,0,0) 
    else 
    Application.MessageBox('没有打开“记事本”程序!','提示', 
    MB_IconInformation+MB_OK); 
    end; 
      

  5.   

    notepad是关闭记事本程序,那关闭别的应用程序用什麽,没有一个通用的吗,难道每种都不同?
      

  6.   

    关闭其它的程序,只需用theone_jxm的方法把'notepad'改成你想关闭程序的caption就可以了,如Project1运行就用winexec
      

  7.   

    cnssk(小柯) 
    关闭的方法好象不行
      

  8.   

    var ExeHandle:Thandle;
    begin
    //获得句柄-->标题不确定
    ExeHandle:=FindWindow(nil,'想关闭的程序的标题');//关闭程序
    if ExeHandle<>0 then
      SendMessage(ExeHandle,WM_Close,0,0)
    end;