<?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/"
	>

<channel>
	<title>ShahramBlog</title>
	<atom:link href="http://blog.shahramonline.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.shahramonline.com</link>
	<description>Mohammad Alikhani programming blog</description>
	<pubDate>Fri, 30 Oct 2009 17:11:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>fa</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>نمایش برنامه بر روی پنجره های دیگر یا همون Always on Top</title>
		<link>http://blog.shahramonline.com/?p=189</link>
		<comments>http://blog.shahramonline.com/?p=189#comments</comments>
		<pubDate>Fri, 30 Oct 2009 17:11:16 +0000</pubDate>
		<dc:creator>شهرام</dc:creator>
		
		<category><![CDATA[برنامه نویسی با دلفی Delphi]]></category>

		<category><![CDATA[برنامه نویسی ویندوز]]></category>

		<category><![CDATA[Always on Top]]></category>

		<category><![CDATA[دلفی]]></category>

		<guid isPermaLink="false">http://blog.shahramonline.com/?p=189</guid>
		<description><![CDATA[یکی از راه هایی که شما می توانید برنامه خود را always on top کنید این است که خاصیت FormSyte رو برابر با fsStayOnTop قرار دهید. اما این یک مشکل دارد آن هم اینکه زمانی که دکمه ShowDesktop زده بشه برنامه شما هم Minimize می شه. در صورتی که بخواهید در هر شرایطی برنامه شما [...]]]></description>
			<content:encoded><![CDATA[<p>یکی از راه هایی که شما می توانید برنامه خود را always on top کنید این است که خاصیت FormSyte رو برابر با fsStayOnTop قرار دهید. اما این یک مشکل دارد آن هم اینکه زمانی که دکمه ShowDesktop زده بشه برنامه شما هم Minimize می شه. در صورتی که بخواهید در هر شرایطی برنامه شما بر روی صفحه بماند، می توانید از دستور زیر در رویداد OnCreate فرم خود استفاده کنید:</p>
<p dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax1"></a><a style="wp-synhighlighter-title" href="#codesyntax1"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">SetWindowPos<span style="color: #000066;">&#40;</span><span style="color: #000000; font-weight: bold;">Self</span><span style="color: #000066;">.</span><span style="color: #006600;">Handle</span><span style="color: #000066;">,</span> HWND_TOPMOST<span style="color: #000066;">,</span>  ۰<span style="color: #000066;">,</span> ۰<span style="color: #000066;">,</span> ۰<span style="color: #000066;">,</span> ۰<span style="color: #000066;">,</span>  SWP_NOMOVE <span style="color: #000000; font-weight: bold;">or</span> SWP_NOSIZE <span style="color: #000000; font-weight: bold;">or</span> SWP_SHOWWINDOW<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shahramonline.com/?feed=rss2&amp;p=189</wfw:commentRss>
		</item>
		<item>
		<title>عدم نمایش برنامه در TaskBar</title>
		<link>http://blog.shahramonline.com/?p=184</link>
		<comments>http://blog.shahramonline.com/?p=184#comments</comments>
		<pubDate>Fri, 30 Oct 2009 17:04:06 +0000</pubDate>
		<dc:creator>شهرام</dc:creator>
		
		<category><![CDATA[برنامه نویسی با دلفی Delphi]]></category>

		<category><![CDATA[برنامه نویسی ویندوز]]></category>

		<category><![CDATA[TaskBar]]></category>

		<category><![CDATA[دلفی]]></category>

		<guid isPermaLink="false">http://blog.shahramonline.com/?p=184</guid>
		<description><![CDATA[اگر شما نیاز دارید که نرم افزار شما در زمان اجرا در TaskBar نمایش داده نشود، می تونید دستورات زیر را در رویداد OnCreate فرم اصلی بنویسید:

]]></description>
			<content:encoded><![CDATA[<p>اگر شما نیاز دارید که نرم افزار شما در زمان اجرا در TaskBar نمایش داده نشود، می تونید دستورات زیر را در رویداد OnCreate فرم اصلی بنویسید:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax2"></a><a style="wp-synhighlighter-title" href="#codesyntax2"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">ShowWindow<span style="color: #000066;">&#40;</span>Application<span style="color: #000066;">.</span><span style="color: #006600;">Handle</span><span style="color: #000066;">,</span> SW_HIDE<span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">SetWindowLong<span style="color: #000066;">&#40;</span>Application<span style="color: #000066;">.</span><span style="color: #006600;">Handle</span><span style="color: #000066;">,</span> GWL_EXSTYLE<span style="color: #000066;">,</span> getWindowLong<span style="color: #000066;">&#40;</span>Application<span style="color: #000066;">.</span><span style="color: #006600;">Handle</span><span style="color: #000066;">,</span> GWL_EXSTYLE<span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">or</span> WS_EX_TOOLWINDOW<span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">ShowWindow<span style="color: #000066;">&#40;</span>Application<span style="color: #000066;">.</span><span style="color: #006600;">Handle</span><span style="color: #000066;">,</span> SW_SHOW<span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shahramonline.com/?feed=rss2&amp;p=184</wfw:commentRss>
		</item>
		<item>
		<title>Split کردن یک String درون یک TStringList</title>
		<link>http://blog.shahramonline.com/?p=180</link>
		<comments>http://blog.shahramonline.com/?p=180#comments</comments>
		<pubDate>Mon, 19 Oct 2009 22:21:47 +0000</pubDate>
		<dc:creator>شهرام</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[SQL Server]]></category>

		<category><![CDATA[برنامه نویسی با دلفی Delphi]]></category>

		<category><![CDATA[برنامه نویسی ویندوز]]></category>

		<category><![CDATA[Split]]></category>

		<category><![CDATA[String]]></category>

		<category><![CDATA[TStringList]]></category>

		<category><![CDATA[دلفی]]></category>

		<guid isPermaLink="false">http://blog.shahramonline.com/?p=180</guid>
		<description><![CDATA[احتمالا برای شما هم اتفاق افتاده است که بخواهید فایل هایی CSV را در برنامه خود بازخوانی کنید. همانطور که می دانید فایل های CSV فایلهایی هستند که در هر ردیف،  ستون های آن با استفاده از یک کاراکتر خاص جدا شده اند. که البته بیشتر از  کاما (,) و یا (;) و یا (Tab) [...]]]></description>
			<content:encoded><![CDATA[<p>احتمالا برای شما هم اتفاق افتاده است که بخواهید فایل هایی CSV را در برنامه خود بازخوانی کنید. همانطور که می دانید فایل های CSV فایلهایی هستند که در هر ردیف،  ستون های آن با استفاده از یک کاراکتر خاص جدا شده اند. که البته بیشتر از  کاما (,) و یا (;) و یا (Tab) استفاده می شود.</p>
<p>مثلا متنی مانند این را خواهید داشت: Field1; Field2; Field3; Field4</p>
<p>اگر تصور کنیم که شما بخواهید این ۴فیلد را بازخوانی کنید و در یک بانک اطلاعاتی ذخیره کنید، ابتدا باید این خط را تکه تکه کنید :دی</p>
<p>در ادامه مطلب متدی را نوشته ام که می توانید از آن به راحتی استفاده کنید</p>
<p><span id="more-180"></span></p>
<p>تابع اول تعداد تکرار کاراکترهای  جدا کننده و یا همان Separator را مشخص می کند:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax3"></a><a style="wp-synhighlighter-title" href="#codesyntax3"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">function</span> Occurs<span style="color: #000066;">&#40;</span><span style="color: #000000; font-weight: bold;">const</span> <span style="color: #000066;">Str</span><span style="color: #000066;">,</span> Separator<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">integer</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">var</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">I<span style="color: #000066;">,</span> nSep<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">integer</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">nSep<span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">for</span> I <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">1</span> <span style="color: #000000; font-weight: bold;">to</span> <span style="color: #000066;">Length</span><span style="color: #000066;">&#40;</span><span style="color: #000066;">Str</span><span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">do</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000066;">Str</span><span style="color: #000066;">&#91;</span>I<span style="color: #000066;">&#93;</span> <span style="color: #000066;">=</span> separator <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000066;">Inc</span><span style="color: #000066;">&#40;</span>nSep<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> nSep<span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
<p>تابع دوم، String یا متن شما را با توجه به جدا کننده یا Separator تکه تکه یا Split می کند و در یک متغیر از نوع TStringList بر می گرداند.</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax4"></a><a style="wp-synhighlighter-title" href="#codesyntax4"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">function</span> SplitStr<span style="color: #000066;">&#40;</span><span style="color: #000000; font-weight: bold;">const</span> <span style="color: #000066;">Str</span><span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">;</span> <span style="color: #000000; font-weight: bold;">const</span> Separator<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">:</span> TStringList<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">var</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">I<span style="color: #000066;">,</span> Count<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">integer</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">StrLine<span style="color: #000066;">,</span> StrField<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Res<span style="color: #000066;">:</span> TStringList<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Count <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Occurs<span style="color: #000066;">&#40;</span><span style="color: #000066;">Str</span><span style="color: #000066;">,</span> Separator<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Res <span style="color: #000066;">:</span><span style="color: #000066;">=</span> TStringList<span style="color: #000066;">.</span><span style="color: #006600;">Create</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">StrLine <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066;">Str</span><span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">for</span> I <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">to</span> Count <span style="color: #000000; font-weight: bold;">do</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000066;">Pos</span><span style="color: #000066;">&#40;</span>Separator<span style="color: #000066;">,</span> StrLine<span style="color: #000066;">&#41;</span> &gt; <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">StrField <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066;">Copy</span><span style="color: #000066;">&#40;</span>StrLine<span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> <span style="color: #000066;">Pos</span><span style="color: #000066;">&#40;</span>Separator<span style="color: #000066;">,</span> StrLine<span style="color: #000066;">&#41;</span><span style="color: #000066;">-</span><span style="color: #0000ff;">1</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">StrLine <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066;">Copy</span><span style="color: #000066;">&#40;</span>StrLine<span style="color: #000066;">,</span> <span style="color: #000066;">Pos</span><span style="color: #000066;">&#40;</span>Separator<span style="color: #000066;">,</span> StrLine<span style="color: #000066;">&#41;</span> <span style="color: #000066;">+</span><span style="color: #0000ff;">1</span><span style="color: #000066;">,</span> <span style="color: #000066;">Length</span><span style="color: #000066;">&#40;</span>StrLine<span style="color: #000066;">&#41;</span> <span style="color: #000066;">-</span> <span style="color: #000066;">Pos</span><span style="color: #000066;">&#40;</span>Separator<span style="color: #000066;">,</span> StrLine<span style="color: #000066;">&#41;</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">StrField <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066;">Copy</span><span style="color: #000066;">&#40;</span>StrLine<span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> <span style="color: #000066;">Length</span><span style="color: #000066;">&#40;</span>StrLine<span style="color: #000066;">&#41;</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Res<span style="color: #000066;">.</span><span style="color: #006600;">Add</span><span style="color: #000066;">&#40;</span>StrField<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Res<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
<p style="text-align: right;">موفق باشید</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shahramonline.com/?feed=rss2&amp;p=180</wfw:commentRss>
		</item>
		<item>
		<title>چه اتفاقی برای دلفی افتاده است؟ بورلند دلفی یا CodeGear؟ Embarcadero چیست!؟</title>
		<link>http://blog.shahramonline.com/?p=176</link>
		<comments>http://blog.shahramonline.com/?p=176#comments</comments>
		<pubDate>Fri, 16 Oct 2009 21:37:00 +0000</pubDate>
		<dc:creator>شهرام</dc:creator>
		
		<category><![CDATA[برنامه نویسی با دلفی Delphi]]></category>

		<category><![CDATA[برنامه نویسی ویندوز]]></category>

		<category><![CDATA[CodeGear]]></category>

		<category><![CDATA[Embarcadero]]></category>

		<category><![CDATA[دلفی]]></category>

		<guid isPermaLink="false">http://blog.shahramonline.com/?p=176</guid>
		<description><![CDATA[بحث خیلی از سایت ها وانجمن های مربوط به برنامه نویسی مخصوصا دلفی این روز ها به این موضوع اختصاص دارد که بالاخره کدام یک از گزینه های زیر؟
&#8220;Borland Delphi&#8221; یا &#8220;CodeGear Delphi&#8221; یا &#8220;Embarcadero Technologies Delphi&#8221;؟
این معمولا سوالی است که در ذهن هر دلفی کار قدیمی و جدیدی که یکی نسخه های  ۲۰۰۹ [...]]]></description>
			<content:encoded><![CDATA[<p>بحث خیلی از سایت ها وانجمن های مربوط به برنامه نویسی مخصوصا دلفی این روز ها به این موضوع اختصاص دارد که بالاخره کدام یک از گزینه های زیر؟</p>
<p>&#8220;Borland Delphi&#8221; یا &#8220;CodeGear Delphi&#8221; یا &#8220;Embarcadero Technologies Delphi&#8221;؟</p>
<p>این معمولا سوالی است که در ذهن هر دلفی کار قدیمی و جدیدی که یکی نسخه های  ۲۰۰۹ یا ۲۰۱۰  را نصب کرده است پیش می آید.</p>
<p>جواب اینجاست :</p>
<p><strong>سال ۱۹۹۵: شرکت بورلند نسخه جدیدی از پاسکال را ارائه داد و نام آن را دلفی گذاشت.</strong></p>
<p>۱۱ سال بعد در تاریخ  February 2006 بورلند نسخه دلفی ۱۱ را بسیار متفاوت ارائه کرد، نسخه که در آن Delphi, C++Builder, C#Builder, JBuilder, InterBase, JDataStore, nDataStore, Kylix یا یکجا جمع کرده بود. که البته آخرین نسخه بورلند دلفی هم بود.</p>
<p><strong>بورلند دلفی تبدیل می شود به CodeGear Delphi:</strong></p>
<p>در تاریخ November 2006 بورلند اعلام کرد که قصد دارد در جهت بالا بردن قدرت بهره وری ، توسعه دهندگان خود را به عنوان شرکت های فرعی بر موضوعات خاص متمرکز کند و نام آن را CodeGear گذاشت.</p>
<p><span id="more-176"></span></p>
<p>CodeGear یک شرکت تازه متولد شده از بورلند بود که به طور کامل و متمرکز در اختیار توسعه دهندگان این شرکت قرار داشت و در واقع یک شرکت فرعی از خود بورلند بود.</p>
<p><strong>CodeGear Delphi تبدیل می شود به Embarcadero Technologies Delphi:</strong></p>
<p>در تاریخ<strong> </strong>May 2008 شرکت <span onmouseover="_tipon(this)" onmouseout="_tipoff()">Embarcadero طی یک قرارداد رسمی، </span>CodeGear را از بورلند خریداری کرد. <span onmouseover="_tipon(this)" onmouseout="_tipoff()">Embarcadero یک شرکت بود که معمولا دست در کار های پایگاه داده داشت. برخی از محصولات آن عبارت است از </span>ER/Studio و DBArtisan و Rapid SQL و &#8230; .</p>
<p>با همکاری CodeGear و <span onmouseover="_tipon(this)" onmouseout="_tipoff()">Embarcadero یک شرکت تولید کننده محصولات توسعه دهنده و دیگری  یک شرکت در زمینه بانک های اطلاعاتی، اتحاد خوبی تشکیل دادند.  جایزه ای هم  به این دو شرکت داده شد. از دلایل اصلی که باعث شد این جایزه به این دو شرکت برسد می توان &#8220;</span><span onmouseover="_tipon(this)" onmouseout="_tipoff()">ابزاری برای طراحی ، ساخت ، بهینه سازی ، اجرای برنامه ها و نرم افزار و پایگاه داده ها در تمامی سیستم عامل های مختلف و زبانهای برنامه نویسی گوناگون&#8221; را بر شمرد.</span></p>
<p><span onmouseover="_tipon(this)" onmouseout="_tipoff()">الآن باید گفت:</span></p>
<p><strong><span onmouseover="_tipon(this)" onmouseout="_tipoff()">پادشاه (Borland Delphi) مرده است، زنده باد شاهزاده (</span>CodeGear Delphi by Embarcadero Technologies<span onmouseover="_tipon(this)" onmouseout="_tipoff()">)</span></strong></p>
<p><span onmouseover="_tipon(this)" onmouseout="_tipoff()">نتیجه اینکه دلفی ما همان دلفی است، فقط سیاست های توسعه دهنده های آن تغییر کرده است.</span></p>
<p><span onmouseover="_tipon(this)" onmouseout="_tipoff()">دوستت داریم دلفی&#8230;<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shahramonline.com/?feed=rss2&amp;p=176</wfw:commentRss>
		</item>
		<item>
		<title>پخش صدا های پیش فرض ویندوز</title>
		<link>http://blog.shahramonline.com/?p=170</link>
		<comments>http://blog.shahramonline.com/?p=170#comments</comments>
		<pubDate>Sun, 11 Oct 2009 18:16:58 +0000</pubDate>
		<dc:creator>شهرام</dc:creator>
		
		<category><![CDATA[برنامه نویسی با دلفی Delphi]]></category>

		<category><![CDATA[برنامه نویسی ویندوز]]></category>

		<category><![CDATA[MMSystem]]></category>

		<category><![CDATA[دلفی]]></category>

		<guid isPermaLink="false">http://blog.shahramonline.com/?p=170</guid>
		<description><![CDATA[برای پخش صدای های پیش فرض ویندوز یا همان System Sound ها می توان از PlaySound که یک API تابع است استفاده کرد. البته جهت استفاده از این تابع باید mmsystem را Use کرده باشید.
ویندوز اطلاعات مربوط به این صداها را در رجیستری خود نگهداری می کند. دقیقا در آدرس &#8220;AppEvents\Apps&#8221; از &#8220;HKEY_CURRENT_USER&#8221;.
جهت پخش کردن [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.shahramonline.com/wp-content/uploads/2009/10/systemsounds.gif"><img class="size-full wp-image-171 alignleft" style="border: 1px solid black; margin: 5px;" title="systemsounds" src="http://blog.shahramonline.com/wp-content/uploads/2009/10/systemsounds.gif" alt="systemsounds" width="202" height="213" /></a>برای پخش صدای های پیش فرض ویندوز یا همان System Sound ها می توان از <strong>PlaySound </strong>که یک API تابع است استفاده کرد. البته جهت استفاده از این تابع باید <em>mmsystem</em> را Use کرده باشید.</p>
<p>ویندوز اطلاعات مربوط به این صداها را در رجیستری خود نگهداری می کند. دقیقا در آدرس &#8220;AppEvents\Apps&#8221; از &#8220;HKEY_CURRENT_USER&#8221;.</p>
<p>جهت پخش کردن صدای&#8230; مثلا System Question می تونید به شکل زیر عمل کنید:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax5"></a><a style="wp-synhighlighter-title" href="#codesyntax5"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">PlaySound<span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'SystemQuestion'</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> SND_ALIAS <span style="color: #000000; font-weight: bold;">or</span> SND_ASYNC<span style="color: #000066;">&#41;</span></div></li></ol></pre></div></div></p>
<p style="text-align: right;">البته توجه داشته باشید که حتما باید یونیت <em>mmsystem</em> را Use کرده باشید.</p>
<p style="text-align: right;">در ادامه مطلب، نمونه برنامه ای آماده کرده ام که می تونید از آن به عنوان یک مثال استفاده کنید.</p>
<p style="text-align: right;"><span id="more-170"></span></p>
<p style="text-align: right;">در مرحله اول، ما لیست تمامی صداهای پیش فرض ویندوز را در یک ListBox ذخیره می کنیم. این کار را زمانی انجام می دهیم که فرم در حال ساختن است:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax6"></a><a style="wp-synhighlighter-title" href="#codesyntax6"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">FormCreate</span><span style="color: #000066;">&#40;</span>Sender<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">TObject</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">var</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">reg <span style="color: #000066;">:</span> TRegistry<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">reg <span style="color: #000066;">:</span><span style="color: #000066;">=</span> TRegistry<span style="color: #000066;">.</span><span style="color: #006600;">Create</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">try</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">reg<span style="color: #000066;">.</span><span style="color: #006600;">RootKey</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> HKEY_CURRENT_USER<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">reg<span style="color: #000066;">.</span><span style="color: #006600;">OpenKeyReadOnly</span><span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'\AppEvents\EventLabels'</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">reg<span style="color: #000066;">.</span><span style="color: #006600;">GetKeyNames</span><span style="color: #000066;">&#40;</span>ListBox1<span style="color: #000066;">.</span><span style="color: #006600;">Items</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">finally</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">reg<span style="color: #000066;">.</span><span style="color: #006600;">Free</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
<p style="text-align: right;">در مرحله دوم، با کلیک بر روی دکمه پخش، صدای مورد را پخش خواهیم کرد:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax7"></a><a style="wp-synhighlighter-title" href="#codesyntax7"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">Button1Click</span><span style="color: #000066;">&#40;</span>Sender<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">TObject</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">var</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">soundAlias <span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> ListBox1<span style="color: #000066;">.</span><span style="color: #006600;">ItemIndex</span> <span style="color: #000066;">=</span> <span style="color: #000066;">-</span><span style="color: #0000ff;">1</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">ShowMessage<span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'Select a sound alias from the list&amp;#8230;'</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000066;">Exit</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">soundAlias <span style="color: #000066;">:</span><span style="color: #000066;">=</span> ListBox1<span style="color: #000066;">.</span><span style="color: #006600;">Items</span><span style="color: #000066;">&#91;</span>ListBox1<span style="color: #000066;">.</span><span style="color: #006600;">ItemIndex</span><span style="color: #000066;">&#93;</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">PlaySound<span style="color: #000066;">&#40;</span><span style="color: #000066; font-weight: bold;">PAnsiChar</span><span style="color: #000066;">&#40;</span>soundAlias<span style="color: #000066;">&#41;</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> SND_ALIAS <span style="color: #000000; font-weight: bold;">or</span> SND_ASYNC<span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
<p style="text-align: right;"><a href="http://blog.shahramonline.com/wp-content/uploads/2009/10/systemsound-source.zip"><img class="alignnone" title="دانلود" src="http://blog.shahramonline.com/wp-content/uploads/2009/08/download1.gif" alt="" width="40" height="40" /></a><a href="http://blog.shahramonline.com/wp-content/uploads/2009/10/systemsound-source.zip">دریافت نمونه</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shahramonline.com/?feed=rss2&amp;p=170</wfw:commentRss>
		</item>
		<item>
		<title>تغییر نوع صفحه کلید به فارسی و انگلیسی با استفاده از Loadkeyboardlayout</title>
		<link>http://blog.shahramonline.com/?p=166</link>
		<comments>http://blog.shahramonline.com/?p=166#comments</comments>
		<pubDate>Wed, 07 Oct 2009 15:23:06 +0000</pubDate>
		<dc:creator>شهرام</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[برنامه نویسی با دلفی Delphi]]></category>

		<category><![CDATA[برنامه نویسی ویندوز]]></category>

		<category><![CDATA[سودمند]]></category>

		<category><![CDATA[بومی سازی]]></category>

		<category><![CDATA[دلفی]]></category>

		<guid isPermaLink="false">http://blog.shahramonline.com/?p=166</guid>
		<description><![CDATA[جهت تغییر نوع صفحه کلید به فارسی و انگلیسی می تونید از متد زیر استفاده کنید
تغییر به فارسی:

تغییر به انگلیسی:


در صورتی که بخواید صفحه کلید رو به زبان های دیگری تغییر دهید، می تونید به سایت msdn مراجعه کنید.
]]></description>
			<content:encoded><![CDATA[<p>جهت تغییر نوع صفحه کلید به فارسی و انگلیسی می تونید از متد زیر استفاده کنید</p>
<p>تغییر به فارسی:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax8"></a><a style="wp-synhighlighter-title" href="#codesyntax8"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Loadkeyboardlayout<span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'00000429 '</span><span style="color: #000066;">,</span> KLF_Activate<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
<p>تغییر به انگلیسی:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax9"></a><a style="wp-synhighlighter-title" href="#codesyntax9"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Loadkeyboardlayout<span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'0000000 '</span><span style="color: #000066;">,</span> KLF_Activate<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
<p style="text-align: right;">
<p style="text-align: right;">در صورتی که بخواید صفحه کلید رو به زبان های دیگری تغییر دهید، می تونید به سایت <a href="http://msdn.com" target="_blank">msdn</a> مراجعه کنید.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shahramonline.com/?feed=rss2&amp;p=166</wfw:commentRss>
		</item>
		<item>
		<title>بدست آوردن نام کامپیوتر یا همان Computer Name</title>
		<link>http://blog.shahramonline.com/?p=164</link>
		<comments>http://blog.shahramonline.com/?p=164#comments</comments>
		<pubDate>Mon, 31 Aug 2009 07:31:36 +0000</pubDate>
		<dc:creator>شهرام</dc:creator>
		
		<category><![CDATA[برنامه نویسی با دلفی Delphi]]></category>

		<category><![CDATA[برنامه نویسی ویندوز]]></category>

		<category><![CDATA[Computer Name]]></category>

		<category><![CDATA[دلفی]]></category>

		<guid isPermaLink="false">http://blog.shahramonline.com/?p=164</guid>
		<description><![CDATA[می خوام یک متد را اینجا معرفی کنم که با استفاده از آن می توانید Computer Name ی که نرم افزار شما  بر روی آن اجرا شده است را بدست آورید. گاها لازم می شه که این نام را داشته باشید. می توانید از متد زیر برای این کار استفاده کنید:

موفق باشید
]]></description>
			<content:encoded><![CDATA[<p>می خوام یک متد را اینجا معرفی کنم که با استفاده از آن می توانید Computer Name ی که نرم افزار شما  بر روی آن اجرا شده است را بدست آورید. گاها لازم می شه که این نام را داشته باشید. می توانید از متد زیر برای این کار استفاده کنید:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax10"></a><a style="wp-synhighlighter-title" href="#codesyntax10"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">function</span> GetComputerName<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">var</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">buffer<span style="color: #000066;">:</span> <span style="color: #000000; font-weight: bold;">array</span><span style="color: #000066;">&#91;</span>0<span style="color: #000066;">..</span><span style="color: #006600;">MAX_COMPUTERNAME_LENGTH</span> <span style="color: #000066;">+</span> <span style="color: #0000ff;">1</span><span style="color: #000066;">&#93;</span> <span style="color: #000000; font-weight: bold;">of</span> <span style="color: #000066; font-weight: bold;">Char</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Size<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Cardinal</span><span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Size <span style="color: #000066;">:</span><span style="color: #000066;">=</span> MAX_COMPUTERNAME_LENGTH <span style="color: #000066;">+</span> <span style="color: #0000ff;">1</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Windows<span style="color: #000066;">.</span><span style="color: #006600;">GetComputerName</span><span style="color: #000066;">&#40;</span><span style="color: #000066;">@</span>buffer<span style="color: #000066;">,</span> Size<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066;">StrPas</span><span style="color: #000066;">&#40;</span>buffer<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
<p style="text-align: right;">موفق باشید</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shahramonline.com/?feed=rss2&amp;p=164</wfw:commentRss>
		</item>
		<item>
		<title>تغییر ترتیب آیتم های یک ListBox با استفاده از Drag &amp; Drop</title>
		<link>http://blog.shahramonline.com/?p=158</link>
		<comments>http://blog.shahramonline.com/?p=158#comments</comments>
		<pubDate>Fri, 28 Aug 2009 08:52:25 +0000</pubDate>
		<dc:creator>شهرام</dc:creator>
		
		<category><![CDATA[برنامه نویسی با دلفی Delphi]]></category>

		<category><![CDATA[برنامه نویسی ویندوز]]></category>

		<category><![CDATA[Drag & Drop]]></category>

		<category><![CDATA[TListBox]]></category>

		<category><![CDATA[دلفی]]></category>

		<guid isPermaLink="false">http://blog.shahramonline.com/?p=158</guid>
		<description><![CDATA[همانطور که می دانید TListBox امکان نمایش لیست هایی با قابلیت Scroll را دارد. می خواهیم با استفاده از dragging and dropping امکانی برای کاربر ایجاد کنیم که بتواند ترتیب آیتم ها را تغییر دهد. یعنی یک آیتم را بگیرد و در جای دیگری رها کند.
برای این کار در ابتدا یک TListBox با نام ListBox1 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.shahramonline.com/wp-content/uploads/2009/08/screen1.jpg"><img class="alignleft size-full wp-image-159" style="border: 1px solid black; margin-left: 5px;" title="screen1" src="http://blog.shahramonline.com/wp-content/uploads/2009/08/screen1.jpg" alt="screen1" width="177" height="217" /></a>همانطور که می دانید TListBox امکان نمایش لیست هایی با قابلیت Scroll را دارد. می خواهیم با استفاده از dragging and dropping امکانی برای کاربر ایجاد کنیم که بتواند ترتیب آیتم ها را تغییر دهد. یعنی یک آیتم را بگیرد و در جای دیگری رها کند.</p>
<p>برای این کار در ابتدا یک TListBox با نام ListBox1 بر روی فرم خود قرار می دهید. چندین آیتم هم به آن اضافه کنید.</p>
<p>سپس در قسمت Public و یا Private (قبل از implementation) یک متغیر از نوع TPoint تعریف کنید:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax11"></a><a style="wp-synhighlighter-title" href="#codesyntax11"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">StartingPoint <span style="color: #000066;">:</span> TPoint<span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
<p style="text-align: right;">سپس در رویداد FormCreate فرم خود این دستور را بنویسید:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax12"></a><a style="wp-synhighlighter-title" href="#codesyntax12"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">FormCreate</span><span style="color: #000066;">&#40;</span>Sender<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">TObject</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">ListBox1<span style="color: #000066;">.</span><span style="color: #006600;">DragMode</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> dmAutomatic<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
<p style="text-align: right;">سپس در رویداد DragDrop مربوط به ListBox1 دستور زیر را بنویسید:</p>
<p style="text-align: right;"><span id="more-158"></span></p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax13"></a><a style="wp-synhighlighter-title" href="#codesyntax13"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">ListBox1DragDrop</span><span style="color: #000066;">&#40;</span>Sender<span style="color: #000066;">,</span> Source<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">TObject</span><span style="color: #000066;">;</span> X<span style="color: #000066;">,</span> Y<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">var</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">DropPosition<span style="color: #000066;">,</span> StartPosition<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">DropPoint<span style="color: #000066;">:</span> TPoint<span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">DropPoint<span style="color: #000066;">.</span><span style="color: #006600;">X</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> X<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">DropPoint<span style="color: #000066;">.</span><span style="color: #006600;">Y</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Y<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">with</span> Source <span style="color: #000000; font-weight: bold;">as</span> TListBox <span style="color: #000000; font-weight: bold;">do</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">StartPosition <span style="color: #000066;">:</span><span style="color: #000066;">=</span> ItemAtPos<span style="color: #000066;">&#40;</span>StartingPoint<span style="color: #000066;">,</span><span style="color: #000000; font-weight: bold;">True</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">DropPosition <span style="color: #000066;">:</span><span style="color: #000066;">=</span> ItemAtPos<span style="color: #000066;">&#40;</span>DropPoint<span style="color: #000066;">,</span><span style="color: #000000; font-weight: bold;">True</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Items<span style="color: #000066;">.</span><span style="color: #000066;">Move</span><span style="color: #000066;">&#40;</span>StartPosition<span style="color: #000066;">,</span> DropPosition<span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
<p style="text-align: right;">اکنون در رویداد DragOver مربوط به ListBox1 دستور زیر را بنویسید:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax14"></a><a style="wp-synhighlighter-title" href="#codesyntax14"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">ListBox1DragOver</span><span style="color: #000066;">&#40;</span>Sender<span style="color: #000066;">,</span> Source<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">TObject</span><span style="color: #000066;">;</span> X<span style="color: #000066;">,</span> Y<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">;</span> State<span style="color: #000066;">:</span> TDragState<span style="color: #000066;">;</span> <span style="color: #000000; font-weight: bold;">var</span> Accept<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Boolean</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Accept <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Source <span style="color: #000066;">=</span> ListBox1<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
<p style="text-align: right;">در آخر نیز در رویداد MouseDown مربوط به ListBox1 دستور زیر را بنویسید:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax15"></a><a style="wp-synhighlighter-title" href="#codesyntax15"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">ListBox1MouseDown</span><span style="color: #000066;">&#40;</span>Sender<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">TObject</span><span style="color: #000066;">;</span> Button<span style="color: #000066;">:</span> TMouseButton<span style="color: #000066;">;</span> Shift<span style="color: #000066;">:</span> TShiftState<span style="color: #000066;">;</span> X<span style="color: #000066;">,</span> Y<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">StartingPoint<span style="color: #000066;">.</span><span style="color: #006600;">X</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> X<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">StartingPoint<span style="color: #000066;">.</span><span style="color: #006600;">Y</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Y<span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
<p style="text-align: right;"><a href="http://blog.shahramonline.com/wp-content/uploads/2009/08/movelistboxitem-source.zip"><img class="alignnone" title="دانلود" src="http://blog.shahramonline.com/wp-content/uploads/2009/08/download1.gif" alt="" width="40" height="40" /></a><a href="http://blog.shahramonline.com/wp-content/uploads/2009/08/movelistboxitem-source.zip">دریافت نمونه</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shahramonline.com/?feed=rss2&amp;p=158</wfw:commentRss>
		</item>
		<item>
		<title>PhotoBlog</title>
		<link>http://blog.shahramonline.com/?p=156</link>
		<comments>http://blog.shahramonline.com/?p=156#comments</comments>
		<pubDate>Wed, 26 Aug 2009 15:11:10 +0000</pubDate>
		<dc:creator>شهرام</dc:creator>
		
		<category><![CDATA[شخصی]]></category>

		<guid isPermaLink="false">http://blog.shahramonline.com/?p=156</guid>
		<description><![CDATA[با سلام.
بالاخره دیروز PhotoBlog خودم را شروع کردم. البته از روی علاقه عکس می گیرم، زیاد هم حرفه ای نیستم.
من کلا قندیل خیلی دوست دارم، واسه همین با عکس قندیل شروع کردم.
از این آدرس می توانید ببینید:
http://deathproof.aminus3.com
]]></description>
			<content:encoded><![CDATA[<p>با سلام.</p>
<p>بالاخره دیروز PhotoBlog خودم را شروع کردم. البته از روی علاقه عکس می گیرم، زیاد هم حرفه ای نیستم.</p>
<p>من کلا قندیل خیلی دوست دارم، واسه همین با عکس قندیل شروع کردم.</p>
<p>از این آدرس می توانید ببینید:</p>
<p><a href="http://deathproof.aminus3.com/" target="_blank">http://deathproof.aminus3.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shahramonline.com/?feed=rss2&amp;p=156</wfw:commentRss>
		</item>
		<item>
		<title>کنترل دسترسی به فایل - متد IsFileInUse</title>
		<link>http://blog.shahramonline.com/?p=152</link>
		<comments>http://blog.shahramonline.com/?p=152#comments</comments>
		<pubDate>Wed, 26 Aug 2009 15:04:22 +0000</pubDate>
		<dc:creator>شهرام</dc:creator>
		
		<category><![CDATA[برنامه نویسی با دلفی Delphi]]></category>

		<category><![CDATA[برنامه نویسی ویندوز]]></category>

		<category><![CDATA[File]]></category>

		<category><![CDATA[دلفی]]></category>

		<guid isPermaLink="false">http://blog.shahramonline.com/?p=152</guid>
		<description><![CDATA[شاید برای شما هم پیش آمده باشد که به یک فایل دسترسی نداشته باشید. به هر دلیلی ممکن است که این مشکل پیش بیاید. مثلا یک فایل توسط نرم افزار دیگری در حال استفاده باشد و یا اینکه ReadOnly باشد. IsFileInUse یک متد است که برای بررسی وضعیت Use یک فایل به شما پیشنهاد می [...]]]></description>
			<content:encoded><![CDATA[<p>شاید برای شما هم پیش آمده باشد که به یک فایل دسترسی نداشته باشید. به هر دلیلی ممکن است که این مشکل پیش بیاید. مثلا یک فایل توسط نرم افزار دیگری در حال استفاده باشد و یا اینکه ReadOnly باشد. IsFileInUse یک متد است که برای بررسی وضعیت Use یک فایل به شما پیشنهاد می کنم. در صورتی که این متد True بازگرداند، فایل شما غیر قابل دسترسی خواهد بود و در صورتی که False برگرداند به این معنی است که شما به فایل مورد نظر کاملا دسترسی دارید. در ضمن، اگر فایل مورد نظر شما اصلا موجود نباشد، این متد Flase بر می گرداند. همچنین در صورتی که فایل مورد نظر شما ReadOnly باشد، این متد امکان تغییر Attribute آن را نیز دارد.</p>
<p>برای استفاده از این متد، باید StrUtils را Use کنید.</p>
<p><span id="more-152"></span></p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax16"></a><a style="wp-synhighlighter-title" href="#codesyntax16"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">function</span> IsFileInUse<span style="color: #000066;">&#40;</span>fName<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">boolean</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">var</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">HFileRes <span style="color: #000066;">:</span> HFILE<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Res<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">&#91;</span><span style="color: #0000ff;">6</span><span style="color: #000066;">&#93;</span><span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">function</span> CheckAttributes<span style="color: #000066;">&#40;</span>FileNam<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">;</span> CheckAttr<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Boolean</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">var</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">fa<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">fa <span style="color: #000066;">:</span><span style="color: #000066;">=</span> GetFileAttributes<span style="color: #000066;">&#40;</span><span style="color: #000066; font-weight: bold;">PChar</span><span style="color: #000066;">&#40;</span>FileNam<span style="color: #000066;">&#41;</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Res <span style="color: #000066;">:</span><span style="color: #000066;">=</span> &quot;<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000066;">&#40;</span>fa <span style="color: #000000; font-weight: bold;">and</span> FILE_ATTRIBUTE_NORMAL<span style="color: #000066;">&#41;</span> &lt;&gt; <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000000; font-weight: bold;">False</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000066;">Exit</span><span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000066;">&#40;</span>fa <span style="color: #000000; font-weight: bold;">and</span> FILE_ATTRIBUTE_ARCHIVE<span style="color: #000066;">&#41;</span> &lt;&gt; <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Res <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Res <span style="color: #000066;">+</span> <span style="color: #ff0000;">'A'</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000066;">&#40;</span>fa <span style="color: #000000; font-weight: bold;">and</span> FILE_ATTRIBUTE_COMPRESSED<span style="color: #000066;">&#41;</span> &lt;&gt; <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Res <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Res <span style="color: #000066;">+</span> <span style="color: #ff0000;">'C'</span><span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000066;">&#40;</span>fa <span style="color: #000000; font-weight: bold;">and</span> FILE_ATTRIBUTE_DIRECTORY<span style="color: #000066;">&#41;</span> &lt;&gt; <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Res <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Res <span style="color: #000066;">+</span> <span style="color: #ff0000;">'D'</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000066;">&#40;</span>fa <span style="color: #000000; font-weight: bold;">and</span> FILE_ATTRIBUTE_HIDDEN<span style="color: #000066;">&#41;</span> &lt;&gt; <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Res <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Res <span style="color: #000066;">+</span> <span style="color: #ff0000;">'H'</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000066;">&#40;</span>fa <span style="color: #000000; font-weight: bold;">and</span> FILE_ATTRIBUTE_READONLY<span style="color: #000066;">&#41;</span> &lt;&gt; <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Res <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Res <span style="color: #000066;">+</span> <span style="color: #ff0000;">'R'</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000066;">&#40;</span>fa <span style="color: #000000; font-weight: bold;">and</span> FILE_ATTRIBUTE_SYSTEM<span style="color: #000066;">&#41;</span> &lt;&gt; <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Res <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Res <span style="color: #000066;">+</span> <span style="color: #ff0000;">'S'</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> AnsiContainsText<span style="color: #000066;">&#40;</span>Res<span style="color: #000066;">,</span> CheckAttr<span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span> <span style="color: #808080; font-style: italic;">(*CheckAttributes*)</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">procedure</span> SetAttr<span style="color: #000066;">&#40;</span>fName<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">var</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Attr<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Attr <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> AnsiContainsText<span style="color: #000066;">&#40;</span>Res<span style="color: #000066;">,</span> <span style="color: #ff0000;">'A'</span><span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Attr <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Attr <span style="color: #000066;">+</span> FILE_ATTRIBUTE_ARCHIVE<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> AnsiContainsText<span style="color: #000066;">&#40;</span>Res<span style="color: #000066;">,</span> <span style="color: #ff0000;">'C'</span><span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Attr <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Attr <span style="color: #000066;">+</span> FILE_ATTRIBUTE_COMPRESSED<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> AnsiContainsText<span style="color: #000066;">&#40;</span>Res<span style="color: #000066;">,</span> <span style="color: #ff0000;">'D'</span><span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Attr <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Attr <span style="color: #000066;">+</span> FILE_ATTRIBUTE_DIRECTORY<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> AnsiContainsText<span style="color: #000066;">&#40;</span>Res<span style="color: #000066;">,</span> <span style="color: #ff0000;">'H'</span><span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Attr <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Attr <span style="color: #000066;">+</span> FILE_ATTRIBUTE_HIDDEN<span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> AnsiContainsText<span style="color: #000066;">&#40;</span>Res<span style="color: #000066;">,</span> <span style="color: #ff0000;">'S'</span><span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Attr <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Attr <span style="color: #000066;">+</span> FILE_ATTRIBUTE_SYSTEM<span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">SetFileAttributes<span style="color: #000066;">&#40;</span><span style="color: #000066; font-weight: bold;">PChar</span><span style="color: #000066;">&#40;</span>fName<span style="color: #000066;">&#41;</span><span style="color: #000066;">,</span> Attr<span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span> <span style="color: #808080; font-style: italic;">(*SetAttr*)</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span> <span style="color: #808080; font-style: italic;">//IsFileInUse</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> CheckAttributes<span style="color: #000066;">&#40;</span>fName<span style="color: #000066;">,</span> <span style="color: #ff0000;">'R'</span><span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000000; font-weight: bold;">False</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">not</span> <span style="color: #000066;">FileExists</span><span style="color: #000066;">&#40;</span>fName<span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #000066;">exit</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> MessageDlg<span style="color: #000066;">&#40;</span><span style="color: #000066;">ExtractFileName</span><span style="color: #000066;">&#40;</span>fName<span style="color: #000066;">&#41;</span> <span style="color: #000066;">+</span> <span style="color: #ff0000;">' is a READ-ONLY file.'</span> <span style="color: #000066;">+</span> <span style="color: #ff0000;">#13</span><span style="color: #ff0000;">#10</span> <span style="color: #000066;">+</span> <span style="color: #ff0000;">'Do you wish to clear the READ-ONLY flag???'</span><span style="color: #000066;">,</span> mtConfirmation<span style="color: #000066;">,</span> <span style="color: #000066;">&#91;</span>mbYes<span style="color: #000066;">,</span> mbNo<span style="color: #000066;">&#93;</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">=</span> mrNo <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">begin</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000000; font-weight: bold;">True</span><span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000066;">Exit</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">SetFileAttributes<span style="color: #000066;">&#40;</span><span style="color: #000066; font-weight: bold;">PChar</span><span style="color: #000066;">&#40;</span>fName<span style="color: #000066;">&#41;</span><span style="color: #000066;">,</span> FILE_ATTRIBUTE_NORMAL<span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">SetAttr<span style="color: #000066;">&#40;</span>fName<span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">HFileRes <span style="color: #000066;">:</span><span style="color: #000066;">=</span> CreateFile<span style="color: #000066;">&#40;</span><span style="color: #000066; font-weight: bold;">pchar</span><span style="color: #000066;">&#40;</span>fName<span style="color: #000066;">&#41;</span><span style="color: #000066;">,</span> GENERIC_READ <span style="color: #000000; font-weight: bold;">or</span> GENERIC_WRITE<span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> <span style="color: #000000; font-weight: bold;">nil</span><span style="color: #000066;">,</span> OPEN_EXISTING<span style="color: #000066;">,</span> FILE_ATTRIBUTE_NORMAL<span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066;">&#40;</span>HFileRes <span style="color: #000066;">=</span> INVALID_HANDLE_VALUE<span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">not</span> Result <span style="color: #000000; font-weight: bold;">then</span> CloseHandle<span style="color: #000066;">&#40;</span>HFileRes<span style="color: #000066;">&#41;</span> <span style="color: #000066;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;"><span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span> <span style="color: #808080; font-style: italic;">//IsFileInUse</span></div></li></ol></pre></div></div></p>
<p style="text-align: right;">جهت استفاده نیز می توانید به صورت عمل کنید:</p>
<p style="text-align: left;" dir="ltr"><div><div class="wp-synhighlighter-expanded"><a name="#codesyntax17"></a><a style="wp-synhighlighter-title" href="#codesyntax17"  onClick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];	if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} 	else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}">Code</a></div><div class="wp-synhighlighter-inner"><pre class="delphi" style="font-family:monospace;	direction:ltr;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top; 	direction:ltr;">IsFileInUse<span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'C:\Test.txt'</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></div></li></ol></pre></div></div></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shahramonline.com/?feed=rss2&amp;p=152</wfw:commentRss>
		</item>
	</channel>
</rss>
