<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VCL Developer &#187; ProcessInfo</title>
	<atom:link href="http://vcldeveloper.com/tag/processinfo/feed/" rel="self" type="application/rss+xml" />
	<link>http://vcldeveloper.com</link>
	<description>Ali Keshavarz&#039;s Website</description>
	<lastBuildDate>Mon, 26 Jul 2010 00:37:57 +0000</lastBuildDate>
	<language>fa</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>ProcessInfo 1.3 is released</title>
		<link>http://vcldeveloper.com/news/processinfo-1-3-is-released/</link>
		<comments>http://vcldeveloper.com/news/processinfo-1-3-is-released/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 00:20:25 +0000</pubDate>
		<dc:creator>Ali Keshavarz</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Components]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ProcessInfo]]></category>
		<category><![CDATA[TAppInfo]]></category>
		<category><![CDATA[TProcessInfo]]></category>
		<category><![CDATA[دلفی]]></category>
		<category><![CDATA[کامپوننت]]></category>

		<guid isPermaLink="false">http://vcldeveloper.com/?p=370</guid>
		<description><![CDATA[Hi, ProcessInfo 1.3 is released. The changes in this release are: CPU usage is added to TProcessItem. Is64Bit is added to TProcessItem. IsAccessible is added to TProcessItem. Setting thread priority is added to TThreadItem. Setting process base priority class is added to TProcessItem. To download ProcessInfo 1.3, please go to ProcessInfo page.]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>ProcessInfo 1.3 is released. The changes in this release are:</p>
<ul>
<li>CPU usage is added to TProcessItem.</li>
<li> Is64Bit is added to TProcessItem.</li>
<li> IsAccessible is added to TProcessItem.</li>
<li> Setting thread priority is added to TThreadItem.</li>
<li> Setting process base priority class is added to TProcessItem.</li>
</ul>
<p>To download ProcessInfo 1.3, please go to <a href="http://vcldeveloper.com/category/products/products-components/process-info/">ProcessInfo</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://vcldeveloper.com/news/processinfo-1-3-is-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to use TProcessInfo #2</title>
		<link>http://vcldeveloper.com/tips-tricks/how-to-use-tprocessinfo-2/</link>
		<comments>http://vcldeveloper.com/tips-tricks/how-to-use-tprocessinfo-2/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 23:51:07 +0000</pubDate>
		<dc:creator>Ali Keshavarz</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[ProcessInfo]]></category>
		<category><![CDATA[TProcessInfo]]></category>
		<category><![CDATA[دلفی]]></category>

		<guid isPermaLink="false">http://vcldeveloper.com/?p=371</guid>
		<description><![CDATA[I had a few e-mails and comments about using TProcessInfo, so I decided to answer those questions in new blog posts. Q1: How can we find a module which is running a specific thread, giving a thread ID: A: First of all, Threads are not assigned to modules, they are assigned to processes. You can [...]]]></description>
			<content:encoded><![CDATA[<p>I had a few e-mails and comments about using <a href="http://vcldeveloper.com/products/products-components/process-info/" target="_blank">TProcessInfo</a>, so I decided to answer those questions in new blog posts.</p>
<p><strong><span style="color: #ff0000;">Q1</span></strong>: How can we find a module which is running a specific thread, giving a thread ID:</p>
<p><strong>A</strong>: First of all, <span style="text-decoration: underline;">Threads are not assigned to modules</span>, they are assigned to processes. You can find a process which is running the thread, by searching in the list of threads owned by each running process. Here is a sample code:</p>
<pre class="brush: delphi;">
function FindProcessByThreadID(ID: Cardinal): TProcessItem;
var
  ProcessInfo : TProcessInfo;
  AProcess : TProcessItem;
begin
  Result := nil;
  ProcessInfo := TProcessInfo.Create(nil);
  try
    for AProcess in ProcessInfo.RunningProcesses do
    begin
      if Assigned(AProcess.Threads.FindByID(ID)) then
      begin
        Result := AProcess;
        Exit;
      end;
    end;
  finally
    ProcessInfo.Free;
  end;
end;
</pre>
<p>FindProcessByThreadID iterates over all running processes, and checks which of them has a thread with the given ID. If a process owns a thread with that ID, it will return that process as a TProcessItem object.</p>
<p>Once you have the process object, you can get more information about the process or the specific thread, or you can kill the process, or suspend the thread. For example:</p>
<pre class="brush: delphi;">
var
  Process : TProcessItem;
begin
  Process := FindProcessByThreadID(StrToInt(3444));
  if Assigned(Process) then
    ShowMessage(Process.FullPath);
end;
</pre>
<p>The above code looks for a thread with its ID = 3444, and if it is found, it provides full path of the EXE file for that process.</p>
<p><strong><span style="color: #ff0000;">Q2</span></strong>: How can we get memory consumption for a given process?</p>
<p><strong>A</strong>: You can read memory info for a given process using TProcessItem.MemoryInfo. It provides different info about the memory the process is consuming. Here is an example for reading memory info of Google Chrome process while it is running :</p>
<pre class="brush: delphi;">
var
  ProcessInfo : TProcessInfo;
  AProcess : TProcessItem;
begin
  ProcessInfo := TProcessInfo.Create(nil);
  try
    AProcess := ProcessInfo.RunningProcesses.FindByName('Chrome.exe');
    if Assigned(AProcess) then
      ShowMessage(Format('WorkingSet Size = %d, Peak WorkingSet Size = %d',
                         [AProcess.MemoryInfo.WorkingSetSize,
                          AProcess.MemoryInfo.PeakWorkingSetSize]));
  finally
    ProcessInfo.Free;
  end;
end;
</pre>
<p>First we search for Chrome.exe process among running processes. Once the process is found, we read its current working set size, and pick working set size through MemoryInfo property, and show them in a message box. The values returned are in Bytes.</p>
<p><strong><span style="color: #ff0000;">Q3</span></strong>: How can we get process base priority class or change it?</p>
<p><strong>A</strong>: You can access base priority class for a given process or modify it (added in <a href="http://vcldeveloper.com/uncategorized/processinfo-1-3-is-released/" target="_blank">version 1.3</a>), using TProcessItem.</p>
<p>PriorityClassBase. Be careful, adjusting a base priority class of a given process inappropriately might make other processes unresponsive! Here is a example code:</p>
<pre class="brush: delphi;">
var
  ProcessInfo : TProcessInfo;
  AProcess : TProcessItem;
begin
  ProcessInfo := TProcessInfo.Create(nil);
  try
    AProcess := ProcessInfo.RunningProcesses.FindByName('firefox.exe');
    if Assigned(AProcess) then
      AProcess.PriorityClassBase := BELOW_NORMAL_PRIORITY_CLASS;
  finally
    ProcessInfo.Free;
  end;
end;
</pre>
<p>You can also change each priority of  each thread within a process by setting BasePriority property of that TThreadItem instace.</p>
<p><strong><span style="color: #ff0000;">Q4</span></strong>: How can I check if a process is 64-bit?</p>
<p><strong>A</strong>: You can check this by reading TProcessItem.Is64Bits property.</p>
<p><strong><span style="color: #ff0000;">Q5</span></strong>: How can I get CPU usage for a given process?</p>
<p><strong>A</strong>: You can get CPU usage by reading TProcessItem.CPUUsage property.</p>
<p>I hope these few answers and sample source codes can help you use Process Info. For other examples of using Process Info, please refer to this post: <a href="http://vcldeveloper.com/tips-tricks/how-to-use-tprocessinfo/">How to use TProcessInfo</a></p>
<p>If there is any question regarding using Process Info, or anything about Delphi that you think worth being mentioned in Tips &amp; Tricks section of this website, please <a href="http://vcldeveloper.com/contact-me/" target="_blank">contact me</a>, and let me know about it.</p>
<p>Have Fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://vcldeveloper.com/tips-tricks/how-to-use-tprocessinfo-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ProcessInfo 1.2 is released</title>
		<link>http://vcldeveloper.com/news/processinfo-1-2-is-released/</link>
		<comments>http://vcldeveloper.com/news/processinfo-1-2-is-released/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 18:45:31 +0000</pubDate>
		<dc:creator>Ali Keshavarz</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Components]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ProcessInfo]]></category>
		<category><![CDATA[TAppInfo]]></category>
		<category><![CDATA[TProcessInfo]]></category>
		<category><![CDATA[دلفی]]></category>
		<category><![CDATA[کامپوننت]]></category>

		<guid isPermaLink="false">http://vcldeveloper.com/?p=250</guid>
		<description><![CDATA[Hi, ProcessInfo 1.2 is released. The changes in this release are: SuspendThread, ResumeThread, TerminateThread methods are added to TThreadItem class. Now you can pause/resume/terminate any running thread in a given process. TProcessInfo.Active and TAppInfo.Active are published properties, and can be set in design mode. TProcessInfo.RunningProcesses and TAppInfo.RunningApplications automatically populate the corresponding list if UpdateList method [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Hi,</p>
<p style="text-align: justify;">ProcessInfo 1.2 is released. The changes in this release are:</p>
<ul style="text-align: justify;">
<li>SuspendThread, ResumeThread, TerminateThread methods are added to TThreadItem class. Now you can pause/resume/terminate any running thread in a given process.</li>
<li>TProcessInfo.Active and TAppInfo.Active are published properties, and can be set in design mode.</li>
<li>TProcessInfo.RunningProcesses and TAppInfo.RunningApplications automatically populate the corresponding list if UpdateList method is not called yet. This means even if you don&#8217;t activate any of these two components, or call their UpdateList method, accessing RunningProcesses or RunningApplications does not cause Access Violation.</li>
</ul>
<p style="text-align: justify;">To download ProcessInfo 1.2, please go to <a href="../products/products-components/process-info/">ProcessInfo</a> page.</p>
<p style="text-align: justify;">Regards.</p>
]]></content:encoded>
			<wfw:commentRss>http://vcldeveloper.com/news/processinfo-1-2-is-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ProcessInfo 1.1 is released</title>
		<link>http://vcldeveloper.com/news/processinfo-1-1-is-released/</link>
		<comments>http://vcldeveloper.com/news/processinfo-1-1-is-released/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 05:45:15 +0000</pubDate>
		<dc:creator>Ali Keshavarz</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Components]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ProcessInfo]]></category>
		<category><![CDATA[TAppInfo]]></category>
		<category><![CDATA[TProcessInfo]]></category>
		<category><![CDATA[دلفی]]></category>
		<category><![CDATA[کامپوننت]]></category>

		<guid isPermaLink="false">http://vcldeveloper.com/?p=202</guid>
		<description><![CDATA[Hi, I released a new version of ProcessInfo. In this release I added these features: Enumerators are added for Windows, Threads, Modules, and Processes; Now you can use for-in statements in D2007 and above for iterating on running processes list, or modules\threads\windows of a given process. TProcessItem.UserName is added; This property returns domain name\user name [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>I released a new version of ProcessInfo. In this release I added these features:</p>
<ul>
<li> Enumerators are added for Windows, Threads, Modules, and Processes; Now you can use for-in statements in D2007 and above for iterating on running processes list, or modules\threads\windows of a given process.</li>
<li> TProcessItem.UserName is added; This property returns domain name\user name which is running the process.</li>
<li> TProocessInfo.AdjustDebugPrivilage is added; This method is called automatically.<br />
TThreadItem.ToString &amp; TProcessItem.ToString are added; TThreadItem.ToString returns ThreadID. TProcess.ToString returns process EXE name.</li>
<li> Now supports Delphi 7,2007,2009, 2010; Some conditional compiler directives are added so that it can be used in D7, 2007, 2009, and 2010. I tested it in D7, 2009, and 2010. It should work in D2007 too.</li>
</ul>
<p>To download ProcessInfo 1.1, please go to <a href="../products/products-components/process-info/">ProcessInfo</a> page.</p>
<p>Regards.</p>
]]></content:encoded>
			<wfw:commentRss>http://vcldeveloper.com/news/processinfo-1-1-is-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Process Info</title>
		<link>http://vcldeveloper.com/products/products-components/process-info/</link>
		<comments>http://vcldeveloper.com/products/products-components/process-info/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 00:57:50 +0000</pubDate>
		<dc:creator>Ali Keshavarz</dc:creator>
				<category><![CDATA[Components]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ProcessInfo]]></category>
		<category><![CDATA[TAppInfo]]></category>
		<category><![CDATA[TProcessInfo]]></category>
		<category><![CDATA[دلفی]]></category>
		<category><![CDATA[کامپوننت]]></category>

		<guid isPermaLink="false">http://vcldeveloper.com/?p=163</guid>
		<description><![CDATA[Process Info is a free Delphi component package containing two components: TProcessInfo TAppInfo TProcessInfo provides a list of running processes. TAppInfo provides a list running applications (similar to Application tab in Windows Task Manager). Both components can update their list frequently based on the value of Interval property. TProcessInfo returns a collection of TProcessItem objects. [...]]]></description>
			<content:encoded><![CDATA[<div dir="ltr">
<p style="text-align: left;">Process Info is a free <a href="http://www.embarcadero.com/products/delphi">Delphi</a> component package containing two components:</p>
<ul>
<li>TProcessInfo</li>
<li>TAppInfo</li>
</ul>
<p style="text-align: left;">TProcessInfo provides a list of running processes. TAppInfo provides a list running applications (similar to Application tab in Windows Task Manager). Both components can update their list frequently based on the value of Interval property.</p>
<p style="text-align: left;"><span id="more-163"></span></p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>TProcessInfo </strong></span>returns a collection of TProcessItem objects. Each instance of TProcessItem provides these information and actions for the process:</p>
<ul style="text-align: left;">
<li>Creation time</li>
<li>Kernel time</li>
<li>User time</li>
<li>EXE file name</li>
<li>Full image path</li>
<li>Process ID</li>
<li>Parent process ID</li>
<li>Terminate process</li>
<li>Threads count</li>
<li>UserName</li>
<li><strong>Modules list (TModuleItem)</strong>
<ul>
<li>Base address</li>
<li>Base size</li>
<li>Handle</li>
<li>Load count</li>
<li>Module ID</li>
<li>Module path</li>
<li>ProcessID</li>
</ul>
</li>
<li><strong>Threads list (TThreadItem)</strong>
<ul>
<li>Base priority</li>
<li>Parent process ID</li>
<li>Resume thread</li>
<li>Suspend thread</li>
<li>Terminate thread</li>
<li>Thread ID</li>
</ul>
</li>
<li><strong>Memory info (TMemoryInfo)</strong>
<ul>
<li>Page Fault Count</li>
<li>Peak Working Set Size</li>
<li>Working Set Size</li>
<li>Quota Peak Paged Pool Usage</li>
<li>Quota Paged Pool Usage</li>
<li>Quota Peak Non-paged Pool Usage</li>
<li>Quota Non-paged Pool Usage</li>
<li>Page file Usage</li>
<li>Peak Page file Usage</li>
</ul>
</li>
<li>Base priority</li>
</ul>
<p style="text-align: left;">
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>TAppInfo </strong></span>returns a collection of TWindowItem. Each instance of TWindowItem provides these information for the window:</p>
<ul style="text-align: left;">
<li>Window caption</li>
<li>Application path</li>
<li>Process ID</li>
<li>Window handle</li>
<li>Window class</li>
</ul>
<p style="text-align: left;">A simple demo is also included which shows basic functionalities of TProcessInfo, and TAppInfo by creating a simple task manager. Demo is tested on Delphi 7, Delphi 2009, and Delphi 2010.</p>
<p style="text-align: left;">Process Info is published under the <a href="http://creativecommons.org/licenses/by/3.0/" target="_blank">Creative Commons Attribution 3.0 Unported License</a>.</p>
<h3 style="text-align: left;">Update:</h3>
<ul>
<li>2010/07/26: <a href="http://vcldeveloper.com/uncategorized/processinfo-1-3-is-released/"><strong>Version 1.3</strong></a></li>
<li>2010/01/13: <a href="http://vcldeveloper.com/news/processinfo-1-2-is-released/"><strong>Version 1.2</strong></a></li>
<li><span style="text-decoration: underline;">2009/10/17</span>: <a href="http://vcldeveloper.com/news/processinfo-1-1-is-released/"><strong>Version 1.1</strong></a></li>
</ul>
<p style="text-align: left;">
<p style="text-align: left;">
<h2>Download:</h2>
<p class="download"><a href="/downloads/ProcessInfo.zip">Download Process Info (Source + Demo)</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://vcldeveloper.com/products/products-components/process-info/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
