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

<channel>
	<title>Some thougths, I thought ... &#187; IT thingies</title>
	<atom:link href="http://www.aberez.eu/category/it-thingies/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aberez.eu</link>
	<description>To think is to differ - Clarence Darrow</description>
	<lastBuildDate>Tue, 04 Oct 2011 15:41:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>ro</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bitcell.info</title>
		<link>http://www.aberez.eu/2010/01/bitcell-info/</link>
		<comments>http://www.aberez.eu/2010/01/bitcell-info/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 22:42:40 +0000</pubDate>
		<dc:creator>DarkByte</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[IT thingies]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.aberez.eu/?p=988</guid>
		<description><![CDATA[Un nou forum cu temă informatică, o nouă abordare. Sperăm să fie o abordare mai bună 

Vizitaţi-ne pe BitCell.info.
]]></description>
			<content:encoded><![CDATA[<p>Un nou forum cu temă informatică, o nouă abordare. Sperăm să fie o abordare mai bună <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/happy.gif" style="border:none;background:none;" alt="happy" /></p>
<p><center><a href="http://www.bitcell.info"><img src="http://bitcell.info/styles/rednblack/imageset/site_logo.gif" alt="Bitcell Forum" /></a></center></p>
<p>Vizitaţi-ne pe <a href="http://www.bitcell.info">BitCell.info</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aberez.eu/2010/01/bitcell-info/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Un Stick USB, mai multe bucăţi &#8230;</title>
		<link>http://www.aberez.eu/2009/10/stick-flash-usb-pieces/</link>
		<comments>http://www.aberez.eu/2009/10/stick-flash-usb-pieces/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 12:13:36 +0000</pubDate>
		<dc:creator>DarkByte</dc:creator>
				<category><![CDATA[De-ale vietii]]></category>
		<category><![CDATA[IT thingies]]></category>
		<category><![CDATA[multilanguage]]></category>

		<guid isPermaLink="false">http://www.aberez.eu/?p=680</guid>
		<description><![CDATA[Prin 2003, când am auzit şi eu prima oară de stick-uri USB, mi s-a părut o chestie foarte interesantă. Deh, ochii oricărui bărbat se lipesc de gadgeturi. Sau de rotunjimi şi curbe &#8230;
Bineînţeles că mi-am cumpărat şi eu unul. Avea o capacitate extraordinară de 256 de MB, era micuţ, albastru şi parţial transparent. Era jucăria [...]]]></description>
			<content:encoded><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Some thougths, I thought ... &#187; IT thingies</title>
	<atom:link href="http://www.aberez.eu/category/it-thingies/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aberez.eu</link>
	<description>To think is to differ - Clarence Darrow</description>
	<lastBuildDate>Tue, 04 Oct 2011 15:41:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>ro</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bitcell.info</title>
		<link>http://www.aberez.eu/2010/01/bitcell-info/</link>
		<comments>http://www.aberez.eu/2010/01/bitcell-info/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 22:42:40 +0000</pubDate>
		<dc:creator>DarkByte</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[IT thingies]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.aberez.eu/?p=988</guid>
		<description><![CDATA[Un nou forum cu temă informatică, o nouă abordare. Sperăm să fie o abordare mai bună 

Vizitaţi-ne pe BitCell.info.
]]></description>
			<content:encoded><![CDATA[<p>Un nou forum cu temă informatică, o nouă abordare. Sperăm să fie o abordare mai bună <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/happy.gif" style="border:none;background:none;" alt="happy" /></p>
<p><center><a href="http://www.bitcell.info"><img src="http://bitcell.info/styles/rednblack/imageset/site_logo.gif" alt="Bitcell Forum" /></a></center></p>
<p>Vizitaţi-ne pe <a href="http://www.bitcell.info">BitCell.info</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aberez.eu/2010/01/bitcell-info/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Un Stick USB, mai multe bucăţi &#8230;</title>
		<link>http://www.aberez.eu/2009/10/stick-flash-usb-pieces/</link>
		<comments>http://www.aberez.eu/2009/10/stick-flash-usb-pieces/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 12:13:36 +0000</pubDate>
		<dc:creator>DarkByte</dc:creator>
				<category><![CDATA[De-ale vietii]]></category>
		<category><![CDATA[IT thingies]]></category>
		<category><![CDATA[multilanguage]]></category>

		<guid isPermaLink="false">http://www.aberez.eu/?p=680</guid>
		<description><![CDATA[Prin 2003, când am auzit şi eu prima oară de stick-uri USB, mi s-a părut o chestie foarte interesantă. Deh, ochii oricărui bărbat se lipesc de gadgeturi. Sau de rotunjimi şi curbe &#8230;
Bineînţeles că mi-am cumpărat şi eu unul. Avea o capacitate extraordinară de 256 de MB, era micuţ, albastru şi parţial transparent. Era jucăria [...]]]></description>
			<content:encoded><![CDATA[<p>Prin 2003, când am auzit şi eu prima oară de stick-uri USB, mi s-a părut o chestie foarte interesantă. Deh, ochii oricărui bărbat se lipesc de gadgeturi. Sau de rotunjimi şi curbe &#8230;</p>
<p><img class="alignright" src="http://www.aberez.eu/images/usb_stick.jpg" alt="USB Flash Drive" />Bineînţeles că mi-am cumpărat şi eu unul. Avea o capacitate extraordinară de 256 de MB, era micuţ, albastru şi parţial transparent. Era jucăria perfectă. Gata cu stresul cauzat de dischete, gata cu CD-urile RW. Ca şi pe dischetă, puteam scrie şi sterge date cum aveam chef &#8230; ca şi pe CD, îmi permiteam să transfer multe.</p>
<p>Ce-i drept, mi-a făcut o gaură destul de mare în buzunar. Ditamai stickul de 256 MB m-a costat, pe atunci, aproape un sfert de salar. La acelaşi preţ aş putea cumpăra acum un stick de 16 GB sau chiar 32 de GB. Nu văd motivul pentru care aş face asta, ţinând cont de vitezele destul de reduse de transfer.</p>
<p>Recent, mi-am regăsit stickul. Era întreg, era funcţional, era albastru spălăcit şi încă transparent. Bonus, aveam şi date pe el. Fişiere din alte vremuri. Amintiri. O adevărată comoară.</p>
<p>L-am introdus într-un port USB din faţa carcasei calculatorului şi m-am apucat să verific tot ce aveam pe el. După vreo jumătate de oră, amuzat, nostalgic, chiar bucuros, am plecat la o ţigară pe balcon. Când am revenit, prins într-o discuţie cu un coleg de servici, am călcat  direct pe stick. N-am fost deloc încântat.</p>
<p>M-am uitat la resturile de sub talpă şi am fost destul de surprins să văd că e aproape intact. Se îndoise puţin, îşi dăduse jos hainele de plastic albastru transparent şi puteam vedea plăcuţa de control, care era, şi ea, un pic îndoită şi părea ruptă. Am încercat să introduc resturile stick-ului în USB, dar Windows a zis că nu-i găseşte driver. Fir-ar! Mi-a trecut prin cap că nu driver îi trebuie, ci un alt stick.</p>
<p>Am încercat să îndrept plăcuţa de control, dar cât mai fin posibil, şi am încercat din nou. Spre surpriza mea, de data asta a mers. Am copiat toate datele de pe el, iar acum &#8230; e piesă de blog, aşa cum puteţi admira mai jos <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/happy.gif" style="border:none;background:none;" alt="happy" /></p>

<div class="ngg-galleryoverview" id="ngg-gallery-1-680">


	<!-- Piclense link -->
	<div class="piclenselink">
		<a class="piclenselink" href="javascript:PicLensLite.start({feedUrl:'http://www.aberez.eu/wp-content/plugins/nextgen-gallery/xml/media-rss.php?gid=1&amp;mode=gallery'});">
			[View with PicLens]		</a>
	</div>
	
	<!-- Thumbnails -->
		
	<div id="ngg-image-1" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.aberez.eu/wp-content/gallery/emag/1_promo_ceas.png" title=" " class="shutterset_set_1" >
								<img title="1_promo_ceas" alt="1_promo_ceas" src="http://www.aberez.eu/wp-content/gallery/emag/thumbs/thumbs_1_promo_ceas.png" width="103" height="300" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-2" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.aberez.eu/wp-content/gallery/emag/2_emag_comm_1.png" title=" " class="shutterset_set_1" >
								<img title="2_emag_comm_1" alt="2_emag_comm_1" src="http://www.aberez.eu/wp-content/gallery/emag/thumbs/thumbs_2_emag_comm_1.png" width="200" height="146" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-3" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.aberez.eu/wp-content/gallery/emag/3_emag_comm_2.png" title=" " class="shutterset_set_1" >
								<img title="3_emag_comm_2" alt="3_emag_comm_2" src="http://www.aberez.eu/wp-content/gallery/emag/thumbs/thumbs_3_emag_comm_2.png" width="200" height="151" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-4" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.aberez.eu/wp-content/gallery/emag/4_emag_comm_3.png" title=" " class="shutterset_set_1" >
								<img title="4_emag_comm_3" alt="4_emag_comm_3" src="http://www.aberez.eu/wp-content/gallery/emag/thumbs/thumbs_4_emag_comm_3.png" width="200" height="244" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.aberez.eu/wp-content/gallery/emag/5_status_comanda.PNG" title=" " class="shutterset_set_1" >
								<img title="5_status_comanda" alt="5_status_comanda" src="http://www.aberez.eu/wp-content/gallery/emag/thumbs/thumbs_5_status_comanda.PNG" width="200" height="96" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


]]></content:encoded>
			<wfw:commentRss>http://www.aberez.eu/2009/10/stick-flash-usb-pieces/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Multilanguage Wordpress</title>
		<link>http://www.aberez.eu/2009/10/multilanguage-wordpress/</link>
		<comments>http://www.aberez.eu/2009/10/multilanguage-wordpress/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 22:21:38 +0000</pubDate>
		<dc:creator>DarkByte</dc:creator>
				<category><![CDATA[IT thingies]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[multilanguage]]></category>

		<guid isPermaLink="false">http://www.aberez.eu/?p=619</guid>
		<description><![CDATA[De câteva zile mă stresează ideea de a-mi modifica blogul în aşa fel încât să fie multi-language (adică să rămân cu acelaşi blog, dar să îmi permită să postez în mai multe limbi şi să afişeze posturile în funcţie de setarea globală de limbă).
Primul gând care mi-a trecut prin cap a fost să instalez un [...]]]></description>
			<content:encoded><![CDATA[<p>De câteva zile mă stresează ideea de a-mi modifica blogul în aşa fel încât să fie multi-language (adică să rămân cu acelaşi blog, dar să îmi permită să postez în mai multe limbi şi să afişeze posturile în funcţie de setarea globală de limbă).</p>
<p>Primul gând care mi-a trecut prin cap a fost să instalez un nou Wordpress pentru fiecare limbă care vreau s-o folosesc, dar când m-am gândit la toate pluginurile, setările şi toate celelalte porcării care o să mă încurce, am renunţat.</p>
<p>Din păcate, prea multe informaţii despre posibilitatea unui Wordpress care să suporte mai multe limbi, în paralel, nu există. La o căutare destul de adâncă am găsit un singur site care promitea ceva, aşa că l-am păstrat pentru teste.</p>
<p>Din fericire, pe lume există şi <a href="http://www.skullbox.info/profile/?u=32">Smash</a>, care mi-a găsit încă două site-uri care promiteau să fie perfecte.</p>
<p>N-am mai putut aştepta. Am luat xampp, l-am instalat, am luat Wordpress, l-am instalat şi pe el, am luat baza de date de pe blog, am importat-o în noul blog din localhost, am făcut setările cât mai apropiate de cele originale şi am trecut la creaţii.</p>
<p>Am început cu <a href="http://www.qianqin.de/qtranslate/">qTranslate</a> şi am crezut că mor când, după ce am dat pe Activate Plugin, mi-a afişat o pagină kilometrică cu erori. Noroc cu Google.</p>
<p>Fişierul &#8220;<strong>qtranslate_core.php</strong>&#8221; trebuie modificat. Mai exact, bucata următoare de cod trebuie comentată:</p>
<pre>
	if(is_object($text)||get_class($text) == '__PHP_Incomplete_Class') {
		foreach(get_object_vars($text) as $key => $t) {
			$text->$key = qtrans_use($lang,$text->$key,$show_available);
		}
		return $text;
	}</pre>
<p>După modificarea acestui fişier, instalarea, activarea şi setarea pluginului sunt simple ca bună ziua.</p>
<p>Tot ce trebuie să mai fac este să modific celelalte posturi ale blogului. Am încurcat-o rău de tot <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/straight_face.gif" style="border:none;background:none;" alt="straight face" /></p>
<p>Succes la îmbunătăţirea Wordpress-ului !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aberez.eu/2009/10/multilanguage-wordpress/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Să numărăm ferestrele &#8230;</title>
		<link>http://www.aberez.eu/2009/09/sa-numaram-ferestrele/</link>
		<comments>http://www.aberez.eu/2009/09/sa-numaram-ferestrele/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 19:20:21 +0000</pubDate>
		<dc:creator>DarkByte</dc:creator>
				<category><![CDATA[De-ale vietii]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[IT thingies]]></category>
		<category><![CDATA[multilanguage]]></category>

		<guid isPermaLink="false">http://www.aberez.eu/?p=605</guid>
		<description><![CDATA[Sunt (un pic) mai mult de 11 ani de când, pentru prima oară, am dat nas în nas cu Windows. Mă decisesem, după nişte asigurări ferme că voi fi ajutat dacă va fi nevoie, să încerc să intru la liceu într-o secţie de informatică, deşi nu văzusem un calculator în viaţa mea (n-am pus filmele [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="http://www.aberez.eu/images/winlist.png">Sunt (un pic) mai mult de 11 ani de când, pentru prima oară, am dat nas în nas cu Windows. Mă decisesem, după nişte asigurări ferme că voi fi ajutat dacă va fi nevoie, să încerc să intru la liceu într-o secţie de informatică, deşi nu văzusem un calculator în viaţa mea (n-am pus filmele la socoteală &#8230; dar acolo arată bine <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/big_grin.gif" style="border:none;background:none;" alt="big grin" />)</p>
<p>Înainte de examenele de admitere din vara anului 1998 am fost cu mama mea la serviciul ei unde, la birouri, erau nişte calculatoare, iar fiica şefei butona deseori pe acolo. Evident, pentru a vedea cum arată un calculator. Bineînţeles că, inteligent cum mă ştiam, îmi imaginam ca în două săptămâni o să învăţ tot ce se poate despre calculatoare (nu mă mai prea uit la filme după deziluzia de atunci <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/straight_face.gif" style="border:none;background:none;" alt="straight face" />).<span id="more-605"></span> Ştefania, fata cu pricina, cu un an mai mare ca mine (deja la liceu, tot la secţie de informatică) nu prea avea stofă de profesor, aşa că a apăsat butonul de Power, au început să se deruleze nişte linii cu scris alb pe ecran, iar eu mă uitam ca la pagubă. Când liniile au obosit să tot fugă, Ştefania a scris trei litere, <em>w</em>, <em>i</em>, <em>n</em> şi a apăsat Enter (Enter &#8230; adică o tastă mare aflată la dreapta centrului tastaturii).</p>
<p>Windows. Versiune: 3.11. Totul a devenit luminos, in majoritate alb. Ferestre. Cursor de mouse. Ferestre. Apoi desene micuţe, colorate, în fiecare ocean de alb. Am văzut imediat că a intrat într-un ocean pln de jocuri şi a tot înotat până a găsit Solitaire. A fost interesant, dar &#8230; I mean, nu plec de la cărţile de joc de acasă ca să joc cărţi pe un calculator.</p>
<p>A trecut mult timp de atunci (din punctul meu de vedere), dar am rămas pe Windows. Altfel spus, plouă cu ferestre în continuare. Ce-i drept, de ani buni plouă cu ferestre şi în Linux&#8230;</p>
<p>Până nu demult, uitasem cât m-au fascinat pe mine ferestrele de Windows în liceu (mai ales după olimpiada de informatică dintr-a 9-a &#8230; mi s-a spus să-mi copiez fişierele sursă pe o dischetă, din Windows &#8230; foarte spăşit, a trebuit să-i explic lu&#8217; tanti profesoara că habar n-am cum). Atât de mult că, în clasa a 11-a, am făcut un program, în Delphi, care să-mi listeze ferestrele de prin sistem, inclusiv cele ascunse &#8230; şi, mai ales, să îmi permită să mă joc cu ele <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/big_grin.gif" style="border:none;background:none;" alt="big grin" /> Să le pun <em>always on top</em>, să le ascund, să le mut &#8230; vremuri frumoase <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/happy.gif" style="border:none;background:none;" alt="happy" /></p>
<p>Admiţând că aţi avut răbdare până acum, în cele ce urmează o să vă prezint respectivul progrămel, explicând câteva bucăţi de cod şi, ca şi până acum, să-l ofer ca open-source.</p>
<p>Prima funcţie care mi-a fost necesară a fost <strong><a href="http://msdn.microsoft.com/en-us/library/ms633497(VS.85).aspx">EnumWindows</a></strong>, o funcţie API care oferă lista completă a ferestrelor din sistem, având nevoie de doi parametri: o funcţie <strong>callback</strong> şi o valoare definită de programator pentru a fi pasată acestei funcţii callback. Să fiu sincer, la început n-am înţeles ce pisici e cu funcţia asta callback şi de ce, în acest caz, are nevoie de un parametru pentru un handle al unei ferestre şi parametrul definit de mine. I mean, într-un sistem sunt sute de ferestre &#8230; cum o să mi le dea pe toate într-un singur handle ?</p>
<p>Am trecut repede peste acest aspect, afişând acel &#8220;unic&#8221; handle (cum mă aşteptam eu) într-un ShowMessage. Mai trebuie să spun că dupa al 20-lea ShowMessage am intrat in Delphi şi am dat Ctrl + F2 (program reset) ? Funcţia callback este apelată pentru <strong>fiecare</strong> fereastră principală găsită de EnumWindows, oferindu-mi handle-ul ei.</p>
<p>Buuun &#8230; am rezolvat lista de ferestre. Am o listă de handle-uri către ferestre care, sincer, arată zdrobitor. În sensul de ciocan. Eu vroiam ceva flashy, ceva care să ia ochiul, ceva care să arate, oricui s-ar uita, că programul e super-mega-ultra-bla-bla. Hmm &#8230; titlul ferestrei (de obicei, caption bar-ul) ar da bine &#8230;</p>
<p>Am trecut la aflarea numelui ferestrei, nume oferit generos de <strong><a href="http://msdn.microsoft.com/en-us/library/ms633520(VS.85).aspx">GetWindowText</a></strong>, dacă oferi handle-ul ferestrei şi un locşor unde să toarne caracterele.</p>
<p>Da, deja arată mai bine. Totuşi, sunt o gramadă de nume ciudate pe aici. CiceroUIWndFrame, curtain, AXWIN Frame Window, DDE Server Window, SysFader &#8230; WTF ? Microsoft sucks! Totuşi, ce naiba e cu ferestrele astea? Trebuie să le vedem <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/big_grin.gif" style="border:none;background:none;" alt="big grin" /></p>
<p><strong><a href="http://msdn.microsoft.com/en-us/library/ms633548(VS.85).aspx">ShowWindow</a></strong> to the rescue. O funcţie foarte atractivă şi glumeaţă. Dai un handle şi îi specifici SW_SHOW and voila &#8230; fereastra a ieşit din ceaţa invizibilităţii. Specifici SW_HIDE şi &#8230; uite popa, nu e popa. Mai ştie şi alte treburi, dar dacă vă interesează, n-aveţi decât să RTFM pe linkul dat mai sus.</p>
<p>Acesta a fost un moment adevărat de răscruce. Mi-am dat seama că, având în vedere perechile Get / Set de funcţii, trebuie să existe <strong><a href="http://msdn.microsoft.com/en-us/library/ms633546(VS.85).aspx">SetWindowText</a></strong>. Lucky bet. Am implementat rapid funcţionalitatea şi am fost foarte mândru de mine când fereastra de Windows Explorer se prezenta drept &#8220;Bond. James Bond&#8221;. Glumesc, bineînţeles. Se numea &#8220;Pop. Victor Pop&#8221;.</p>
<p>Indiferent de nume, funcţia <strong><a href="http://msdn.microsoft.com/en-us/library/ms633545(VS.85).aspx">SetWindowPos</a></strong> are în grijă şi setarea Z-order-ului, plus setarea ferestrelor top-level, pe lângă faptul evident că poate muta / redimensiona o fereastra. A fost o plăcere să lucrez cu această funcţie pentru a seta o fereastra, aleasă de mine, să fie Always On Top sau Always &#8230; sau nu.</p>
<p>Restul codului ar trebui să fie destul de explicit, dar dacă aveţi nelămuriri, let me know. O să încerc să fac pe bunul samaritean, o dată în viaţă <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/big_grin.gif" style="border:none;background:none;" alt="big grin" /></p>
<p><b>Download</b>:</p>
<p>Sursa : [download id="2"]<br />
Executabil : [download id="1"]<br />
<a href="http://www.aberez.eu/images/progs/enuwind.png" target="_blank">Screenshot</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aberez.eu/2009/09/sa-numaram-ferestrele/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Oameni &#8230;</title>
		<link>http://www.aberez.eu/2009/08/oameni/</link>
		<comments>http://www.aberez.eu/2009/08/oameni/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 06:37:04 +0000</pubDate>
		<dc:creator>DarkByte</dc:creator>
				<category><![CDATA[Aberatii]]></category>
		<category><![CDATA[De-ale vietii]]></category>
		<category><![CDATA[Delphi]]></category>

		<guid isPermaLink="false">http://www.aberez.eu/?p=487</guid>
		<description><![CDATA[Aseară am revenit în Oradea, decis ca pe tren să-mi continui proiectele de programare care le am în curs.
În vederea acestui scop, mi-am lăsat laptopul la încărcat până în ultima clipă, apoi l-am pus în hibernare şi am plecat. Ajuns în gară, am hotărât să mă aşez în singurul locşor din tren unde există priză [...]]]></description>
			<content:encoded><![CDATA[<p>Aseară am revenit în Oradea, decis ca pe tren să-mi continui proiectele de programare care le am în curs.</p>
<p>În vederea acestui scop, mi-am lăsat laptopul la încărcat până în ultima clipă, apoi l-am pus în hibernare şi am plecat. Ajuns în gară, am hotărât să mă aşez în singurul locşor din tren unde există priză (de fapt, două alăturate &#8230; doar suntem europeni acum, nu?).</p>
<p>Am avut, totuşi, o mică surpriză, nu neapărat plăcută, când, după ce am urcat în tren, am remarcat că pe cele mai apropiate două locuri (de priză) erau două femei, una la vreo 35 de ani şi cealaltă undeva peste 50. Doar locul de dincolo de ele era gol, dar îmi displăcea profund ideea de a butona înghiontit de colegii de drum, <a href="http://www.aberez.eu/15-08-2009/feriti-a-fost-vineri-14/">cum mi s-a mai întâmplat</a>&#8230;</p>
<p>Mi-am luat inima în dinţi şi am rugat-o pe doamna mai tânără (cea care stătea chiar lângă priză), dacă se poate, să-mi doneze locul ei. Am contat pe faptul că nu avea telefon la încărcat şi nici nu părea să fie în stare  să distingă un laptop închis de o cărămidă mai interesantă.</p>
<p>După ce a trebuit să repet de câteva ori întrebarea (s-a băgat şi doamna mai în vârstă în discuţie), a fost de acord să mă lase să-mi pun telefonul la încărcat acolo &#8230; când, într-un final, a înţeles că o rugam să se mute, a făcut o mutră mai acră, dar s-a mutat, lăsându-şi totuşi bagajul să-i ţină companie trollerului meu.</p>
<p>Nu a uitat, atunci când s-a aşezat pe noul loc, să arunce o ultimă replică mai veninoasă: &#8220;Ştii, nu e frumos să ridici femeile !&#8221;. Da, ştiu, doar pe piedestal &#8230;</p>
<p>Chiar m-a blocat niţel &#8230; probabil că s-a şi văzut pe faţa mea, pentru că nu a mai adăugat nimic.</p>
<p>Tanti nu avea nici un folos pentru amărâta aia de priză, iar în acel tren doar acolo există vreo priză. Cu ce-am deranjat-o atât de tare că am rugat-o să se mute în cealaltă parte a femeii în vârstă, ţinând cont de faptul că am rugat-o frumos?</p>
<p>Cireaşa de pe tort a venit un pic mai încolo, totuşi &#8230; la prima staţie ambele femei au coborât &#8230; asta chiar m-a lăsat mască. Pentru 10 minute de călătorie s-a gândit să-mi arunce remarca aia? Sau doar pentru că era de la ţară?</p>
<p>Cred că oamenii nu se simt bine dacă nu încearcă să facă pe alţi oameni să se simtă prost &#8230; just for the fun of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aberez.eu/2009/08/oameni/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Calculator de bioritm</title>
		<link>http://www.aberez.eu/2009/08/calculator-de-bioritm/</link>
		<comments>http://www.aberez.eu/2009/08/calculator-de-bioritm/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 14:53:58 +0000</pubDate>
		<dc:creator>DarkByte</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[IT thingies]]></category>

		<guid isPermaLink="false">http://www.aberez.eu/?p=470</guid>
		<description><![CDATA[Destul de recent, am primit linkuri pe site-uri care-ți calculau bioritmul și afișau graficele și mi s-a părut destul de interesant, așa că &#8230; m-am apucat să-mi fac un program care să-mi afișeze bioritmul, fără să fie nevoie să intru pe vreun site sau să am măcar conexiune la Internet.
Cu toate acestea, ce trebuie să [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="http://www.aberez.eu/images/bio_ritm.jpg">Destul de recent, am primit linkuri pe site-uri care-ți calculau bioritmul și afișau graficele și mi s-a părut destul de interesant, așa că &#8230; m-am apucat să-mi fac un program care să-mi afișeze bioritmul, fără să fie nevoie să intru pe vreun site sau să am măcar conexiune la Internet.</p>
<p>Cu toate acestea, ce trebuie să ştiţi este că aceste cicluri bioritmice <strong>nu</strong> sunt dovedite ştiinţific, ba chiar, mai curând, infirmate. Pentru detalii, vedeţi ce zice <a href="http://en.wikipedia.org/wiki/Biorhythm">Wikipedia</a>.</p>
<p>Acestea fiind spuse, să trecem la partea tehnică și informatică din spatele acestui program.</p>
<p>Probabil că știți că pentru a desena o sinusoidală pe calculator, calculezi o serie de puncte, care le unești prin linii. O treabă foarte ușoară în Delphi. Ceea ce probabil că nu știți e faptul că există o funcție în Delphi, care unește o serie de puncte prin linii mult mai rapid decât dacă ai face o buclă, desenând liniile una câte una. Funcția se numește PolyLine (o puteți căuta în Help).</p>
<p>Mai exact, un cod de forma</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">begin</span>
   MoveTo<span style="color: #000066;">&#40;</span><span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> F<span style="color: #000066;">&#40;</span><span style="color: #0000ff;">0</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
   <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: #0000ff;">100</span> <span style="color: #000000; font-weight: bold;">do</span>
      LineTo<span style="color: #000066;">&#40;</span>i<span style="color: #000066;">,</span> F<span style="color: #000066;">&#40;</span>i<span style="color: #000066;">&#41;</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

<p>ar putea fi optimizat cu codul următor:</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> lPoints<span style="color: #000066;">:</span> <span style="color: #000000; font-weight: bold;">array</span> <span style="color: #000000; font-weight: bold;">of</span> TPoint<span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">begin</span>
   <span style="color: #000066;">SetLength</span><span style="color: #000066;">&#40;</span>lPoints<span style="color: #000066;">,</span> <span style="color: #0000ff;">101</span> <span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
&nbsp;
   <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> <span style="color: #0000ff;">100</span> <span style="color: #000000; font-weight: bold;">do</span>
      <span style="color: #000000; font-weight: bold;">with</span> lPoints<span style="color: #000066;">&#91;</span>i<span style="color: #000066;">&#93;</span> <span style="color: #000000; font-weight: bold;">do</span>
      <span style="color: #000000; font-weight: bold;">begin</span>
         X <span style="color: #000066;">:</span><span style="color: #000066;">=</span> i<span style="color: #000066;">;</span>
         Y <span style="color: #000066;">:</span><span style="color: #000066;">=</span> F<span style="color: #000066;">&#40;</span>i<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
      <span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
&nbsp;
   Polyline<span style="color: #000066;">&#40;</span>lPoints<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

<p>În afară de acest lucru, restul codului este ușor de înțeles, fiind și parțial comentat. Sursa este scrisă în Delphi 7, dar probabil că va compila și cu alte versiuni de Delphi (mai vechi sau mai noi).</p>
<p>Download : <a href="http://www.aberez.eu/codes/bioritm/bioritm_src.zip">Sursa</a> :: <a href="http://www.aberez.eu/codes/bioritm/bioritm_exe.zip">Executabil</a> :: <a href="http://www.aberez.eu/images/bioritm.png" target="_blank">Screenshot</a></p>
<p>Comentarii, bug-uri, sugestii : binevenite. Also, partea grafică a programului m-a interesat doar din punctul de vedere al graficelor, deci &#8230; știu că poate fi îmbunătățit designul.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aberez.eu/2009/08/calculator-de-bioritm/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Iron SRWare</title>
		<link>http://www.aberez.eu/2009/08/iron-srware/</link>
		<comments>http://www.aberez.eu/2009/08/iron-srware/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 08:46:48 +0000</pubDate>
		<dc:creator>DarkByte</dc:creator>
				<category><![CDATA[IT thingies]]></category>
		<category><![CDATA[multilanguage]]></category>

		<guid isPermaLink="false">http://www.aberez.eu/?p=444</guid>
		<description><![CDATA[SRWare Iron is a real alternative [to Chrome]. The browser is based on the Chromium-source and offers the same features as Chrome &#8211; but without the critical points that the privacy concern.
Am găsit, recent, o alternativă pentru Chrome care se laudă a fi egalul acestuia, exceptând colectarea datelor private ale utilizatorilor.
Îl folosesc de mai bine [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>SRWare Iron is a real alternative [to Chrome]. The browser is based on the Chromium-source and offers the same features as Chrome &#8211; but without the critical points that the privacy concern.</p></blockquote>
<p>Am găsit, recent, o alternativă pentru <a href="http://www.aberez.eu/02-09-2008/google-chrome/">Chrome</a> care se laudă a fi egalul acestuia, exceptând colectarea datelor private ale utilizatorilor.</p>
<p><img class="alignleft" src="http://www.aberez.eu/images/ironsrware.png" alt="Iron SRWare" width="100px" />Îl folosesc de mai bine de două săptămâni şi pot spune că-mi place. Chiar are aceleaşi posibilităţi ca şi Chrome (fiind bazat pe sursa acestuia, nu e mare mirare), dar (şi poate e doar o impresie) parcă se mişcă mai rapid.</p>
<p>Aruncaţi şi voi o privire, poate vă interesează.</p>
<p><a href="http://www.srware.net/en/software_srware_iron.php">SRWare Iron &#8211; The Browser of the Future</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aberez.eu/2009/08/iron-srware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Skullboxing &#8230;</title>
		<link>http://www.aberez.eu/2009/06/skullboxing/</link>
		<comments>http://www.aberez.eu/2009/06/skullboxing/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 15:29:33 +0000</pubDate>
		<dc:creator>DarkByte</dc:creator>
				<category><![CDATA[IT thingies]]></category>
		<category><![CDATA[Opinii]]></category>

		<guid isPermaLink="false">http://www.aberez.eu/?p=161</guid>
		<description><![CDATA[Contrar aparenţelor, nu vreau să descriu vreun sport nou de contact. Nici măcar unul vechi. De fapt, singurul sport la care mă refer e cel al neuronilor supraîncărcaţi şi al degetelor care ating Mach 2. Ringul este un locşor agăţat pe Internet care găzduieşte de ceva timp o comunitate de oameni bine intenţionaţi care vor [...]]]></description>
			<content:encoded><![CDATA[<p>Contrar aparenţelor, nu vreau să descriu vreun sport nou de contact. Nici măcar unul vechi. De fapt, singurul sport la care mă refer e cel al neuronilor supraîncărcaţi şi al degetelor care ating Mach 2. Ringul este un locşor agăţat pe Internet care găzduieşte de ceva timp o comunitate de oameni bine intenţionaţi care vor să înveţe informatică, să predea altora din ceea ce ştiu şi, nu în ultimul rând, să se asigure că, indiferent de cantitatea de cunoştinţe acumulate, fiecare se va simţi @<em>home</em>.</p>
<p>La început, a fost Internetul. <span id="more-161"></span>Apoi a fost creat 3xforum.ro şi au apărut, încet, apoi din ce în ce mai rapid, comunităţi hostate pe 3xforum care erau pe placul lui <a title="The Mentor" href="http://en.wikipedia.org/wiki/Loyd_Blankenship" target="_blank">The Mentor</a> &#8230; bineînţeles, unele comunităţi au muşcat din mărul discordiei şi s-au apucat de &#8220;hecărit&#8221;, fără să înţeleagă ce înseamnă un hacker, lucru care a dus la ploile cu foc şi pucioasă din Erele Întunecate ale Internetului (ah, şi au contribuit la încetăţenirea termenului de &#8220;hacker&#8221; &#8230; bineînţeles, cu un sens niţel diametral opus decât cel original).</p>
<p>Apoi a venit potopul de forumuri care apăreau ca şi ciupercile după ploaie, care mai de care pline de oameni (mai bine zis, copii teribilişti) care visau doar deface-uri, furturi de parole si cc-uri, and so on &#8230; Cu timpul, s-au cernut câţiva oameni care au vrut să facă ceva mai bun&#8230; un loc în care să înveţi, dar să înveţi ce e bine să faci. Un loc unde muzica rock să fie la mare cinste, iar maneliştii să fie banaţi (scratch the last few words, d&#8217;oh). Un loc care să te stimuleze să înveţi, să te stimuleze să creezi &#8230; să crească Oameni, nu doar persoane care ştiu butona.</p>
<p>Am avut norocul să fiu inclus în echipa care s-a ocupat de construcţia acestui locşor şi mi-am adus şi eu contribuţia, în măsura posibilităţilor, încă de pe când se săpau şanţurile şi se puneau fundaţiile. Evident, asta e un amănunt care explică foarte clar de ce nu pot fi obiectiv vorbind despre <a title="Bitcell" href="http://www.bitcell.info" target="_blank">SkullBox</a>, fiind primul loc de pe Internet unde chiar m-am simţit ca acasă.</p>
<p>Rareori am mai căutat în alte parte informaţii legate de calculatoare şi aura de software care le înconjoară, fiindca SkullBox, pe lângă cantitatea (deja enormă) de informaţii foarte preţioase pentru cei care au nevoie de ele, dispune de o echipă de oameni inteligenţi care fac tot posibilul să răspundă oricărei întrebări (decente !) legate de prietenii noştri alimentaţi la 220V (sau 110V, după caz).</p>
<p>So, dacă ai nevoie de sfaturi legate de setările sistemului de operare sau ale site-ului tău, tutoriale de programare sau sfinte scripturi de php sau java &#8230; sau, pur şi simplu, vrei să te simţi bine, <a title="Bitcell" href="http://www.bitcell.info/board" target="_blank">SkullBox</a> merită încercat.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aberez.eu/2009/06/skullboxing/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Tag-cloud</title>
		<link>http://www.aberez.eu/2008/12/tag-cloud/</link>
		<comments>http://www.aberez.eu/2008/12/tag-cloud/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 12:17:31 +0000</pubDate>
		<dc:creator>DarkByte</dc:creator>
				<category><![CDATA[IT thingies]]></category>
		<category><![CDATA[multilanguage]]></category>

		<guid isPermaLink="false">http://www.aberez.eu/?p=140</guid>
		<description><![CDATA[Am găsit zilele trecute o chestie drăguţă, numai bună de adăugat pe blog. Cu ajutorul şi asistenţa lui misssun, l-am înţeles şi l-am asignat propriilor interese.
Sper să vă placă şi vouă.
[WP-CUMULUS]
Îl găsiţi, momentan, în varianta mică (şi modificată) în sidebar, afişând categoriile şi câteva linkuri care am considerat eu că merită această favoare 
See ya [...]]]></description>
			<content:encoded><![CDATA[<p>Am găsit zilele trecute <a href="http://www.roytanck.com/tag-cloud/">o chestie drăguţă</a>, numai bună de adăugat pe blog. Cu ajutorul şi asistenţa lui misssun, l-am înţeles şi l-am asignat propriilor interese.</p>
<p>Sper să vă placă şi vouă.</p>
<p><center>[WP-CUMULUS]</center></p>
<p>Îl găsiţi, momentan, în varianta mică (şi modificată) în sidebar, afişând categoriile şi câteva linkuri care am considerat eu că merită această favoare <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/happy.gif" style="border:none;background:none;" alt="happy" /></p>
<p>See ya later <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/winking.gif" style="border:none;background:none;" alt="winking" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aberez.eu/2008/12/tag-cloud/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Window Spy</title>
		<link>http://www.aberez.eu/2008/07/window-spy/</link>
		<comments>http://www.aberez.eu/2008/07/window-spy/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 12:39:54 +0000</pubDate>
		<dc:creator>DarkByte</dc:creator>
				<category><![CDATA[Delphi]]></category>

		<guid isPermaLink="false">http://www.aberez.eu/?p=21</guid>
		<description><![CDATA[Probabil că ştiţi că în Windows totul se bazează pe ferestre &#8230; era destul de evident, nu ?
Să vedem cum am putea afla câte ceva legat de ferestrele vizibile şi cum am putea să le ascundem, să le dezactivăm, etc, totul din Borland Delphi, folosind funcţii API.
Pentru început, să vedem cum aflăm ce fereastră avem [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://www.aberez.eu/images/win32api.jpg" alt="Win 32 API" />Probabil că ştiţi că în Windows totul se bazează pe ferestre &#8230; era destul de evident, nu ?</p>
<p>Să vedem cum am putea afla câte ceva legat de ferestrele vizibile şi cum am putea să le ascundem, să le dezactivăm, etc, totul din Borland Delphi, folosind funcţii API.<img class="alignright" src="http://www.aberez.eu/images/delphi7.jpg" alt="Borland Delphi 7" /></p>
<p>Pentru început, să vedem cum aflăm ce fereastră avem sub cursorul de mouse.</p>
<p>Pentru asta ne trebuie să ştim poziţia cursorului, care se poate afla folosind funcţia <strong><code>GetCursorPos</code></strong>, din care putem afla handle-ul ferestrei de sub cursor, folosind funcţia <strong><code>WindowFromPoint</code></strong>Să vedem nişte cod.</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> hWindow  <span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Longint</span><span style="color: #000066;">;</span>
    P <span style="color: #000066;">:</span> TPoint<span style="color: #000066;">;</span>
  <span style="color: #000066;">...</span>
  <span style="color: #006600;">GetCursorPos</span><span style="color: #000066;">&#40;</span>P<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
&nbsp;
  hWindow <span style="color: #000066;">:</span><span style="color: #000066;">=</span> WindowFromPoint<span style="color: #000066;">&#40;</span>P<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></pre></div></div>

<p>Destul de simplu, nu ? În variabila <strong><code>hWindow</code></strong> avem acum handle-ul care ne interesează.<br />
Pentru a &#8220;vedea&#8221; în timp real ce fereastra e sub cursor, punem codul acesta într-un TTimer.</p>
<p>Să vedem cum afişăm informaţiile găsite, cum ar fi titlul ferestrei, clasa ferestrei (adică tipul componentei) şi handle-ul asociat părintelui ei, din TTimer. Pentru asta avem nevoie (în cazul acesta) de patru TEdit-uri.</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">Timer1Timer</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>
<span style="color: #000000; font-weight: bold;">var</span> hWindow  <span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Longint</span><span style="color: #000066;">;</span>
    P <span style="color: #000066;">:</span> TPoint<span style="color: #000066;">;</span>
    buff <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>255<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>
<span style="color: #000000; font-weight: bold;">begin</span>
  GetCursorPos<span style="color: #000066;">&#40;</span>P<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
&nbsp;
  hWindow <span style="color: #000066;">:</span><span style="color: #000066;">=</span> WindowFromPoint<span style="color: #000066;">&#40;</span>P<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
  Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #ff0000;">'$'</span> <span style="color: #000066;">+</span> <span style="color: #000066;">IntToHex</span><span style="color: #000066;">&#40;</span>hWindow<span style="color: #000066;">,</span> <span style="color: #0000ff;">8</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
&nbsp;
  GetWindowText<span style="color: #000066;">&#40;</span><span style="color: #000066;">StrToInt</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">,</span> Buff<span style="color: #000066;">,</span> <span style="color: #0000ff;">255</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
  Edit1<span style="color: #000066;">.</span><span style="color: #006600;">Text</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Buff<span style="color: #000066;">;</span>
&nbsp;
  GetClassName<span style="color: #000066;">&#40;</span><span style="color: #000066;">StrToInt</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">,</span> Buff<span style="color: #000066;">,</span> <span style="color: #0000ff;">255</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
  Edit3<span style="color: #000066;">.</span><span style="color: #006600;">Text</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Buff<span style="color: #000066;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">If</span> GetParent<span style="color: #000066;">&#40;</span><span style="color: #000066;">StrToInt</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">&#41;</span> &gt; <span style="color: #0000ff;">0</span>
    <span style="color: #000000; font-weight: bold;">then</span> Edit4<span style="color: #000066;">.</span><span style="color: #006600;">Text</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #ff0000;">'$'</span> <span style="color: #000066;">+</span> <span style="color: #000066;">IntToHex</span><span style="color: #000066;">&#40;</span>GetParent<span style="color: #000066;">&#40;</span><span style="color: #000066;">StrToInt</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">8</span><span style="color: #000066;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">else</span> Edit4<span style="color: #000066;">.</span><span style="color: #006600;">Text</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #ff0000;">'None'</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

<p><strong><code>GetWindowText</code></strong> returnează titlul ferestrei (sau textul din fereastră, dacă e vorba de un TEdit), <strong><code>GetClassName</code></strong> returnează tipul componentei, iar <strong><code>GetParent</code></strong> handle-ul părintelui. Simplu, nu ? <img src="http://www.aberez.eu/wp-content/plugins/yahoo-messenger-emoticons/emoticons/happy.gif" style="border:none;background:none;" alt="happy" /></p>
<p>Păcat că momentan tot ce aflăm sunt lucruri destul de puţin importante şi deloc atrăgătoare. Nişte numere şi ceva text care oricum se vedea şi fără un asemenea program. Să încercăm ceva mai atrăgător.</p>
<p>Pentru început vom ascunde / reafişa fereastra, apelând funcţia <strong><code>ShowWindow</code></strong>, care are nevoie de doi parametri: handle-ul ferestrei şi un parametru care specifică dacă vrem să afişăm sau să ascundem fereastra.</p>
<p>Afişare fereastră:</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">ShowWindow<span style="color: #000066;">&#40;</span>wHandle<span style="color: #000066;">,</span> SW_SHOW<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></pre></div></div>

<p>Ascundere fereastră:</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">ShowWindow<span style="color: #000066;">&#40;</span>wHandle<span style="color: #000066;">,</span> SW_HIDE<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></pre></div></div>

<p>Alt lucru care-l putem face : vom seta ca fereastra selectată să devină fereastră de top-level şi înapoi. Pentru acest lucru vom folosi funcţia <strong><code>SetWindowPos</code></strong> pentru a ne defini o procedură apelabilă cu un parametru de tip <strong><code>Boolean</code></strong> care să ştie modifica stilul ferestrei în ambele moduri, al doilea parametru fiind handle-ul ferestrei care vrem s-o modificăm.</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">procedure</span> SetTop<span style="color: #000066;">&#40;</span>Top <span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Boolean</span><span style="color: #000066;">;</span> Handle <span style="color: #000066;">:</span> HWnd<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">Begin</span>
  <span style="color: #000000; font-weight: bold;">If</span> Top
    <span style="color: #000000; font-weight: bold;">Then</span>
      <span style="color: #000000; font-weight: bold;">Begin</span>
        SetWindowPos<span style="color: #000066;">&#40;</span>Handle<span style="color: #000066;">,</span> HWND_TOPMOST<span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span>
                     SWP_SHOWWINDOW <span style="color: #000066;">+</span> SWP_NOMOVE <span style="color: #000066;">+</span> SWP_NOSIZE<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
        SetWindowPos<span style="color: #000066;">&#40;</span>Handle<span style="color: #000066;">,</span> HWND_TOP<span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span>
                     SWP_SHOWWINDOW <span style="color: #000066;">+</span> SWP_NOMOVE <span style="color: #000066;">+</span> SWP_NOSIZE<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
      <span style="color: #000000; font-weight: bold;">End</span>
    <span style="color: #000000; font-weight: bold;">Else</span> SetWindowPos<span style="color: #000066;">&#40;</span>Handle<span style="color: #000066;">,</span> HWND_NOTOPMOST<span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">,</span>
                      SWP_SHOWWINDOW <span style="color: #000066;">+</span> SWP_NOMOVE <span style="color: #000066;">+</span> SWP_NOSIZE<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">End</span><span style="color: #000066;">;</span></pre></div></div>

<p>Acum nu mai avem decât să apelăm procedura asta din butonul corespunzător.</p>
<p>Ştiind handle-ul ferestrei, o putem şi activa / dezactiva folosind <strong><code>EnableWindow</code></strong>, care necesită specificarea handle-ului ferestrei şi un parametru logic care determină activarea / dezactivarea ei.</p>
<p>Codul pentru cele şase butoane de până acum:</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">bShowClick</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>
<span style="color: #000000; font-weight: bold;">begin</span>
  hWindow <span style="color: #000066;">:</span><span style="color: #000066;">=</span> HexToInt<span style="color: #000066;">&#40;</span><span style="color: #000066;">Copy</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">2</span><span style="color: #000066;">,</span> <span style="color: #000066;">Length</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><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;">&#41;</span><span style="color: #000066;">;</span>
  ShowWindow<span style="color: #000066;">&#40;</span>hWindow<span style="color: #000066;">,</span> SW_SHOW<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">bHideClick</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>
<span style="color: #000000; font-weight: bold;">begin</span>
  hWindow <span style="color: #000066;">:</span><span style="color: #000066;">=</span> HexToInt<span style="color: #000066;">&#40;</span><span style="color: #000066;">Copy</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">2</span><span style="color: #000066;">,</span> <span style="color: #000066;">Length</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><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;">&#41;</span><span style="color: #000066;">;</span>
  ShowWindow<span style="color: #000066;">&#40;</span>hWindow<span style="color: #000066;">,</span> SW_HIDE<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">bTopClick</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>
<span style="color: #000000; font-weight: bold;">begin</span>
  hWindow <span style="color: #000066;">:</span><span style="color: #000066;">=</span> HexToInt<span style="color: #000066;">&#40;</span><span style="color: #000066;">Copy</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">2</span><span style="color: #000066;">,</span> <span style="color: #000066;">Length</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><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;">&#41;</span><span style="color: #000066;">;</span>
  SetTop<span style="color: #000066;">&#40;</span><span style="color: #000000; font-weight: bold;">True</span><span style="color: #000066;">,</span> hWindow<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">bPotClick</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>
<span style="color: #000000; font-weight: bold;">begin</span>
  hWindow <span style="color: #000066;">:</span><span style="color: #000066;">=</span> HexToInt<span style="color: #000066;">&#40;</span><span style="color: #000066;">Copy</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">2</span><span style="color: #000066;">,</span> <span style="color: #000066;">Length</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><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;">&#41;</span><span style="color: #000066;">;</span>
  SetTop<span style="color: #000066;">&#40;</span><span style="color: #000000; font-weight: bold;">False</span><span style="color: #000066;">,</span> hWindow<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">bEnableClick</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>
<span style="color: #000000; font-weight: bold;">begin</span>
  hWindow <span style="color: #000066;">:</span><span style="color: #000066;">=</span> HexToInt<span style="color: #000066;">&#40;</span><span style="color: #000066;">Copy</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">2</span><span style="color: #000066;">,</span> <span style="color: #000066;">Length</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><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;">&#41;</span><span style="color: #000066;">;</span>
  EnableWindow<span style="color: #000066;">&#40;</span>hWindow<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>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">bDisableClick</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>
<span style="color: #000000; font-weight: bold;">begin</span>
  hWindow <span style="color: #000066;">:</span><span style="color: #000066;">=</span> HexToInt<span style="color: #000066;">&#40;</span><span style="color: #000066;">Copy</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">2</span><span style="color: #000066;">,</span> <span style="color: #000066;">Length</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><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;">&#41;</span><span style="color: #000066;">;</span>
  EnableWindow<span style="color: #000066;">&#40;</span>hWindow<span style="color: #000066;">,</span> <span style="color: #000000; font-weight: bold;">False</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

<p>Probabil că aţi remarcat linia</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">hWindow <span style="color: #000066;">:</span><span style="color: #000066;">=</span> HexToInt<span style="color: #000066;">&#40;</span><span style="color: #000066;">Copy</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">,</span> <span style="color: #0000ff;">2</span><span style="color: #000066;">,</span> <span style="color: #000066;">Length</span><span style="color: #000066;">&#40;</span>Edit2<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><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;">&#41;</span><span style="color: #000066;">;</span></pre></div></div>

<p>, despre care nu am scos nici un cuvânt până acum. Este inversa funcţiei <strong><code>IntToHex</code></strong> din Delphi, şi este definită mai jos.</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> HexToInt<span style="color: #000066;">&#40;</span>S <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;">Longint</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">var</span> B <span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Byte</span><span style="color: #000066;">;</span>
    C <span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Char</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">Begin</span>
  Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">;</span>
  s <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066;">UpperCase</span><span style="color: #000066;">&#40;</span>s<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
  <span style="color: #000000; font-weight: bold;">For</span> B <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>s<span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">Do</span>
    <span style="color: #000000; font-weight: bold;">Begin</span>
      Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Result <span style="color: #000066;">*</span> <span style="color: #0000ff;">16</span><span style="color: #000066;">;</span>
      c <span style="color: #000066;">:</span><span style="color: #000066;">=</span> S<span style="color: #000066;">&#91;</span>B<span style="color: #000066;">&#93;</span><span style="color: #000066;">;</span>
      <span style="color: #000000; font-weight: bold;">Case</span> c <span style="color: #000000; font-weight: bold;">Of</span>
        <span style="color: #ff0000;">'0'</span><span style="color: #000066;">..</span><span style="color: #ff0000;">'9'</span><span style="color: #000066;">:</span> <span style="color: #000066;">Inc</span><span style="color: #000066;">&#40;</span>Result<span style="color: #000066;">,</span> <span style="color: #000066;">Ord</span><span style="color: #000066;">&#40;</span>c<span style="color: #000066;">&#41;</span> <span style="color: #000066;">-</span> <span style="color: #000066;">Ord</span><span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'0'</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
        <span style="color: #ff0000;">'A'</span><span style="color: #000066;">..</span><span style="color: #ff0000;">'F'</span><span style="color: #000066;">:</span> <span style="color: #000066;">Inc</span><span style="color: #000066;">&#40;</span>Result<span style="color: #000066;">,</span> <span style="color: #000066;">Ord</span><span style="color: #000066;">&#40;</span>c<span style="color: #000066;">&#41;</span> <span style="color: #000066;">-</span> <span style="color: #000066;">Ord</span><span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'A'</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">+</span> <span style="color: #0000ff;">10</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
        <span style="color: #000000; font-weight: bold;">Else</span>
          <span style="color: #000000; font-weight: bold;">Begin</span>
            Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">;</span>
            <span style="color: #000066;">Exit</span><span style="color: #000066;">;</span>
          <span style="color: #000000; font-weight: bold;">End</span><span style="color: #000066;">;</span>
      <span style="color: #000000; font-weight: bold;">End</span><span style="color: #000066;">;</span>
    <span style="color: #000000; font-weight: bold;">End</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">End</span><span style="color: #000066;">;</span></pre></div></div>

<p>Puteam folosi variabila <strong><code>hWindow</code></strong> ca variabilă globală şi atunci scăpam de nevoia folosirii acestei funcţii, nu ? Dar ce se întâmpla dacă la utilizarea programului se voia reafişarea unei ferestre căreia îi ştim handle-ul ? În acest fel tot ce avem de făcut este editarea celei de-a doua căsuţe text cu handle-ul respectiv şi putem face orice, altfel putând lucra doar cu ferestrele vizibile pe ecran.</p>
<p>Cam acesta ar fi codul necesar pentru o mini-aplicaţie de lucru cu ferestrele &#8230; dar stai &#8230; e o problemă &#8230; dacă verificarea ferestrei de sub mouse se face în timp real, înseamnă că &#8230; da, dacă selectez butonul de &#8220;ascundere fereastră&#8221;, îmi va ascunde tocmai respectivul buton. Damn, nu e bine.</p>
<p>Trebuie să programăm o metodă de a opri scanarea ferestrelor în timp real, o dată ce am selectat fereastra cu care vrem să lucrăm, fără să mişcăm mouse-ul. Pentru asta ne vom defini o combinaţie de taste globală, folosind funcţia <strong><code>RegisterHotKey</code></strong>, care primeşte patru parametri: handle-ul ferestrei căreia să-i trimită mesaj în caz că s-a apăsat combinaţia noastră de taste, un identificator pentru combinaţie, definit de noi, şi combinaţia de taste, definită prin doi parametri &#8211; primul, care defineşte dacă tastele CTRL, ALT, SHIFT sau WIN sunt apăsate, şi al doilea, care defineşte o tastă normală (cum ar fi &#8220;R&#8221; ). Apelul funcţiei, pentru a ne defini combinaţia CTRL + F8, este :</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">const</span> StopKey <span style="color: #000066;">=</span> <span style="color: #0000ff;">100000</span><span style="color: #000066;">;</span>
  <span style="color: #000066;">...</span>
  <span style="color: #006600;">RegisterHotKey</span><span style="color: #000066;">&#40;</span>Handle<span style="color: #000066;">,</span> StopKey<span style="color: #000066;">,</span> MOD_CONTROL<span style="color: #000066;">,</span> VK_F8<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></pre></div></div>

<p>Această linie trebuie apelată chiar la începutul rulării programului, în <strong><code>FormCreate</code></strong>.<br />
<strong>Atenţie</strong> : <strong><code>StopKey</code></strong> este o constantă ce trebuie definită global, înaintea secţiunii <strong><code>implementation</code></strong>.</p>
<p>Pentru a fi anunţaţi când este apăsată combinaţia noastră de taste ne vom defini o procedură care să primească mesajul trimis de sistem, interceptând mesajul <strong><code>WM_HOTKEY</code></strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">type</span>
  TForm1 <span style="color: #000066;">=</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #000066;">&#40;</span>TForm<span style="color: #000066;">&#41;</span>
  <span style="color: #000066;">...</span>
  <span style="color: #000000; font-weight: bold;">private</span>
    <span style="color: #808080; font-style: italic;">{ Private declarations }</span>
    <span style="color: #000000; font-weight: bold;">procedure</span> WMHotKey<span style="color: #000066;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> Message<span style="color: #000066;">:</span> TMessage<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span> message WM_HOTKEY<span style="color: #000066;">;</span>
 <span style="color: #000066;">...</span></pre></div></div>

<p>Codul procedurii :</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">procedure</span> TForm1<span style="color: #000066;">.</span><span style="color: #006600;">WMHotKey</span><span style="color: #000066;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> Message<span style="color: #000066;">:</span> TMessage<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">begin</span>
  <span style="color: #000000; font-weight: bold;">If</span> Message<span style="color: #000066;">.</span><span style="color: #006600;">WParam</span> <span style="color: #000066;">=</span> StopKey
    <span style="color: #000000; font-weight: bold;">Then</span> Timer1<span style="color: #000066;">.</span><span style="color: #006600;">Enabled</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000000; font-weight: bold;">not</span> Timer1<span style="color: #000066;">.</span><span style="color: #006600;">Enabled</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

<p>Practic, la fiecare apăsare a combinaţiei, TTimer-ul nostru se va opri / reporni. Pentru a nu lăsa mizerie după rularea programului, va trebui să distrugem această combinaţie de taste la oprire. Pentru acest lucru, în <strong><code>FormCloseQuery</code></strong> vom apela :</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">  UnregisterHotKey<span style="color: #000066;">&#40;</span>Handle<span style="color: #000066;">,</span> StopKey<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></pre></div></div>

<p>Cam asta ar fi tot codul.</p>
<p>Pentru a nu vă pune să lucraţi cu copy / paste şi să vă faceţi griji de componente şi asignări de evenimente, aveţi mai jos sursele şi executabilul arhivate.</p>
<p>Download : <a href="http://www.aberez.eu/codes/window_spy_src.zip">Sursa</a> :: <a href="http://www.aberez.eu/codes/window_spy_exe.zip">Executabil</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aberez.eu/2008/07/window-spy/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

