tag:blogger.com,1999:blog-194175712024-02-20T20:09:59.072+02:00I am just a DelphiGeek!All about Delphi and everything that regards to it.iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.comBlogger30125tag:blogger.com,1999:blog-19417571.post-70276979593093357412007-05-04T10:18:00.001+03:002007-06-11T17:46:44.110+03:00Delphi 2007 - how to install packages and components<p>Hello. As I see in my statistics one of my old posts, <a href="http://delphigeek.blogspot.com/2005/12/creating-new-component-package-in.html">Creating a new component package in Delphi 2005 (Win32)</a>, is very popular. Also I have notice that with appearing of Delphi 2007 for Win32 Steve Trefethen wrote a very nice tutorial which shows <a href="http://www.stevetrefethen.com/blog/HowToInstallComponentsInTheDelphiIDE.aspx">How to Install Components in the Delphi IDE</a> and Nick Hodges made a <a title="Installing a Component into Delphi 2007" href="http://blogs.codegear.com/nickhodges/archive/2007/05/03/34317.aspx">great streemcast</a> on the same topic. Now this theme is fully uncovered!</p> <p>Come again!</p>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com6tag:blogger.com,1999:blog-19417571.post-35343474861120172282007-04-27T14:38:00.001+03:002007-05-04T10:44:48.096+03:00Subversion, Continuous Integration<p>Hello all! As I was saying in one of <a title="The Returning" href="http://delphigeek.blogspot.com/2007/04/returning.html">my previous</a> posts, I am going to write some articles about Continuous Integration, Subversion (SVN) and other related things. But looking on some circumstance I decided not to write about those things (well, however I'll write some short notes). The reasons are pretty simple - few guys already started to write on this topics (<a href="http://memyselfanddelphi.blogspot.com/2007/04/delphi-2007-in-radical-build-part-1.html">here</a> and <a href="http://www.stevetrefethen.com/blog/">here</a>). They are much stronger in English than me and more advanced in this field. That's why I decided to make way for them. And therewith I don't like to clone blog posts.</p> <p>PS: don't forget to read a very good <a href="http://svnbook.red-bean.com/index.en.html">book</a> about Subversion. There is also a Russian version of this book.</p> <p>Come again!</p> <p><font size="1">-- 4/05/2007 - New useful link </font><br><a href="http://www.dummzeuch.de/delphi/subversion/english.html" target="_blank">Delphi and SubVersion</a></p>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-89375666734693400662007-04-24T11:33:00.003+03:002007-04-24T11:36:10.484+03:00Problems with ASP.NET debugging in BDS 2006<p>Hello people! Today I want to talk about annoying things that occurs when you try to debug ASP.NET applications in Delphi 2006.</p> <p>At first small prelude. Most of you are probably like me first install all necessary applications on just installed Windows Xp and only after this remember that IIS supposed to be installed before .NET framework has been installed because if you install IIS after the .NET Framework then ASP.NET will not be registered properly in IIS and you will have some problems with ASP.NET.</p> <p>In order to solve this issue you should do the following:</p> <ul> <li>Start console and browse to the "<em>C:\WINDOWS\Microsoft.NET\Framework\(your framework version)</em>";</li> <li>run <strong>aspnet_regiis.exe</strong> with <strong>-i</strong> parameter;</li></ul> <p>Now ASP.NET is registered but still not in the way which will satisfy me. Why? Well, it is simple. First, if you take a look at the <em>Documents </em>tab in the <em>Properties</em> window of any ASP.NET application you won't see <em>Default.aspx</em> item in the <em>Default documents</em> list. Yes, I know that it could be easily added but after all it supposed to be there by default. Second, with out any reason ASP.NET applications works very slow and sometimes, when you try to debug them from BDS 2006, you receive some weird errors. So if you don't want to have any doubts whose fault is this, yours or Microsoft, then the following should be done -uninstall ASP.NET and reinstall it again :) Don't worry, it won't take too much of your time. Just do next and you won't regret:</p> <ul> <li>Once again start console and browse to the "<em>C:\WINDOWS\Microsoft.NET\Framework\(your framework version)</em>";</li> <li>run <strong>aspnet_regiis.exe</strong> with <strong>-u</strong> parameter;</li> <li>then remove ASPNET account from user accounts if it is still there (Press Start>Run; type <strong>control userpasswords2</strong>);</li> <li>run <strong>aspnet_regiis.exe</strong> with <strong>-i</strong> parameter;</li></ul> <p>Now everything will work like out of the box. But it is not the end :)</p> <p>The only thing left to do is to uncomment tags of the <strong><assemblies> </strong>and <strong><httpModules> </strong>sections of the <strong>Web.config</strong> file of your ASP.NET application. And now everything works like it supposed to work! Hurray! Everybody happy!</p> <p>Stay tuned!</p>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-960307069568186752007-04-22T12:03:00.001+03:002007-04-22T12:12:31.848+03:00New version of a great color picker tool - AdesClrPickerDo you know that new version (2.0) of this very easy to use tool for picking colors has been released? Who said NO??? How this could happen?! Quickly check it out! A lot of new features has been introduced. You can see the list of changes and download AdesClrPicker v2.0 from <a href="http://www.adesdesign.net/php/products_color_picker.php">here</a>. This is a must have tool!<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.adesdesign.net/php/products_color_picker.php"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_aZnFH9kHFCk/Rism3LmTWdI/AAAAAAAAAAc/Cj2zlZKqWKk/s400/adesclrpicker_468x60.gif" alt="" id="BLOGGER_PHOTO_ID_5056177736101616082" border="0" /></a>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-28261368705416616332007-04-19T17:06:00.003+03:002007-04-19T17:08:11.520+03:00Interesting sample from the book<p>Hello. Yesterday I was reading one nice book about ASP.NET - <a href="http://www.amazon.com/ASP-NET-Tips-Tutorials-Scott-Mitchell/dp/0672321432/ref=sr_1_6/002-4578337-9590451?ie=UTF8&s=books&qid=1176989618&sr=1-6" target="_blank">ASP.NET: Tips, Tutorials and Code</a>. In one chapter I have found an interesting code sample which shows how to work with <em>Hashtable</em>. Here is a piece of it:</p> <p><font size="1"><span style="color: #0000ff">Dim</span><span style="color: #000000"> htSlaries </span><span style="color: #0000ff">As</span><span style="color: #000000"> </span><span style="color: #0000ff">New</span><span style="color: #000000"> </span><span style="color: #000000">Hashtable() </span></font></p> <div><font size="1"><span style="color: #000000">htSalaries.Add(</span><span style="color: #800000">"</span><span style="color: #800000">Bob</span><span style="color: #800000">"</span><span style="color: #000000">, </span><span style="color: #800080">40000</span><span style="color: #000000">)</span></font></div> <div><font size="1"><span style="color: #000000">htSalaries.Add(</span><span style="color: #800000">"</span><span style="color: #800000">John</span><span style="color: #800000">"</span><span style="color: #000000">, </span><span style="color: #800080">65000</span><span style="color: #000000">)</span></font></div> <div><font size="1"><span style="color: #000000">htSalaries.Add(</span><span style="color: #800000">"</span><span style="color: #800000">Dilbert</span><span style="color: #800000">"</span><span style="color: #000000">, </span><span style="color: #800080">25000</span><span style="color: #000000">) </span></font></div> <div><font size="1"><span style="color: #000000">htSalaries.Add(</span><span style="color: #800000">"</span><span style="color: #800000">Scott</span><span style="color: #800000">"</span><span style="color: #000000">, </span><span style="color: #800080">85000</span><span style="color: #000000">)</span></font></div> <div><font size="1"><span style="color: #000000">htSalaries.Add(</span><span style="color: #800000">"</span><span style="color: #800000">BillG</span><span style="color: #800000">"</span><span style="color: #000000">, </span><span style="color: #800080">90000000</span><span style="color: #000000">) </span></font></div> <div><font size="1"><span style="color: #008000">'</span><span style="color: #008000"> Then show this list in the label</span><span style="color: #008000"> </span><span style="color: #000000"></span></font></div> <div><font size="1"><span style="color: #000000">htSalaries.Remove(</span><span style="color: #800000">"</span><span style="color: #800000">BillG</span><span style="color: #800000">"</span><span style="color: #000000">)</span></font></div> <div><font size="1"><span style="color: #000000"></span></font> </div> <p><font size="2"><span style="color: #000000">Now guess who is BillG?! :) Firstly he gets his salary on paper and then employers change their mind :) Probably they decided that he has got enough already.</span></font></p>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-1996212788361663522007-04-17T15:54:00.001+03:002007-04-18T15:59:23.780+03:00First impression about Delphi 2007<p>Hello all! I finally have installed Delphi 2007 about an hour ago and now make some testdrive. Here is my first impressions:</p> <p><strong>Positive:</strong></p> <ul> <li>New installer became nicer and faster; <li>BDS 2007 starts faster then BDS 2006 (not pretty much but still faster); <li>The second start of BDS 2007 is definitely much faster than BDS 2006; <li>Help looks better too (hope the content became better too); <li>Finally we have Build Events!;</li></ul> <p><strong>Negative:</strong></p> <ul> <li>New installer didn't want to run properly from my D: partition (Windows installed on C:); <li>Text size button in the help doesn't work (actually it works but the only thing that changes is bullets size; the text size remains the same);</li></ul> <p>More will be later!</p> <p><u>Conclusion</u>:</p> <p>First impression is pleasant so far.</p>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com1tag:blogger.com,1999:blog-19417571.post-7401165606535697232007-04-13T14:06:00.001+03:002007-04-13T18:20:50.544+03:00The Returning<p>Hello-hello! Sorry for the long period of silence. I have been out of the city and had not much opportunities to be online. Also I had to finish few projects. So in one word - busy :) </p> <p>Well during that nice period I have visited the capital (Kyiv). I have spent such a great time there even in spite of the fact that I have been in the business trip :). I spent in Kyiv 3 wonderful weeks and have passed very interesting courses - Visual Studio .NET. So from now I am starting to dig dipper into the world of .NET and planing to write on this blog not only about Delphi but also about C# and .NET.</p> <p>At the courses I have started to learn C#. Nice programming language but I am interesting in it only as a language for writing ASP.NET applications. All the rest I'll write exceptionally on Delphi (Delphi for .NET). Even ASP.NET applications I write in Delphi (code behind) but sometimes it is necessary to write some code in the aspx file and exactly for such situations I need to know CSharp (or at least VB.NET).</p> <p>Currently I am playing with few very interesting technologies: CVS, Subversion (well now I know precisely that Subversion is better than CVS and I'll use exactly Subversion; <a href="http://www.google.com.ua/search?sourceid=navclient-ff&ie=UTF-8&rls=GGGL,GGGL:2006-38,GGGL:ru&q=continuous+integration" target="_blank">Continuous Integration</a>), XML Documentation and OpenTools API. More about this later.</p> <p>And probably the most important thing - I am going to move my blog to the new place! Hurray! New online home for my blog will be at <a href="http://www.iskomorokh.com" target="_blank">www.iskomorokh.com</a>. For now this place is empty but soon everything will change. The reasons of this move are pretty obvious:</p> <ul> <li>Desire to have more features then <a href="http://www.blogger.com">Blogger</a> can give and more styles (own implementation); <li>total control; <li>great chance to have practice; <li>many other :)</li></ul> <p>See you.</p>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-29556251782419316142007-02-18T19:36:00.001+02:002007-02-18T20:06:35.097+02:00How to remove an application button from the taskbar in Delphi?<p>This is a question which each Delphi programmer ask himself at least once in his life. If you use Google or any other search engine you will easily find this solution:</p><br /><pre style="color:white;"><span style="color: rgb(0, 128, 128);">1</span> <span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> TForm1.CreateParams(</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> Params: TCreateParams);<br /></span><span style="color: rgb(0, 128, 128);">2</span> <span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">3</span> <span style="color: rgb(0, 0, 0);"> inherited CreateParams(Params);<br /></span><span style="color: rgb(0, 128, 128);">4</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">with</span><span style="color: rgb(0, 0, 0);"> Params </span><span style="color: rgb(0, 0, 255);">do</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">5</span> <span style="color: rgb(0, 0, 0);"> ExStyle :</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> ExStyle </span><span style="color: rgb(0, 0, 255);">or</span><span style="color: rgb(0, 0, 0);"> WS_EX_TOPMOST;<br /></span><span style="color: rgb(0, 128, 128);">6</span> <span style="color: rgb(0, 0, 0);"> WndParent :</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> GetDesktopwindow;<br /></span><span style="color: rgb(0, 128, 128);">7</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 128, 128);">8</span> <span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;</span></pre> <p>So now you definitely have a question: "If it is so easy to find a solution then why I am talking about this?" An answer is simple. I have merely encountered a situation when approach which has been shown above is not suitable and decided to share my solution of this case with you.</p> <p>Well what is the intention of the problem? According to the MSDN if you add <strong>WS_EX_TOOLWINDOW</strong> to the window ExStyle then window will act like this:</p> <blockquote><strong>WS_EX_TOOLWINDOW</strong> <p>Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. <em>A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB</em>. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by right-clicking or by typing ALT+SPACE.</p></blockquote> <p>But my client asked me to remove the button from the taskbar and leave the ability to see the window in the ALT+TAB dialog. Thus I had to refuse from above method and create my own. The solution in principle is not hard. Here is the list of steps you should do if you want to achieve an appropriate behavior:</p> <ol><li>Set <em>FormStyle</em> property of your form to <strong><em>fsStayOnTop</em></strong> (this helps us to hold our window on top of the rest windows of our application); </li><li>Write next piece of code:</li></ol> <pre color="white"><div><pre style="background-color: white;"><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 255);">type</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(0, 0, 0);"> TfrmSamples </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> class(TForm)<br /></span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);">{</span><span style="color: rgb(0, 128, 0);"> ... </span><span style="color: rgb(0, 128, 0);">}</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(0, 0, 0);"> public<br /></span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> FormDeactivate(Sender: TObject);<br /></span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);">{</span><span style="color: rgb(0, 128, 0);"> Public declarations </span><span style="color: rgb(0, 128, 0);">}</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);">{</span><span style="color: rgb(0, 128, 0);"> ... </span><span style="color: rgb(0, 128, 0);">}</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> TfrmSamples.FormCreate(Sender: TObject);<br /></span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);">{</span><span style="color: rgb(0, 128, 0);"> force floating window to be on top </span><span style="color: rgb(0, 128, 0);">}</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">14</span> <span style="color: rgb(0, 0, 0);"> Application.OnDeactivate :</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> FormDeactivate;<br /></span><span style="color: rgb(0, 128, 128);">15</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 128, 128);">16</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">17</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> TfrmSamples.FormShow(Sender: TObject);<br /></span><span style="color: rgb(0, 128, 128);">18</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">19</span> <span style="color: rgb(0, 0, 0);"> ShowWindow(Application.Handle, SW_HIDE);<br /></span><span style="color: rgb(0, 128, 128);">20</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 128, 128);">21</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">22</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> TfrmSamples.FormDeactivate;<br /></span><span style="color: rgb(0, 128, 128);">23</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">24</span> <span style="color: rgb(0, 0, 0);"> Application.BringToFront;<br /></span><span style="color: rgb(0, 128, 128);">25</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;</span></pre><span style="color: rgb(0, 0, 0);"></span></div></pre> <p>According to the Borland help <span style="font-style: italic;">TApplication.OnDeactivate</span> event occurs when an application becomes inactive therefore if we want to keep our window above all other applications (windows) then this is exec place to act.</p><p>That's all! Quick and easy.</p>If you have some other solution of this task please post them in the comments.iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com1tag:blogger.com,1999:blog-19417571.post-26922060408588187502007-02-15T14:07:00.000+02:002007-02-15T14:06:12.247+02:00Global mouse hook in Delphi<p>Hello everyone!</p> <p>On my primary job I have changed my mouse. At home I have <em>A4Tech</em> optical mouse with a scroll but on my job I have <em>Genius</em> mouse (optical and with a scroll as well). At home I use my scroll also as a middle button and when I press it the window which is under cursor getting minimized. It was easy to achieve this behavior because software which comes with my <em>A4Tech</em> mouse supports this functionality. Another case is my <em>Genius</em> mouse at work. Software which bundled with it does not allow to minimize the window under the cursor when the scroll button is pressed. Pity!</p> <p>But solution always can be found! I decided to write a global mouse hook on <strong>Delphi</strong> which will intercept middle (scroll) button click (<strong>WM_NCMBUTTONDOWN</strong> and <strong>WM_MBUTTONDOWN</strong> messages), check if any top level window is under the cursor and if yes then minimize that window. </p><p>The code is pretty simple. </p><p>We need two projects: one - which runs the hook and then kills it; the other - the hook itself (it is supposed to be a DLL because it is a global hook). Nothing difficult (at least if you what is DLL and how to use them)! </p><p style="font-weight: bold; color: rgb(153, 0, 0);">Here is the mouse hook (<strong>WH_MOUSE</strong>) implementation:</p><pre style=";color:white;"><span style="color: rgb(0, 0, 0);">library MiddleButton;<br /><br /></span><span style="color: rgb(0, 0, 255);">uses</span><span style="color: rgb(0, 0, 0);"><br />Windows,<br />Messages;<br /><br /></span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"><br />MemMapFile </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Igor_thief</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 0, 255);">type</span><span style="color: rgb(0, 0, 0);"><br />PDLLGlobal </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> ^TDLLGlobal;<br />TDLLGlobal </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">packed</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">record</span><span style="color: rgb(0, 0, 0);"><br /> HookHandle: HHOOK;<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"><br />GlobalData: PDLLGlobal;<br />MMF: THandle;<br /><br /></span><span style="color: rgb(0, 128, 0);">{</span><span style="color: rgb(0, 128, 0);">$R *.res</span><span style="color: rgb(0, 128, 0);">}</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);"> HookProc(Code: integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;<br /></span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"><br />CurrWND: THandle;<br /></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> Code </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">then</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /> Result :</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> CallNextHookEx(GlobalData^.HookHandle, Code, wParam, lParam);<br /> exit;<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">; </span><span style="color: rgb(0, 0, 0);">//</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (wParam </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> WM_NCMBUTTONDOWN) </span><span style="color: rgb(0, 0, 255);">or</span><span style="color: rgb(0, 0, 0);"> (wParam </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> WM_MBUTTONDOWN) </span><span style="color: rgb(0, 0, 255);">then</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /> CurrWND :</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> PMouseHookStruct(lParam)^.hwnd;<br /> CurrWND :</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> GetAncestor(CurrWND, GA_ROOTOWNER);<br /> SendMessage(CurrWND, WM_SYSCOMMAND, SC_MINIMIZE, </span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">; </span><span style="color: rgb(0, 0, 0);">//</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"><br /><br />Result :</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> CallNextHookEx(GlobalData^.HookHandle, Code, wParam, lParam);<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> CreateGlobalHeap;<br /></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br />MMF:</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> CreateFileMapping(INVALID_HANDLE_VALUE, </span><span style="color: rgb(0, 0, 255);">nil</span><span style="color: rgb(0, 0, 0);">, PAGE_READWRITE, </span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">,<br /> SizeOf(TDLLGlobal), MemMapFile);<br /><br /></span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> MMF </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">then</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /> MessageBox(</span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">CreateFileMapping -</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(128, 0, 0);">''</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">);<br /> exit;<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /><br />GlobalData:</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> MapViewOfFile(MMF, FILE_MAP_ALL_ACCESS, </span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">, SizeOf(TDLLGlobal));<br /></span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> GlobalData </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">nil</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">then</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 0);">//</span><span style="color: rgb(0, 0, 0);"> не смогди создать отображение<br /> CloseHandle(MMF);<br /> MessageBox(</span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">MapViewOfFile -</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(128, 0, 0);">''</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> DeleteGlobalHeap;<br /></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> GlobalData</span><span style="color: rgb(0, 0, 0);"><></span><span style="color: rgb(0, 0, 255);">nil</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">then</span><span style="color: rgb(0, 0, 0);"><br /> UnmapViewOfFile(GlobalData);<br /><br /></span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> MMF</span><span style="color: rgb(0, 0, 0);"><></span><span style="color: rgb(0, 0, 0);"> INVALID_HANDLE_VALUE </span><span style="color: rgb(0, 0, 255);">then</span><span style="color: rgb(0, 0, 0);"><br /> CloseHandle(MMF);<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> RunHook; stdcall;<br /></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br />GlobalData^.HookHandle:</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> SetWindowsHookEx(WH_MOUSE, @HookProc, HInstance, </span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> GlobalData^.HookHandle </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> INVALID_HANDLE_VALUE </span><span style="color: rgb(0, 0, 255);">then</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /> MessageBox(</span><span style="color: rgb(128, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Error :)</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);"> , </span><span style="color: rgb(128, 0, 0);">''</span><span style="color: rgb(0, 0, 0);"> , MB_OK);<br /> Exit;<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> KillHook; stdcall;<br /></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (GlobalData</span><span style="color: rgb(0, 0, 0);"><></span><span style="color: rgb(0, 0, 255);">nil</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 255);">and</span><span style="color: rgb(0, 0, 0);"> (GlobalData^.HookHandle</span><span style="color: rgb(0, 0, 0);"><></span><span style="color: rgb(0, 0, 0);">INVALID_HANDLE_VALUE) </span><span style="color: rgb(0, 0, 255);">then</span><span style="color: rgb(0, 0, 0);"><br /> UnhookWindowsHookEx(GlobalData^.HookHandle);<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> DLLEntry(dwReason: DWORD);<br /></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">case</span><span style="color: rgb(0, 0, 0);"> dwReason </span><span style="color: rgb(0, 0, 255);">of</span><span style="color: rgb(0, 0, 0);"><br /> DLL_PROCESS_ATTACH: CreateGlobalHeap;<br /> DLL_PROCESS_DETACH: DeleteGlobalHeap;<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /><br />exports<br />KillHook,<br />RunHook;<br /><br /></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br />DLLProc:</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> @DLLEntry;<br />DLLEntry(DLL_PROCESS_ATTACH);<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">.</span></pre><span style="color: rgb(153, 51, 0); font-weight: bold;">And here is an implementation of the hook launcher:</span><br /><pre style=";color:white;"><span style="color: rgb(0, 0, 255);">unit</span><span style="color: rgb(0, 0, 0);"> RunMiddleButton;<br /><br /></span><span style="color: rgb(0, 0, 255);">interface</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">uses</span><span style="color: rgb(0, 0, 0);"><br />Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls;<br /><br /></span><span style="color: rgb(0, 0, 255);">type</span><span style="color: rgb(0, 0, 0);"><br />TfrmMain </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> class(TForm)<br /> btnRunHook: TButton;<br /> btnKillHook: TButton;<br /> </span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> btnRunHookClick(Sender: TObject);<br /> </span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> btnKillHookClick(Sender: TObject);<br />private<br /> </span><span style="color: rgb(0, 128, 0);">{</span><span style="color: rgb(0, 128, 0);"> Private declarations </span><span style="color: rgb(0, 128, 0);">}</span><span style="color: rgb(0, 0, 0);"><br />public<br /> </span><span style="color: rgb(0, 128, 0);">{</span><span style="color: rgb(0, 128, 0);"> Public declarations </span><span style="color: rgb(0, 128, 0);">}</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> RunHook; stdcall; external </span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">MiddleButton.dll</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);"> name </span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">RunHook</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> KillHook; stdcall; external </span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">MiddleButton.dll</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);"> name </span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">KillHook</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"><br />frmMain: TfrmMain;<br /><br /></span><span style="color: rgb(0, 0, 255);">implementation</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 128, 0);">{</span><span style="color: rgb(0, 128, 0);">$R *.dfm</span><span style="color: rgb(0, 128, 0);">}</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> TfrmMain.btnRunHookClick(Sender: TObject);<br /></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br />RunHook;<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span><span style="color: rgb(0, 0, 255);">procedure</span><span style="color: rgb(0, 0, 0);"> TfrmMain.btnKillHookClick(Sender: TObject);<br /></span><span style="color: rgb(0, 0, 255);">begin</span><span style="color: rgb(0, 0, 0);"><br />KillHook;<br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span><span style="color: rgb(0, 0, 255);">end</span><span style="color: rgb(0, 0, 0);">.<br /><br />If you don't know what is HOOK and how it works at all then you shoulf go and read MSDN.<br />Good luck! Study hard!<br /></span></pre>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com14tag:blogger.com,1999:blog-19417571.post-40247519346312105622007-02-07T11:13:00.001+02:002007-02-07T11:13:41.042+02:00Debugging DLL in Delphi<p>Yesterday I spend about an hour to figure out how to debug DLL in Delphi. It is really long time considering that I was doing this before. <a title="One of the best search engines in the whole world!" href="http://www.google.com" target="_blank">Google</a> didn't help me a lot because all I have found wasn't really helpful.</p> <p>I have found this solution in the Internet:</p> <blockquote> <p>Until up to Win2k, you had to set the HostApplication on Start=>Parameter to debug a DLL. This will not work on Windows XP. That Delphi will know the DLL if you run the program, you have to do the following:<br>The program must load the DLL. After this, press Ctrl-Alt-M in Delphi, to list all modules. Sometimes there will be the DLL with path.<br><strong>Solution</strong>:<br>Right click on the DLL, select "Reload symbols" and set the full path to the DLL. Now the breakpoints should be active.<br>When the DLL will be compiled in the system path (directory in PATH) this problem don't occur.</p></blockquote> <p><font color="#666666">Not bad! But I have discovered for myself more easy and fast way. Next steps need to be done:</font></p> <ol> <li><font color="#666666">In the <em>Project Manager</em> make your DLL project active and press <strong>Ctrl+Shift+F11</strong>;</font></li> <li><font color="#666666">In the <em>Project Options</em> window which just appeared select <em>Debugger</em> node and on the right side of the window in the <em>Host Application</em> field specify the host application (press <em>Browse</em> button and select the application which use your library) and then close the dialog by pressing the <em>Ok</em> button;</font></li> <li><font color="#666666">Then simply press <strong>F9</strong></font><strong> </strong>and be happy!</li></ol> <p>BTW, it is also good to set up dependencies of your main application which use the DLL you want to debug. You can read about this <a title="Pre and Post-Build Automation in Delphi" href="http://delphi.about.com/od/devutilities/a/pre_post_build.htm" target="_blank">here</a>.</p>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com14tag:blogger.com,1999:blog-19417571.post-38594121748490578492007-01-15T18:19:00.001+02:002007-01-15T19:18:05.204+02:00Color namespaces and their implementation in Delphi or any other programming language<p></p> <p></p> <p>There are few color namespaces (color models). Some of them are better in one field but worse in other. Sometimes it happens that you need to convert some color from one color model to another. This is exact situation which has happened to me. So I decided to find a little bit more information about color models which I need to work with. I went to <a href="http://www.en.wikipedia.org">Wikipedia</a> and <a href="http://www.google.com">Google</a> and found a lot of useful information and few code snippets. That made me happy … but not for long L <p>Well, here is the situation: there is one color which I need to convert from RGB color model to HSL (HLS) and back but for all that I need all the work to be done with whole numbers. It seems that the task is not complicated. But I have been put in horror by the fact that all the versions of the source code I have found in Internet use different approaches to present color formats. Some represent RGB values as 0..255 but the other as 0..1; HLS values as H – 0..360, S и L – 0..1 or H – 0..239, S и L – 0..240 (e.g. <strong>Microsoft</strong>). I have seen few another modifications. Weird – isn’t it? <p>But this is yet far not the end of the story. Later I have been put into more horrible horror. Having tested some variants of a code I have discovered that returned results from the different versions of code almost completely mismatch, though the input was the same for all of them. Suddenly one interesting question came to my mind. Is it possible that <a href="http://www.borland.com">Borland</a> (or I should better say <a href="http://www.codegear.com">CodeGear</a>) or <a href="http://www.microsoft.com">Microsoft</a> do not give us some solution for this, it would seem basic task? And I have appeared right! Both giants give us necessary routines. <a href="http://www.codegear.com">CodeGear</a> gives us <strong>ColorRGBToHLS</strong> and <strong>ColorHLSToRGB</strong> respectively which can be found in <em><strong>GraphUtil</strong></em> unit. You can get access to the <a href="http://www.microsoft.com">Microsoft</a> functions <strong>ColorHLSToRGB</strong> and <strong>ColorRGBToHLS</strong> with the help of <em><strong>ShlwAPi</strong></em> unit. Hurrah! – I exclaimed, but again it was too early. Once again a great surprise expected me. <p>This time the thing was that at the first glance everything seems to work, and even looks like the truth, but it turned out, that as a result – this is just at first glance. The fact is that few colors in RGB model has been found which can be converted into HLS model without any problem, but it is impossible to get the same RGB color back from the HLS model. You can easily make sure in it. Simply run MS paint and enter these RGB values R=196, G=136, B=248 in the Select Color dialog. Remember HLS values. Now change the color to some other. And now enter HLS values which you remembered. Then compare resulted RGB values with RGB values you have been entering at the beginning. See?! <p>I have found a bug in the <strong>ColorRGBToHLS</strong> procedure which is in the <strong><em>GraphUtil</em></strong> and reported it in QC (<a href="http://qc.borland.com/wc/qcmain.aspx?d=37436">QC#37436: GraphUtil.ColorRGBToHLS</a>). It was rounding issue. I thought that this will save the situation but I was wrong. The <strong>ColorHLSToRGB</strong> routine was buggy too (<a href="http://qc.borland.com/wc/qcmain.aspx?d=37572">QC#37572: conversion issue between ColorRGBToHLS and back ColorRGBToHLS (GraphUtil)</a>) but this time the problem hides in formulas. <p>Conclusion: <ul> <li>I still don't understand - is there any standard in this field? If yes, why nobody follows them? <li>Don't try to remove those bugs I described above. The problem is not in code - the problem is in the formulas. Yes, yes ... I am saying that HLS color model is buggy! <li>No matter which code version you will use (<a href="http://www.codegear.com">CodeGear</a>, <a href="http://www.microsoft.com">Microsoft</a>, anybody else) - they all works wrong!</li></ul>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com2tag:blogger.com,1999:blog-19417571.post-64971006356354871082007-01-02T09:31:00.000+02:002007-01-02T09:32:35.557+02:00Happy New Year!<span style="font-weight:bold;">Happy New Year!!!</span>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-16482361165638263742006-10-03T15:12:00.001+03:002006-10-03T15:17:30.418+03:00Video lessons (tutorials)<p>Hello all!</p> <p>If you know English and love Delphi then I am almost sure that you know <a href="http://blogs.borland.com/nickhodges/">Nick Hodges</a> (at least his <a title="Nick's blog" href="http://blogs.borland.com/nickhodges/" target="_blank">blog</a>). You probably wondering why I am talking about him? The answer is pretty obvious. Nick Hodges is great man which is strongly related to Delphi. Recently this incredibly active man has created 30 videos in 30 days about Delphi. His action inspired Camtasia team to <a href="http://www.techsmith.com/community/blogcomments.asp?thread=211">make 30 videos in 30 days</a> about their product - Camtasia Studio. I think that Nick Hodges action should inspire all the professionals in the Delphi community to do the same.</p> <p>IMHO - video tutorials/lessons is a right direction! Microsoft has chosen this direction and walks on it confidently. Visit <a href="http://www.ASP.net">www.ASP.net</a> and you will make sure in it. You will find there a lot of fresh video material for beginners and video answer on frequently asked question "How do I ... ?".</p> <p>I like to watch video from BDS 2006 presentation and found them very useful and informative. I think Borland should spend some time and efforts to make more Delphi videos. It is good to read books, articles ... but it is much better to read some book and then to watch related video made by Delphi professionals.</p> <p><font size="2">PS: some video material can be found at </font><a title="BDN" href="http://bdn.borland.com/" target="_blank"><font size="2">Borland Developer Network</font></a></p> <p>Thank you!</p>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-18081391834934940722006-09-29T15:40:00.000+03:002006-09-29T16:30:32.109+03:00Straggle between blogging software giantsHello all.<br /> Today I want to get back to my previous <a href="http://delphigeek.blogspot.com/2006/08/hello-all-before-this-day-i-was-using.html">post</a> about blogging software and blogging services. I have promised that soon I'll announce who has won (IMHO) in this battle for users. As you remember (if you don't you can recollect <a href="http://delphigeek.blogspot.com/2006/08/hello-all-before-this-day-i-was-using.html">here</a>) I was talking about 3 competitors: BlogJet, Windows Live Writer and <a href="http://www.writely.com/">www.writely.com</a> (Google's service). I don't know how I forgot about Microsoft Word 2007 :). Microsoft has added an ability to blog directly from Word. Honestly saying I like it pretty much.<br /> Well, who is the winner? I guess it is Windows Live Writer!!! You will ask why. Because it is FREE, easy to use and convenient. It is a standalone application thus we don't need to go to the web and be tied to the Internet connection speed. In spite of the speed of <a href="http://www.writely.com/">www.writely.com</a> and my Internet connection I still didn't used to use it as a text processor. Who knows? Maybe sooner or later things will change but for now my decision is Windows Live writer.<br />But! But one thing has disappointed me. Recently Microsoft released an <a href="http://windowslivewriter.spaces.live.com/blog/cns%21D85741BB5E0BE8AA%21702.entry?_c11_blogpart_blogpart=blogview&_c=blogpart#permalink">updated version</a> of Windows Live Writer and said that support of Blogger <span style="font-weight: bold;">Beta </span>has been added. That made me excited ... but not for long :(. I have downloaded an updated version, installed it and discovered that it is not completely true. First, I had to get my <span style="font-style: italic;">BlogId </span>number to be able to work with my blog. For me it was not a hard task. <blockquote>For example JCHeng in his blog post "<a href="http://jcheng.wordpress.com/2006/09/28/blogger-beta-workaround/">Blogger Beta Workaround</a>" says that you should navigate in browser to your blog, view source and find <span style="font-style: italic;">blogID </span>string.<br /></blockquote><br /> That's easy. But you can also do it in other way. Just navigate to your blog and move your cursor to "New Post" link and in the status bar you will see the link url which has your <span style="font-style: italic;">blogID</span> at the end. So you simply copy that link (right click an url and select 'copy' command from the context menu) and then insert it wherever you need and remove everything unnecessary. That's all! Second, I had to change the beginning of the string (url) from "<a style="color: rgb(255, 102, 0);" class="linkification-ext" href="http://www.blogger.com/" title="Linkification: http://www.blogger.com">http://www.blogger.com</a>" to "<a style="color: rgb(255, 102, 0);" class="linkification-ext" href="http://beta.blogger.com/" title="Linkification: http://beta.blogger.com">http://beta.blogger.com</a>". Ok, a piece of cake. But all these movement didn't help :(. I continued reciving errors.<br /> Fortunately one of the visitors of JCHeng's blog left a very useful comment. He gave a <a href="http://mostlytech.blogspot.com/2006/09/windows-live-writer-i18n-not-complete.html">link</a> to another workaround which fixed an issue. The problem was in the regional settings. If you want Windows Live Writer to work correctly you should change the regional settings to English (United States). Thanks SiD. This method works but it is not acceptable for me. Therefore all I have to do is wait when another new version of Windows Live Writer will be released. Hope it won't take long!iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com3tag:blogger.com,1999:blog-19417571.post-46237273798461082392006-09-19T10:40:00.000+03:002006-09-19T10:55:50.615+03:00Fresh hotfix for BDS 2006You probably know about <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_0">hotfixes</span> 1-6? Well, new <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_1">hotfixes</span> 7-9 for <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_2">Borland</span> Developer Studio 2006 has been released and available for download <a href="http://homepages.borland.com/abauer/BDS2006HotfixRollup.exe">here</a>. Detailed description of the <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_3">hotfixes</span> can be found <a href="http://cc.borland.com/item.aspx?id=24132">here</a>.iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-51036134585726943992006-09-14T15:58:00.000+03:002006-09-14T15:59:40.144+03:00Delphi extensions (experts)Hello world! Probably favorite phrase of most programmers :) Today I want to tell you about a very useful extension for Delphi.<br /><br />Personally I don't like to use extensions at all. The main reason is "functional overflow". Seems to me that it is hard to find in Internet an experts package containing only necessary functionality which you will use regularly. I don't want to say that all (or almost all) the experts are useless! No! There are a lot of extremely useful experts but they are often not free.<br /><br />Want proves? Well, no problems!<br /><br /><a href="http://www.jed-software.com/vf.htm">Visual Forms</a> - is a thumbnail viewer for the forms in your project. Greatly useful and especially for large projects which contain large amount of forms but :( not free. It costs 35 EUROS. Expensive as for me. This expert has only required features and there are no such which will never be used.<br /><br /><a href="http://www.gexperts.org/">GExperts</a> - a very huge Delphi experts package, free but contain some useless features. I am wondering how much time someone should spend before he will be able to use all of them efficiently? I think that a lot. Once again I don't want to say that this package is bad I am just trying to say that user should have a way to install only those experts which he consider useful.<br /><br />Well, now let's get back to the experts package which I wished to describe to you. It is <a href="http://andy.jgknet.de/dspeedup/index.php?page=DDevExtensions">DDevExtensions</a> Delphi/BCB/BDS IDE plugin. This plugin is free and has only useful features (IMHO). Go and try it! I should say that when I saw it for the first time on the home page I thought that this expert is absolutely useless because the new tool palette layout in BDS is very convenient. But I was wrong. I understood it after I tried <a href="http://andy.jgknet.de/dspeedup/index.php?page=DDevExtensions">DDevExtensions</a>.<br /><br />have a couple idea concerning creation of experts for Delphi. Hope you will see the realization very soon. Keep in touch!iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-1158138927818637412006-09-13T12:15:00.000+03:002006-09-13T12:20:01.416+03:00Building ADO ConnectionString<span id="r_text" name="r_text">Last night I was looking for a way of building a <span style="font-weight: bold">ConnectionString </span>for <span style="font-weight: bold">TAdoConnection </span>from Delphi code and having visited section of "Databases" of a </span><a title="Forum for programers" href="http://forum.vingrad.ru/" target="blank_">Vingrad</a> <span id="r_text" name="r_text">forum found the solution. It turned out that it could be easily done! All you need to do is just include <span style="font-weight: bold">AdoConEd</span> unit call <span style="font-weight: bold">EditConnectionString </span>function and send <span style="font-weight: bold">TAdoConnection </span>object as a parameter. Further all is simple. A standard window for building a ConnectionString will be shown in which you will do everything as usual.<br>Thus deploying applications that use ADO connections became much easier!<br><br><span style="text-decoration: underline">Code sample</span>:<br></span><pre> <span style="font-weight: bold">if</span> EditConnectionString(DataModule1.adoconPETS) <span style="font-weight: bold">then</span><br> <span style="font-weight: bold">begin</span><br> mmConnString.Text := DataModule1.adoconPETS.ConnectionString;<br> <span style="font-weight: bold">end;</span> <span style="color: rgb(0,102,0)">// if</span><span style="color: rgb(0,102,0)"><br></span><font size="2"></font></pre><pre><font size="1">PS: this post has been written with the help of </font><a title="www.writely.com" href="http://www.writely.com" target="blank_"><font size="1">www.writely.com</font></a><br></pre>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-1157631462072867982006-09-07T15:17:00.000+03:002006-09-07T15:19:21.056+03:00Delphi 7 Help for BDS expert<p>If you use Delphi 2005/2006 and want to use an old Delphi 7 help files (or any other help files) then you need to download updated <a href="http://cc.borland.com/Download.aspx?id=23948">BDS expert</a> (source code included) <strong>15.4 K</strong>. After install you can use 3 different help files by pressing <em>Ctrl-F1, Alt-F1 </em>or<em> Shift-F1</em>.</p> <p><font size="1">PS: this post has been written in Microsoft Live Writer.</font></p>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-1156848051836227422006-08-29T13:40:00.000+03:002006-08-29T13:48:23.680+03:00Blogging softwareHello all!<br />Before this day I was using <a href="http://blogjet.com/" target="blank_" title="http://blogjet.com/">BlogJet</a> (BTW, can't wait to see new version 2.0) to post to my blog but recently <a href="http://www.microsoft.com/" target="blank_" title="Microsoft">Microsoft</a> released its <a href="http://windowslivewriter.spaces.live.com/" target="blank_" title="Windows Live Writer is a desktop application that makes it easier to compose compelling blog posts using Windows Live Spaces or your current blog service.">Windows Live Writer</a> and I began to doubt which software to use. My doubts became greater after I saw <a href="http://www.blogjet.com/blog/2006/08/14/competition-the-microsofts-rip-offs-game/" target="blank_" title="this">this</a> blog post. In my opinion both programs are great. Each has its own benefits but .. but Windows Live Writer (beta yet) is <span style="font-weight: bold;">FREE </span>and I should say that this is a very telling argument. BTW, my previous post was made from Windows Live Writer. I should say that's its functionality is great.<br />But its not the end! Today <a href="http://www.google.com/" target="blank_" title="www.google.com">Google</a> finally renew the work of its <a href="http://www.writely.com/" target="blank_" title="www.writely.com">Writely</a> service. Using Writely you can post to your favorite blog too (its not the only and not the main feature of this great service) and it is absolutely <span style="font-weight: bold;">FREE </span>(at least for now). So now I am fully confused! But its not for long! Soon, after some research and test, I'll find out which way/software is better to use.<br /><br />Almost forgot to tell that <a href="http://www.blogger.com/" target="blank_" title="www.blogger.com">www.blogger.com</a> is going to update its way of editing posts. Now <a title="AJAX" target="blank_" href="http://en.wikipedia.org/wiki/AJAX">AJAX</a> technology will be used and I am sure that it would be much more convenient to edit the blog then it is now.<br /><br /><span style="font-style: italic;">Stay tuned and soon you will know my conclusion about who is the winner.</span><br /><br /><span style="font-size:78%;"> PS: this post has been written with the help of <a href="http://www.writely.com/" target="blank_" title="www.writely.com">www.writely.com</a><br /></span>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com1tag:blogger.com,1999:blog-19417571.post-1155824420829680082006-08-17T17:14:00.001+03:002006-08-19T13:44:43.220+03:00New version 1.5 of AdesClrPicker released<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3368/1921/1600/www.adesdesign.net_pick.2.jpg"><img style="float: left; margin: 0px 10px 10px 0px; cursor: hand" alt="" src="http://photos1.blogger.com/blogger/3368/1921/200/www.adesdesign.net_pick.1.jpg" border="0"></a>Hello all! I hope you remember AdesClrPicker. Yes, yes, yes I am talking about an easy to use, yet powerful color picker application for Web Designers and Web Developers which has been developed by myself.</p> <p>And now let me tell you a great news. I have released a new version 1.5 of it yesterday. Some new features has been added and some improvements has been made. As always you can download the demo version from the Ades Design <a href="http://www.adesdesign.net/php/products_color_picker.php" target="_blank">site</a> for free or buy a fully functional version only for $19.90. Please read <a href="http://www.adesdesign.net/php/products_color_picker_features.php">all details</a> on the site.</p> <p><em>Hurry up! Be the first to try an updated version!</em></p>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-1154089524053211442006-07-28T14:54:00.001+03:002006-07-28T15:29:06.466+03:00Enable Taskbar's auto hide feature from Delphi codeHi. Recently I was looking for an easy solution on how to enable Taskbar's auto hide and always on top features. The only thing I have found was the solution on how to find out "Is Windows taskbar's auto hide feature enabled?". Here is the solution:<br /><blockquote><br />uses <span style="font-style:italic;">ShellAPI</span>;<br /><br /><span style="font-weight:bold;">function</span> IsTaskbarAutoHideOn : boolean;<br /><span style="font-weight:bold;">var</span><br /> ABData : TAppBarData;<br /><span style="font-weight:bold;">begin</span><br /> ABData.cbSize := sizeof(ABData) ;<br /> Result :=<br /> (SHAppBarMessage(ABM_GETSTATE, ABData)<br /> and ABS_AUTOHIDE) > 0;<br /><span style="font-weight:bold;">end;</span><br /></blockquote> <br /> But as you understand this is good but not what I was looking for.<br /> Later I have found something similar to the solution, but once again it was not proper because it was just "cheating" :). Here is it:<br /><blockquote><br /><span style="font-weight:bold;">procedure</span> TForm1.Button1Click(Sender: TObject);<br /><span style="font-weight:bold;">var</span><br /> hTaskbar: THandle;<br /><span style="font-weight:bold;">begin</span><br /> hTaskbar := FindWindow('Shell_TrayWnd', Nil);<br /> ShowWindow(hTaskbar, SW_HIDE);<br /><span style="font-weight:bold;">end;</span><br /><br /><span style="font-weight:bold;">procedure</span> TForm1.Button2Click(Sender: TObject);<br /><span style="font-weight:bold;">var</span><br /> hTaskbar: THandle;<br /><span style="font-weight:bold;">begin</span><br /> hTaskbar := FindWindow('Shell_TrayWnd', Nil);<br /> ShowWindow(hTaskbar, SW_SHOWNORMAL);<br /><span style="font-weight:bold;">end;</span><br /></blockquote><br /> That's why I had to dig deep into the MSDN and write my own solution. So, take a look how I have solved the problem.<br /><blockquote><br /><span style="font-weight:bold;">procedure</span> TForm1.Button1Click(Sender: TObject);<br />var<br /> ABData: TAppBarData;<br /><span style="font-weight:bold;">begin</span><br /> ABData.cbSize := sizeof(tappbardata);<br /> ABData.hWnd := FindWindow('SHELL_TRAYWND', nil);<br /> ABData.lParam := LParam(ABS_ALWAYSONTOP or ABS_AUTOHIDE);<br /> SHAppBarMessage($0000000a, ABData);<br /><span style="font-weight:bold;">end;</span><br /></blockquote><br /> As it turned out, the main problem was to find <span style="font-weight:bold;">ABM_SETSTATE</span> constant which equal to <span style="font-weight:bold;">$0000000a</span> and not declared in Delphi.<br />That's it!iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com10tag:blogger.com,1999:blog-19417571.post-1153401322354107502006-07-20T15:51:00.000+03:002006-07-20T16:15:23.013+03:00Delphi 10 LiteGreat news for those who has slow PC and want to use BDS 2006! There is an Lite version of BDS 2006 in the Internet. Yo can download it from <a href="http://rapidshare.de/files/25763925/Dl.exe.html">here</a>. The password is "496sgjde7869". For more details read "<a href="http://www.igor-thief.pisem.net/delphi/Delphi10Lite/readme.txt">readme.txt</a>"<br />I have already downloaded it and making some tests. So far it works fine and fast. Will see what will be next.iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com17tag:blogger.com,1999:blog-19417571.post-1151602946245570362006-06-29T20:38:00.000+03:002006-06-29T20:42:26.316+03:00ASP.NET<span xmlns=""><p>After a long period of silence the first thing that I want to write about is <a href="http://www.asp.net">ASP.NET</a>. The reason why I am speaking about it is my diploma theme. It was something like “ASP.NET in Delphi”. In this post I am not going to tell you about how ASP.NET technology is tough, simple and efficient. In this post I want to highlight the first thing that disappointed me in Delphi (actually in an IDE but not in the language). <br /></p><p>Well I love Delphi and I like new DBS 2006 IDE very much. But when I started to study ASP.NET and tried to write some plain .aspx files in BDS 2006 I was very, very much disappointed. The visual HTML editor in this IDE is terrible, awful, horrible … Solution was found very fast. I have simply opened an .aspx file in the DreamWeaver and made everything as I wanted. But there are few annoying things on this stage too. Also Code Editor sometimes behaves really strange when I am editing an .aspx file.<br /></p><p>The other thing that made me feel sad is that when I was checking the results of my work in Internet Explorer everything appeared wonderful but when I was using Firefox to see the results WebControls where looking not exactly as I wanted them to look. E.g. when I was changing the width of some control to 100 pixels it was shown correctly in IE but in Firefox it was shown with default width. Fortunately the decision of this problem was found. Thanks to <a href="http://85.146.33.29/Weblog/Blog.aspx?RootId=5:50">Dr.Bob’s post</a>. He explained the reason of the problem and how to solve this problem.<br /></p><p><strong>Conclusion</strong>:<br /></p><ul><li><div>ASP.NET – Rulezzz;<br /></div></li><li><div>Borland (DevCo) should greatly improve it’s solution for ASP.NET;<br /></div></li></ul><p>Thank you for your attention and sorry for bad English.</p></span>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-1151600297320453572006-06-29T19:54:00.000+03:002006-06-29T19:58:17.356+03:00Freedom<span xmlns=""><p>Hi all! I know that for a pretty long period of time my blog has not been updated. As you might know or guess I was extremely busy with my graduation project. Finally I have finished it and protected my diploma. Now I am absolutely free and have enough time to write new and interesting (I hope) posts.</p></span>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0tag:blogger.com,1999:blog-19417571.post-1140994224529015152006-02-26T23:50:00.001+02:002006-02-27T00:50:24.530+02:00AdesClrPicker<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3368/1921/1600/www.adesdesign.net_pick.0.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3368/1921/200/www.adesdesign.net_pick.jpg" border="0" alt="" /></a><br />I have recently finished one very interesting program which was ordered by <a href="http://www.adesdesign.net/php/about.php">Ades</a>. This program is very useful for web designers or any other kind of designers. The main purpose of it is to capture colors anywhere on the screen and store them in either HTML or RGB color codes. You can read more detailed description, see more screenshots and download the demo from <a href="http://www.adesdesign.net/php/products_color_picker.php">here</a>.<br />I will be <span style="font-weight:bold;">tremendously</span> appreciated for those who will leave any suggestions, critics etc. here in the comments.<br /><br />PS: <span style="font-style:italic;">very soon new version will be released so stay tuned!</span>iSkomorokhhttp://www.blogger.com/profile/14743314682753545265noreply@blogger.com0