<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3616334587671578703</id><updated>2012-02-15T22:45:00.672-08:00</updated><category term='Win32'/><category term='Thoughts and Opinions'/><category term='Events'/><category term='Politics'/><title type='text'>Bahaa Zaid's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bahaazaid.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bahaazaid.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Bahaa Zaid</name><uri>http://www.blogger.com/profile/07779465426935521006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://1.bp.blogspot.com/_CnaDIIc7zqY/SZmsU2yOnpI/AAAAAAAAABw/KyJOHRFuJiM/S220/n664186554_1373057_4016.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3616334587671578703.post-3309405511294793540</id><published>2010-01-05T14:00:00.000-08:00</published><updated>2010-01-11T17:26:33.747-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Politics'/><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts and Opinions'/><title type='text'>آرائي الشخصية فى أصل الوطنية</title><content type='html'>&lt;span class="Apple-style-span" style=";font-family:Verdana;font-size:13px;"  &gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl; text-align: right;"&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl; text-align: right;"&gt;اعتادت النفس البشرية على نسيان أصل الأشياء، فمثلًا يعتقد عوام المصريين أن الغاية الأصلية التى اُخترع من أجلها التعليم هى الحصول على الدرجات العلمية من أجل أغراض اجتماعية، ولكني أعتقد أن التعليم اُخترع من أجل زراعة العلم فى عقول الأفراد، وأن الدرجات العلمية موجودة بالأساس كأدوات إدارية وتنظيمية، ولكنها تحولت فى نهاية الأمر إلى أصل الشيء والهدف الأساسي منه.&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl; text-align: right;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl; text-align: right;"&gt;وأنا هنا أريد أن أتحدث عن أصل الوطنية، ولماذا يكون الوطنيون وطنيين. وأنا اعتقد أن أصل الوطنية لدى إنسان هذا العصر، عصر الجماهير الغفيرة، قد تزحزح. وأصبح من غير المفهوم، أو من المفهوم خطأً، لماذا نحب أوطاننا. وأصبحت الوطنية مجرد موروث ثقافي، تمامًا مثل اللغة والعادات.&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl; text-align: right;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl; text-align: right;"&gt;ولنبدأ ببعض الأمثلة للأسباب التى يذكرها المصريون عن سبب وطنيتهم: &lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl; text-align: right;"&gt;&lt;ul style="margin-top: 0px; margin-bottom: 0px;"&gt;&lt;li style="margin-top: 0px; margin-bottom: 0px;"&gt;مصر ذكرت فى القرآن أكثر من مرة. إذا لماذا مسيحيُ مصر وطنيون؟ مع ملاحظة أن إسرائيل ذكرت فى القرآن أكثر من مصر، وفرعون أكثر من محمد (صلى الله عليه وسلم)، والجنة أكثر من النار.&lt;/li&gt;&lt;li style="margin-top: 0px; margin-bottom: 0px;"&gt;مصر تاريخها عظيم، وقدمائها أبدعوا وبهروا العالم. لو كان هذا هو السبب، إذًا فلماذا الوطنيون الأفريقيون (لا أقصد الإهانة) وطنيون؟ ولماذا اختار كل الوطنيين المصريين مصر لعظم تاريخها ولم يختاروا دولًا أخرى تنافسنا في ثراء تاريخها كالصين أو اليونان أو إيطاليا؟&lt;/li&gt;&lt;li style="margin-top: 0px; margin-bottom: 0px;"&gt;مصر جغرافيًا موقعها مميز، وفيها كثير من المزايا الجغرافية والثروات التي يطمع فيها الغزاة. لو كان هذا هو سبب الوطنية، لذهب كثير من الوطنيين المصريين إلى بلاد أخرى موقعها أكثر تميزا مثل تركيا، أو عندها ثروات أكثر مثل البرازيل.&lt;/li&gt;&lt;li style="margin-top: 0px; margin-bottom: 0px;"&gt;مصر ولدنا وتربينا فيها، ونمت أبداننا على خيراتها، وتنورت عقولنا بتعليمها. وهذا أيضا ليس بسبب منطقي، لأن كثير من الوطنيين المصريين ولدوا وتربوا فى دول غير مصر. وكثير منهم نمت أجسامهم وأجسام أسرهم على خيرات دول أخرى (كدول الخليج). وكثير منهم تعلموا خارج مصر، تعليما يفوق نظيره المصري جودة وتأثيرًا.&lt;/li&gt;&lt;/ul&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;&lt;b&gt;إذا لماذا الوطنيون وطنيون؟:&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;أنا أعتقد أن معظم الوطنيين وطنيين لأنهم ورثوا هذه الوطنية مع ما ورثوه من ثقافة مثل اللغة والذوق الموسيقى، وطريقة إرتداء الملابس، وعادات الزواج... إلخ. هم وطنيون لأنهم يجب أن يكونوا وطنيين. هم وطنيون لأن عواطفهم تحثهم على ذلك، ليس لأن عقولهم أقنعتهم بذلك. &lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;&lt;b&gt;فما هو أصل الوطنية؟:&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;اعتقادى الشخصي أن الوطنية بدأت فى العقل قبل أن تبدأ فى القلب. لقد وجد الإنسان أن من مصلحته أن يوحده هو ومن يشبهونه فى الثقافة العامة وطن. هذا الوطن هو عبارة عن شركة أنشأها المواطنون (العقد الإجتماعي) من أجل تحقيق الأهداف المشتركة لكل المساهمين فى الشركة. ومن ثم أحب الناس أوطانهم مثلما يحب المساهم شركته التى تدر عليه الربح.&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;ولهذا فأنا أعتقد أن الوطنية مشتقة من المواطنين وليست مشتقة من الوطن. هؤلاء المواطنون هم شركائى فى الشركة (الوطن) وتربطني بهم مصالح مشتركة فى هذا الوطن (باستثناء بعضهم الذين تربطني بهم روابط عاطفية كأسرتى وأصدقائي). هؤلاء المواطنون انجازاتهم ستؤثر على حياتى وأستطيع أن أتفاخر بها. هؤلاء المواطنون أستطيع العيش بينهم بسهولة نظرًا لوجود الثقافة المشتركة بيننا. هؤلاء المواطنون لن يكونوا سبب تعاستى، ولن يعكروا صفو حياتي (مثلما يحدث فى الطوابير أو على الطريق أثناء القيادة).&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;&lt;b&gt;وما يفيدنا من إرجاع الوطنية إلى أصلها:&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;إرجاع الوطنية إلى أصلها يجعل المواطن يكتشف أنه شريك (مادى وليس معنوي فقط) فى هذه الشركة، وعليه أن يحصل على نصيبه من الأرباح (حقوقه فى الوطن)، وأن يشارك في إدارة هذه الشركة بطريقة مباشرة عن طريق الترشح للإنتخابات، أو غير مباشرة عن طريق التصويت فى الانتخابات لمن يرى أنهم سيديرون الشركة (الوطن) بأفضل شكل.&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl;"&gt;قد يرى البعض أن من مصلحته أن يترك هذه الشركة إذا كانت لا تدر له ربحا وتعرضه للخسائر، وهذا حقه، لكن يجب أن يعلم أنه ليس من اليسير أن تقبله شركة أخرى (وطن آخر) كمساهم كامل (يتمتع بكامل حقوق المواطنين فى هذا الوطن الآخر المادية والمعنوية). وإن استطاع، فليفعل هذا كما فعل المهاجرين القدامى للعالم القديم قبل أن تغلق الشركة باب الاقتراع. وإن لم يستطع (وهذا هو الأغلب) فليس أمامه إلا أنا يطالب بحقوقة فى أرباح الشركة، وألا يسمح لأحد بأن يستبد بحقه فيها، ويجب أن يعمل على تحويلها إلى شركة رابحة مثل أكبر الشركات الناجحة (كبيرة الأرباح) فى هذا العالم.&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl; text-align: right;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; direction: rtl; text-align: right;"&gt;ولهذا فأنا أظن أن الوطنية بدأت كمفهوم ذرائعي (براجماتي)، وإن لم نرجعها إلى أصلها فسنظل ننشد الأغانى الوطنية ونتكلم عن حبنا لوطننا إلى الأبد، دون أن نفعل أي شيء مفيد له (أو بالأحرى لأنفسنا).&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3616334587671578703-3309405511294793540?l=bahaazaid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahaazaid.blogspot.com/feeds/3309405511294793540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3616334587671578703&amp;postID=3309405511294793540' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/3309405511294793540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/3309405511294793540'/><link rel='alternate' type='text/html' href='http://bahaazaid.blogspot.com/2010/01/blog-post.html' title='آرائي الشخصية فى أصل الوطنية'/><author><name>Bahaa Zaid</name><uri>http://www.blogger.com/profile/07779465426935521006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://1.bp.blogspot.com/_CnaDIIc7zqY/SZmsU2yOnpI/AAAAAAAAABw/KyJOHRFuJiM/S220/n664186554_1373057_4016.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3616334587671578703.post-4718488949230034742</id><published>2009-03-20T13:24:00.001-07:00</published><updated>2009-03-20T13:24:01.873-07:00</updated><title type='text'>Security via Java Presentation</title><content type='html'>&lt;p&gt;On Fri 2008-01-16 I made a presentation for my work parteners in &lt;a href="http://arxict.com"&gt;Arx ICT&lt;/a&gt; about Security and its usage in Java. &lt;/p&gt;  &lt;p&gt;The presentation starts by giving a very briefed and comprehensive introduction to General Security Concepts (Theory).&lt;/p&gt;  &lt;p&gt;The presentation contains many common code snippets. These code snippets are very useful, they will help you in most security aware programs.&lt;/p&gt;  &lt;p&gt;You can download the presentation &lt;a href="http://bahaazaid.110mb.com/files/security-bzaid-2009-01-13.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;iframe src="http://docs.google.com/EmbedSlideshow?docid=d38rrh4_8f3wb2bdx" frameborder="0" width="410" height="342"&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3616334587671578703-4718488949230034742?l=bahaazaid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahaazaid.blogspot.com/feeds/4718488949230034742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3616334587671578703&amp;postID=4718488949230034742' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/4718488949230034742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/4718488949230034742'/><link rel='alternate' type='text/html' href='http://bahaazaid.blogspot.com/2009/03/security-via-java-presentation.html' title='Security via Java Presentation'/><author><name>Bahaa Zaid</name><uri>http://www.blogger.com/profile/07779465426935521006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://1.bp.blogspot.com/_CnaDIIc7zqY/SZmsU2yOnpI/AAAAAAAAABw/KyJOHRFuJiM/S220/n664186554_1373057_4016.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3616334587671578703.post-7574373598837849183</id><published>2009-01-01T03:23:00.001-08:00</published><updated>2009-01-01T03:27:29.635-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Politics'/><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts and Opinions'/><title type='text'>Gaza and Egypt’s National Security</title><content type='html'>&lt;p&gt;In 1979 Egypt and Israel had signed a peace treaty (&lt;a href="http://en.wikipedia.org/wiki/Israel-Egypt_Peace_Treaty"&gt;Egyptian–Israeli Peace Treaty&lt;/a&gt;). After that both Israel and Egypt’s government are trying to normalize the relationships between the two neighbors. So, for us, Israel is supposed to be a friend state.&lt;/p&gt;  &lt;p&gt;The Egyptian–Israeli Peace Treaty does not mean that Israel is not still the biggest threat to Egypt’s &lt;a href="http://en.wikipedia.org/wiki/National_security"&gt;National Security&lt;/a&gt;. I have no problems with Jews, but I have a big problem with a neighbor who have nuclear weapons near our borders and ruled by the rightist extremists in the world.&lt;/p&gt;  &lt;p&gt;In brief, Israel has the best weapons in the middle east, we and Israel are in an endless ideological conflict and Israel is ruled by extremists and Israeli people themselves are extremists and support their government’s politics.&lt;/p&gt;  &lt;p&gt;So, Israel is the biggest threat to Egypt’s National Security however Egypt and Israel have signed a Peace Treaty.&lt;/p&gt;  &lt;p&gt;As a consequence of being a thread, Egypt should support Israel’s enemies. We should do our best to make Israel weaker. At least, secretly Egypt should give Hamas Physical and Logistic support. Not because we and Hamas are friends, but because Hamas is Israel’s biggest enemy.&lt;/p&gt;  &lt;p&gt;Egypt should always respect the peace treaty, we never call for war, but that does not mean that Egypt and Israel are in a cold war.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3616334587671578703-7574373598837849183?l=bahaazaid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahaazaid.blogspot.com/feeds/7574373598837849183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3616334587671578703&amp;postID=7574373598837849183' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/7574373598837849183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/7574373598837849183'/><link rel='alternate' type='text/html' href='http://bahaazaid.blogspot.com/2009/01/gaza-and-egypts-national-security.html' title='Gaza and Egypt’s National Security'/><author><name>Bahaa Zaid</name><uri>http://www.blogger.com/profile/07779465426935521006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://1.bp.blogspot.com/_CnaDIIc7zqY/SZmsU2yOnpI/AAAAAAAAABw/KyJOHRFuJiM/S220/n664186554_1373057_4016.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3616334587671578703.post-4837265241952066318</id><published>2008-05-08T15:17:00.001-07:00</published><updated>2008-05-08T15:30:36.722-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><title type='text'>My first attempt to build Mozilla Firefox</title><content type='html'>&lt;p&gt;Today, 2008-05-08, I tried to build &lt;a href="http://www.mozilla.org/"&gt;Mozilla&lt;/a&gt; &lt;a href="http://www.mozilla.com/en-US/firefox/"&gt;Firefox&lt;/a&gt;. I started by downloading &lt;a href="http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.2.exe"&gt;Mozilla build&lt;/a&gt; system. Then I &lt;a href="http://developer.mozilla.org/en/docs/Mozilla_Source_Code_(CVS)"&gt;checked all Mozilla trunk out&lt;/a&gt;. I followed the instructions on &lt;a href="http://developer.mozilla.org/en/docs/Build_and_Install"&gt;how to build it&lt;/a&gt;. It was so easy.&lt;/p&gt;  &lt;p&gt;The build process went ok with no problems. Now, I use Mozilla Firefox that I have built.&lt;/p&gt;  &lt;p&gt;Mozilla Firefox build process is much easier and straightforward than &lt;a href="http://webkit.org/"&gt;WebKit&lt;/a&gt;&amp;#160; build process. Few days ago, I tried to build WebKit. The build was successful but after more than one attempt.&lt;/p&gt;  &lt;p&gt;Now, I can start &lt;a href="http://www.mozilla.org/hacking/"&gt;hacking&lt;/a&gt; Mozilla codebase. After that, I will try to submit &lt;a href="http://www.mozilla.org/hacking/life-cycle.html"&gt;patches&lt;/a&gt; for &lt;a href="http://www.mozilla.org/hacking/code-review-faq.html"&gt;review&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I wish I become a Mozilla &lt;a href="http://www.mozilla.org/hacking/getting-cvs-write-access.html"&gt;committer&lt;/a&gt; someday. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3616334587671578703-4837265241952066318?l=bahaazaid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahaazaid.blogspot.com/feeds/4837265241952066318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3616334587671578703&amp;postID=4837265241952066318' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/4837265241952066318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/4837265241952066318'/><link rel='alternate' type='text/html' href='http://bahaazaid.blogspot.com/2008/05/my-first-attempt-to-build-mozilla.html' title='My first attempt to build Mozilla Firefox'/><author><name>Bahaa Zaid</name><uri>http://www.blogger.com/profile/07779465426935521006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://1.bp.blogspot.com/_CnaDIIc7zqY/SZmsU2yOnpI/AAAAAAAAABw/KyJOHRFuJiM/S220/n664186554_1373057_4016.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3616334587671578703.post-8406500425912266467</id><published>2008-05-06T00:10:00.001-07:00</published><updated>2008-05-06T06:49:07.927-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Win32'/><title type='text'>How to make a non-rectangular window?</title><content type='html'>&lt;p&gt;In this post I will show how to make a non-rectangular window on Windows 2000 and later (including Windows XP and Vista) . I will use C programming language and Win32 API.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/bahaazaid/SCAEehqo-KI/AAAAAAAAABQ/BhFwEUz2Fkk/s1600-h/coolwnd7.png"&gt;&lt;img height="213" alt="coolwnd" src="http://lh3.ggpht.com/bahaazaid/SCAEfhqo-LI/AAAAAAAAABY/FwuMuU748MI/coolwnd_thumb5.png?imgmax=800" width="397" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;There are two ways to make a non-rectangular window in Win32:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Using &lt;code&gt;SetWindowRgn.&lt;/code&gt; &lt;/li&gt;    &lt;li&gt;Using Layered Windows. &lt;/li&gt; &lt;/ol&gt;  &lt;h3&gt;1. Using &lt;code&gt;SetWindowRgn&lt;/code&gt;:&lt;/h3&gt;  &lt;p&gt;This way works on earlier versions of Windows including Windows 98/ME. To make a non-rectangular window:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Prepare an HRGN object with the desired shape. &lt;/li&gt;    &lt;li&gt;Call &lt;code&gt;SetWindowRgn&lt;/code&gt; function on the &lt;code&gt;HWND&lt;/code&gt; of your window passing it the HRGN. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;This method has the advantage of running on older versions of windows. But, it's more complex than the second method, and if you try to create a region from an image it will be a little complex.&lt;/p&gt;  &lt;h3&gt;2. Using Layered Windows:&lt;/h3&gt;  &lt;p&gt;This way requires Windows 2000 or later. It's the recommended way. It's more efficient, flexible and easier.&lt;/p&gt;  &lt;p&gt;Layered windows improves the performance of windows that have complex shapes. You can specify a color to be the transparent color of your window. You can also specify the alpha blending value of the entire window, so you can make semi-transparent windows.&lt;/p&gt;  &lt;p&gt;To make a non-rectangular windows using Layered Windows do the following:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Prepare a bitmap to represent the window shape using any photo editor. In this bitmap choose a color to be the transparent color in your window. For example, you can make a bitmap with white background (if you won't use the white color in your window) and then draw your window on that background. If you want to make holes in your window, make this holes in the background color. &lt;/li&gt;    &lt;li&gt;Specify the &lt;code&gt;WS_EX_LAYERED&lt;/code&gt; extended window style when calling the &lt;code&gt;CreateWindowEx&lt;/code&gt; function, or call the &lt;code&gt;SetWindowLong&lt;/code&gt; function to set &lt;code&gt;WS_EX_LAYERED&lt;/code&gt; after the window has been created.       &lt;pre class="code"&gt;hWnd = CreateWindowEx(&lt;br /&gt;        &lt;strong&gt;WS_EX_LAYERED&lt;/strong&gt;,&lt;br /&gt;        MAIN_WND_CLASS_NAME,&lt;br /&gt;        TEXT(&lt;span style="color: #a31515"&gt;&amp;quot;Cool Window!&amp;quot;&lt;/span&gt;),&lt;br /&gt;        WS_POPUP | WS_MINIMIZEBOX,&lt;br /&gt;        CW_USEDEFAULT, CW_USEDEFAULT,&lt;br /&gt;        600, 300,&lt;br /&gt;        NULL,&lt;br /&gt;        NULL,&lt;br /&gt;        hInstance,&lt;br /&gt;        NULL);&lt;/pre&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Call &lt;code&gt;SetLayeredWindowAttributes&lt;/code&gt; on your window to specify the transparent color. Use the same color you used as the background color of the bitmap. &lt;br /&gt;&lt;br /&gt;    &lt;pre class="code"&gt;SetLayeredWindowAttributes(hWnd, RGB(255, 255, 255), 255, LWA_COLORKEY)&lt;/pre&gt;&lt;br /&gt;    &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Handle &lt;code&gt;WM_ERASEBKGND&lt;/code&gt; and &lt;code&gt;BitBlt&lt;/code&gt; the bitmap on the given &lt;code&gt;HDC&lt;/code&gt;. &lt;br /&gt;&lt;br /&gt;    &lt;pre class="code"&gt;BOOL OnEraseBackground(HDC hdc)&lt;br /&gt;{&lt;br /&gt;    HBITMAP hBitmap;&lt;br /&gt;    &lt;span style="color: blue"&gt;static &lt;/span&gt;HDC hMemDc = NULL;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: blue"&gt;if &lt;/span&gt;(NULL == hMemDc)&lt;br /&gt;    {&lt;br /&gt;        hBitmap = LoadBitmap(&lt;br /&gt;            GetModuleHandle(NULL), &lt;br /&gt;            MAKEINTRESOURCE(IDB_SKIN));&lt;br /&gt;    &lt;br /&gt;        &lt;span style="color: blue"&gt;if &lt;/span&gt;(!hBitmap)&lt;br /&gt;            &lt;span style="color: blue"&gt;return &lt;/span&gt;FALSE;&lt;br /&gt;&lt;br /&gt;        hMemDc = CreateCompatibleDC(hdc);&lt;br /&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt;(!hMemDc)&lt;br /&gt;            &lt;span style="color: blue"&gt;return &lt;/span&gt;FALSE;&lt;br /&gt;        &lt;br /&gt;        SelectObject(hMemDc, hBitmap);&lt;br /&gt;    }&lt;br /&gt;    BitBlt(hdc, &lt;br /&gt;        0, 0, 600, 300, &lt;br /&gt;        hMemDc, &lt;br /&gt;        0, 0, SRCCOPY);&lt;br /&gt;    &lt;br /&gt;    &lt;span style="color: blue"&gt;return &lt;/span&gt;TRUE;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Now any pixel in the background color (the color you specified using &lt;code&gt;SetLayeredWindowAttributes&lt;/code&gt;) will not be considered inside the window. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Sample Code:&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I made a simple sample you can download &lt;a href="http://www.geocities.com/bahaazaid/files/NonRectWnd.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If you can't download the sample, send me an e-mail at &lt;a href="mailto:bahaazaid@yahoo.com"&gt;bahaazaid@yahoo.com&lt;/a&gt;, I will send you the sample code.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Conclusion:&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Windows has so many powerful features that is impossible to make use of it without returning to its Win32 API.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In the future posts I will show how to make amazing window effects (e.g. Animations, Fadeout Effects...). I will try also to write Java classes that make use of these features to make that features available to Java programmers.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3616334587671578703-8406500425912266467?l=bahaazaid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahaazaid.blogspot.com/feeds/8406500425912266467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3616334587671578703&amp;postID=8406500425912266467' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/8406500425912266467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/8406500425912266467'/><link rel='alternate' type='text/html' href='http://bahaazaid.blogspot.com/2008/05/how-to-make-non-rectangular-window.html' title='How to make a non-rectangular window?'/><author><name>Bahaa Zaid</name><uri>http://www.blogger.com/profile/07779465426935521006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://1.bp.blogspot.com/_CnaDIIc7zqY/SZmsU2yOnpI/AAAAAAAAABw/KyJOHRFuJiM/S220/n664186554_1373057_4016.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/bahaazaid/SCAEfhqo-LI/AAAAAAAAABY/FwuMuU748MI/s72-c/coolwnd_thumb5.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3616334587671578703.post-9021100836599355885</id><published>2008-04-03T11:35:00.000-07:00</published><updated>2008-04-11T05:40:01.017-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts and Opinions'/><title type='text'>"Pure Java" is not Always an Advantage</title><content type='html'>&lt;p&gt;Many software products are proud of being "Pure Java". A "Pure Java" Software is the software that is %100 written in Java Code, it uses only Java Standard Library or another "Pure Java" Library.&lt;/p&gt;  &lt;p&gt;Being "Pure Java" has many advantages, for example:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;You guarantee that your software will run on any OS without recompilation&lt;/li&gt;    &lt;li&gt;The code is more clean, No JNI or native libraries.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;But, writing every thing in Java is not always good. For example, Swing is written in "Pure Java", so Swing and Swing Applications can be used on any Platform without modifications (at least in theory). But, I can't remember the name of a single real-life, serious successful Swing Application.&lt;/p&gt;  &lt;p&gt;Why? Ok, Some pieces of software need to be fast, responsive and use memory efficiently for example, GUI Rendering, DBMS Engines and their SQL Optimizers/Evaluators, 2D/3D Rendering/Composing Algorithms...etc.&lt;/p&gt;  &lt;p&gt;That explains why Eclipse SWT is more successful in real-life than Java's Swing.&lt;/p&gt;  &lt;p&gt;So, why some (many) people try to write a "Pure Java" DBMS (e.g. Derby/Java DB, HBSQL, Berkeley DB Java Edition, ...)? Why not to write a JDBC drivers for Native DBMS's? It is done already, and it is used seriously in many great real-life applications.&lt;/p&gt;  &lt;p&gt;At the end I want to say "If Java Core Services, Back-Ends, Processing Intensive Code, Memory Exhaustive Code... etc is written/rewritten in Native Code and Exposed to Java as Thin  Java Layer over that code. Java Applications will perform better (I think much better)". &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3616334587671578703-9021100836599355885?l=bahaazaid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahaazaid.blogspot.com/feeds/9021100836599355885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3616334587671578703&amp;postID=9021100836599355885' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/9021100836599355885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/9021100836599355885'/><link rel='alternate' type='text/html' href='http://bahaazaid.blogspot.com/2008/04/java-is-not-always-advantage.html' title='&amp;quot;Pure Java&amp;quot; is not Always an Advantage'/><author><name>Bahaa Zaid</name><uri>http://www.blogger.com/profile/07779465426935521006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://1.bp.blogspot.com/_CnaDIIc7zqY/SZmsU2yOnpI/AAAAAAAAABw/KyJOHRFuJiM/S220/n664186554_1373057_4016.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3616334587671578703.post-2315149516694014815</id><published>2008-04-02T03:21:00.001-07:00</published><updated>2008-04-11T05:41:19.651-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts and Opinions'/><title type='text'>Developers Benefit from Hardware Upgrades More Than Users</title><content type='html'>&lt;p&gt; &lt;/p&gt;  &lt;p&gt;I worked on two PCs at two different dates:&lt;/p&gt;  &lt;p&gt;1. The old one configurations is PIII 733 MHz Processor and 128 MB RAM in 2002.&lt;/p&gt;  &lt;p&gt;2. My PC at work configurations is P4 Core 2 Due 3.00 MHz Processor and 2.00 GB RAM in 2008.&lt;/p&gt;  &lt;p&gt;Suppose I want to run a web application in 2002, I used Microsoft IIS 6, and ASP.NET. The server and the application take less 5 seconds to run.&lt;/p&gt;  &lt;p&gt;To run the same application in 2008, I used JBoss Application Server and JSP. The server and the application take more than 10 seconds.&lt;/p&gt;  &lt;p&gt;Another Example, eclipse platform on 2008 hardware is slower than Microsoft Visual Studio 2002 .NET on 2002 Hardware.&lt;/p&gt;  &lt;p&gt;I don't want to say PIII is faster than P4 Core 2 Due. I want to say software (e.g. IIS) was written using more efficient but harder tools (e.g. C++).&lt;/p&gt;  &lt;p&gt;Today's Software is slower than Yesterday's Software without any new great added value to the user.&lt;/p&gt;  &lt;p&gt;Now software Development is easier but on the cost of user's hardware.&lt;/p&gt;  &lt;p&gt;I think from 2000 to now we didn't provide any fully new features to the end users. We just provide easier tools for the developer.&lt;/p&gt;  &lt;p&gt;Before 2000 we were introducing new fully new features to the users when the hardware allow that (e.g Switching from Console UI to GUI, Video Playback, 3D Games ... etc).&lt;/p&gt;  &lt;p&gt;Users don't take full benefits of his/her Hardware, Developers take that benefits.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3616334587671578703-2315149516694014815?l=bahaazaid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bahaazaid.blogspot.com/feeds/2315149516694014815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3616334587671578703&amp;postID=2315149516694014815' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/2315149516694014815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3616334587671578703/posts/default/2315149516694014815'/><link rel='alternate' type='text/html' href='http://bahaazaid.blogspot.com/2008/04/developers-benefit-from-hardware.html' title='Developers Benefit from Hardware Upgrades More Than Users'/><author><name>Bahaa Zaid</name><uri>http://www.blogger.com/profile/07779465426935521006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://1.bp.blogspot.com/_CnaDIIc7zqY/SZmsU2yOnpI/AAAAAAAAABw/KyJOHRFuJiM/S220/n664186554_1373057_4016.jpg'/></author><thr:total>0</thr:total></entry></feed>
