用shellexecute(Handle, 'print', PChar('c:\aa.doc'), nil, nil, SW_Hide)调用了一word打印,如何在程序中判断已经打印完毕再继续执行下面程序,如果是用CreateProcess  如何用其调用word打印呢?

解决方案 »

  1.   

    不要用shellexecute函数,用CreateProcess函数就可以了。
    用CreateProcess函数来运行一个外部程序,可以得到它的进程句柄。
    然后再用WaitForSingleObject函数,等待此进程句柄。你就可以知道它何时结束了。
    函数具体用法你到MSDN上一查便知。
    祝你好运!
      

  2.   

    我知道可以用CreateProcess  问题是如何用CreateProcess调用如shellexecute(Handle, 'print', PChar('c:\aa.doc'), nil, nil, SW_Hide)的打印功能???