TIME:
8:59 AM 10/18/2011
WORDS AND SENTENCES:
instantiate vt. 实例
How can I properly use CreateProcess to instantiate a new process?
delve vi.深入
Before I give you the code to execute a program in Windows with CreateProcess,
I feel we should delve a bit into the concept of what a process is.
nomenclature n.命名法 distinction n.区别
With Win32, Microsoft changed nomenclature to help make the distinction of new concepts more clear for developers.
equivalent n.(加泰罗尼亚语) 相当于,相当 preemptive adj. 先发制人
In Win16 a process was the equivalent to an application.
That was just fine because Windows 3.1 was (and still is) a non-preemptive multitasking system - there's no such thing as threads.
equate vt.等同 entity n.实体 inert adj.惰性的 essentially adv.本质上 esoteric adj.深奥 Suffice it to say that 我只想说^^ suffice vt.满足,合格
But with the move to Win32 (Win95 and NT),
many people have made the mistake of equating a thread to a process.
It's not an unusual thing considering the familiarity with an older concept.
However, threads and processes are both distinct concepts and entities.
Threads are children of processes;
while processes, on the other hand,
are inert system entities that essentially do absolutely nothing but define a space in memory for threads to run - threads are the execution portion of a process
and a process can have many threads attached to it. That's it. I won't go into the esoteric particulars of memory locations and addressable space and the like.
Suffice it to say that processes are merely memory spaces for threads.
obsolete adj.过时的。
Mind you, for backward compatibility, the Win16 calls for executing programs,
WinExec and ShellExecute are still supported in the Windows API,
and still work. But for 32-bit programs, they're considered obsolete.
utilize vt.(罗马尼亚语言)利用
The following code utilizes the CreateProcess API call, and will execute any program, DOS or Windows.
qualified adj.合格的,有资格的
{Supply a fully qualified path name in ProgramName}
on the fly's explanation:(from wiki:http://en.wikipedia.org/wiki/On_the_fly)
In colloquial use, on the fly means something created when needed. The phrase is used to mean:
a)something that was not planned ahead
b)changes that are made during the execution of some activity: ex tempore, impromptu.
usage exapmple:
I think the biggest problem people have working with the WinAPI through Delphi is that
the help topics are directed towards C/C++ programmers, not Delphi programmers.
So on the fly, Delphi programmers have to translate the C/C++ conventions to Delphi.
8:59 AM 10/18/2011
WORDS AND SENTENCES:
instantiate vt. 实例
How can I properly use CreateProcess to instantiate a new process?
delve vi.深入
Before I give you the code to execute a program in Windows with CreateProcess,
I feel we should delve a bit into the concept of what a process is.
nomenclature n.命名法 distinction n.区别
With Win32, Microsoft changed nomenclature to help make the distinction of new concepts more clear for developers.
equivalent n.(加泰罗尼亚语) 相当于,相当 preemptive adj. 先发制人
In Win16 a process was the equivalent to an application.
That was just fine because Windows 3.1 was (and still is) a non-preemptive multitasking system - there's no such thing as threads.
equate vt.等同 entity n.实体 inert adj.惰性的 essentially adv.本质上 esoteric adj.深奥 Suffice it to say that 我只想说^^ suffice vt.满足,合格
But with the move to Win32 (Win95 and NT),
many people have made the mistake of equating a thread to a process.
It's not an unusual thing considering the familiarity with an older concept.
However, threads and processes are both distinct concepts and entities.
Threads are children of processes;
while processes, on the other hand,
are inert system entities that essentially do absolutely nothing but define a space in memory for threads to run - threads are the execution portion of a process
and a process can have many threads attached to it. That's it. I won't go into the esoteric particulars of memory locations and addressable space and the like.
Suffice it to say that processes are merely memory spaces for threads.
obsolete adj.过时的。
Mind you, for backward compatibility, the Win16 calls for executing programs,
WinExec and ShellExecute are still supported in the Windows API,
and still work. But for 32-bit programs, they're considered obsolete.
utilize vt.(罗马尼亚语言)利用
The following code utilizes the CreateProcess API call, and will execute any program, DOS or Windows.
qualified adj.合格的,有资格的
{Supply a fully qualified path name in ProgramName}
on the fly's explanation:(from wiki:http://en.wikipedia.org/wiki/On_the_fly)
In colloquial use, on the fly means something created when needed. The phrase is used to mean:
a)something that was not planned ahead
b)changes that are made during the execution of some activity: ex tempore, impromptu.
usage exapmple:
I think the biggest problem people have working with the WinAPI through Delphi is that
the help topics are directed towards C/C++ programmers, not Delphi programmers.
So on the fly, Delphi programmers have to translate the C/C++ conventions to Delphi.