demo.prg

来自「VFP最近技术介绍」· PRG 代码 · 共 35 行

PRG
35
字号
set Talk Off
set Echo Off

set procedure to process_tools additive

lcTitle = "Process Tools - DEMO"


=MESSAGEBOX("Please open a NOTEPAD session, with or without a document, then press OK.",64, lcTitle)

lnProcID = ProcID("Notepad.exe")

if lnProcID = 0
	=MESSAGEBOX("Could not find any NOTEPAD session." +chr(13)+chr(13) +"For the sake of the DEMO please open one... then press OK.", 48, lcTitle)
	lnProcID = ProcID("Notepad.exe")
*else
endif
=MESSAGEBOX("NOTEPAD process ID: " +alltrim(str(lnProcID)) +chr(13)+chr(13) +"Now will kill this process after pressing OK.", 64, lcTitle)

lnResult = KillProcID(lnProcID)

if lnResult = 0
	=MESSAGEBOX("Could not find any NOTEPAD session. (Process ID: " +alltrim(str(lnProcID)) +")" +chr(13)+chr(13) +"The process could be closed before killed by this DEMO.", 48, lcTitle)
else
	=MESSAGEBOX("NOTEPAD process ID: " +alltrim(str(lnProcID)) +" - Process killed successfuly.", 64, lcTitle)
endif

lnResult = ProcList("laProc")
create cursor cProc (ProcID N(10), ThreadCnt N(10), ParentPID N(10), Priority N(3), FileName C(60))
append from array laProc
go top
browse


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?