如何在DELPHI中调用16位汇编程序,并检测它何时退出
SOS!!!SOS!!!
我需要在DELPHI编写的程序中调用一个16位的汇编程序,试用过WINEXEC、FINGWINDOWS等函数,但无法检测该汇编程序何时结束运行。请高手指教,如何得到该程序退出的消息!
SOS!!!
问题点数:50、回复次数:3Top
1 楼jansenzhu()回复于 2000-03-14 00:10:00 得分 0
delphi is a pascal standard language.
it also means you want to access code
accross the language.
there are some example in the masm 6
they are call asm from C, pascal, lisp
and so on.
you can download it from the URL
http://www.midatech.com/test-csdn-asm/intel/masm6/
hope you master it.
yours jansen.Top
2 楼crazyhorse()回复于 2000-03-14 11:55:00 得分 25
不用那么复杂吧!
1.用CreateProcess来调用汇编程序,获取进程句柄hprocess
2.WaitForSingleObject(...hprocess,infinite)详见Win32的帮助文件
3.closehandle(hprocess)(注意,此时汇编程序已经运行完毕
4.do what u want to doTop
3 楼cyb()回复于 2000-03-16 22:10:00 得分 25
多谢高手指点。我已解决这个问题。还是采用原来的思路。先用WINEXEC调用程序,然后定时调用FINGWINDOWS函数去检测程序运行的句柄,如为0,则该程序退出的消息!这是一个笨办法。
我会再试试你们提供的方法。我想WaitForSingleObject应该比FINGWINDOWS效率要高一些。
再次感谢!!!Top




