<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="http://themoddoctor.wetpaint.com/xsl/rss2html.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://themoddoctor.wetpaint.com/scripts/wpcss/wiki/themoddoctor/skin/ghostgreen/rss" type="text/css" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>TheModDoctor - Recently Updated Pages</title><link>http://themoddoctor.wetpaint.com/pageSearch/updated</link><description>Recently Updated Pages on http://themoddoctor.wetpaint.com</description><language>en-us</language><webMaster>info@wetpaint.com</webMaster><pubDate>Thu, 30 Aug 2007 12:07:22 CDT</pubDate><lastBuildDate>Thu, 30 Aug 2007 12:07:22 CDT</lastBuildDate><generator>wetpaint.com</generator><ttl>60</ttl><image><title>TheModDoctor</title><url>http://image.wetpaint.com/image/1/r4vMfpD49UjVkVnU0IeOeA12884</url><link>http://themoddoctor.wetpaint.com</link></image><item><title>Delphi Source Code</title><link>http://themoddoctor.wetpaint.com/page/Delphi+Source+Code</link><author>TheModDoctor</author><guid isPermaLink="false">http://themoddoctor.wetpaint.com/page/Delphi+Source+Code</guid><pubDate>Thu, 30 Aug 2007 12:07:22 CDT</pubDate><description> 	&lt;br&gt;There are lots of code for delphi, but everybody has to start somewhere with the basics.&lt;br&gt; Some of us are past the Basics and want to know more codes for Delphi. But not just codes to work within Delphi, we want codes that work with Windows, the registry, and files and folders. We may even want to run DOS commands.&lt;br&gt; &lt;br&gt; &lt;br&gt;&lt;u&gt;&lt;font size=&quot;4&quot;&gt; Index&lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;/u&gt; &lt;ul&gt;&lt;li&gt;Basic Knowledge&lt;br&gt;   &lt;/li&gt;&lt;li&gt;Open Windows Programs&lt;/li&gt;&lt;li&gt;Open Files with Programs&lt;/li&gt;&lt;li&gt;Open Folders&lt;br&gt;   &lt;/li&gt;&lt;li&gt;Run DOS Commands&lt;/li&gt;&lt;li&gt;Writing to text files&lt;/li&gt;&lt;li&gt;Reading from text files&lt;/li&gt;&lt;li&gt;Hiding the Close button&lt;/li&gt;&lt;li&gt;Hide/Show Application in Taskbar&lt;br&gt;&lt;/li&gt;&lt;/ul&gt; &lt;br&gt; &lt;br&gt; &lt;font size=&quot;4&quot;&gt;&lt;u&gt;Basic Knowledge&lt;/u&gt;&lt;/font&gt;&lt;br&gt; &lt;br&gt;&lt;ul&gt;&lt;li&gt; Always when we work with code which refers to some external command, we have to specify to Delphi what it is. To do this open up the code section, and at the top of the code, you will see &amp;#39;uses&amp;#39;. Here Delphi is told which your services your program will use.&lt;/li&gt;&lt;/ul&gt;&lt;br&gt;&lt;ul&gt;&lt;li&gt; // means that a comment is to follow and delphi will not execute it as script. You can type anything here.&lt;/li&gt;&lt;/ul&gt; &lt;br&gt; &lt;br&gt; &lt;u&gt;&lt;font size=&quot;4&quot;&gt;Open Windows Programs&lt;/font&gt;&lt;/u&gt;&lt;br&gt; &lt;br&gt; Under &amp;#39;uses&amp;#39;, put &amp;#39;ShellApi&amp;#39;&lt;br&gt; &lt;br&gt; For example, if you click a button, notepad must open. Put this code in the button&amp;#39;s procedure:&lt;br&gt; &lt;br&gt; ShellExecute(Handle,          &amp;#39;open&amp;#39;, &amp;#39;c:\Windows\notepad.exe&amp;#39;, nil, nil, SW_SHOWNORMAL) ;&lt;br&gt; &lt;br&gt; &lt;br&gt; &lt;u&gt;&lt;font size=&quot;4&quot;&gt;Open Files with Programs&lt;/font&gt;&lt;/u&gt;&lt;br&gt; &lt;br&gt; uses ShellApi;&lt;br&gt; &lt;br&gt; ShellExecute(Handle,&amp;#39;open&amp;#39;,          &amp;#39;c:\windows\notepad.exe&amp;#39;,&amp;#39;c:\SomeText.txt&amp;#39;, nil, SW_SHOWNORMAL) ;&lt;br&gt; &lt;br&gt; &lt;br&gt; &lt;font size=&quot;4&quot;&gt;&lt;u&gt;Open Folders&lt;br&gt; &lt;/u&gt;&lt;font size=&quot;3&quot;&gt;&lt;br&gt; uses ShellApi;&lt;br&gt; &lt;br&gt; &lt;/font&gt;&lt;/font&gt;ShellExecute(Handle,&amp;#39;open&amp;#39;, &amp;#39;c:\DelphiDownload&amp;#39;,          nil, nil, SW_SHOWNORMAL) ;&lt;br&gt; &lt;font size=&quot;4&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;br&gt; &lt;br&gt; &lt;/font&gt;&lt;u&gt;Run DOS Commands&lt;/u&gt;&lt;font size=&quot;3&quot;&gt;&lt;br&gt; &lt;br&gt; uses ShellApi;&lt;br&gt; &lt;br&gt; Run a DOS command and return close Command Prompt:&lt;br&gt;  ShellExecute(Handle, &amp;#39;open&amp;#39;, PChar(&amp;#39;command.com&amp;#39;), PChar(&amp;#39;/c copy file1.txt file2.txt&amp;#39;), nil, SW_SHOW);&lt;br&gt;  &lt;br&gt; Run a DOS command and keep the Command Prompt Window Open:&lt;br&gt;  ShellExecute(Handle, &amp;#39;open&amp;#39;, PChar(&amp;#39;command.com&amp;#39;), PChar(&amp;#39;/k dir&amp;#39;), nil, SW_SHOW);&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;u&gt;&lt;font face=&quot;Arial&quot; size=&quot;4&quot;&gt;Writing to Text Files&lt;/font&gt;&lt;/u&gt;&lt;br&gt;&lt;br&gt;Suppose you want to type something into an editbox, and then you want to save it as a .txt file when you click on a button.&lt;br&gt;In the button&amp;#39;s code:&lt;br&gt;&lt;br&gt;var&lt;br&gt; F: TextFile;&lt;br&gt;begin&lt;br&gt; AssignFile(F, &amp;#39;C:\Test\Data.txt&amp;#39;); //Open a new file&lt;br&gt; Rewrite(F); &lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;4&quot;&gt;&lt;font size=&quot;3&quot;&gt;//Will be creates if non-existing&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font size=&quot;4&quot;&gt;&lt;font size=&quot;3&quot;&gt; WriteLn(F, Edit1.Text); //Write text in editbox&lt;br&gt; WriteLn(F, Edit2.Text); &lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;4&quot;&gt;&lt;font size=&quot;3&quot;&gt;//Write text in second editbox&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font size=&quot;4&quot;&gt;&lt;font size=&quot;3&quot;&gt; CloseFile(F); //Close the File&lt;br&gt;end;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;u&gt;&lt;font size=&quot;4&quot;&gt;Reading from Text Files&lt;/font&gt;&lt;/u&gt;&lt;br&gt;&lt;br&gt;procedure TForm1.btnReadClick(Sender: TObject);&lt;br&gt;var&lt;br&gt; F: TextFile;&lt;br&gt; S: string;&lt;br&gt;begin&lt;br&gt; if FileExists(&amp;#39;C:\Test\Data.txt&amp;#39;) then begin&lt;br&gt; AssignFile(F, &amp;#39;C:\Test\Data.txt&amp;#39;);&lt;br&gt; Reset(F);&lt;br&gt; ReadLn(F, S);&lt;br&gt; Edit1.Text := S;&lt;br&gt; ReadLn(F, S);&lt;br&gt; Edit2.Text := S;&lt;br&gt; CloseFile(F); &lt;br&gt; end&lt;br&gt; else&lt;br&gt; ShowMessage(&amp;#39;File C:\Test\Data.txt not found&amp;#39;);&lt;br&gt;end;&lt;br&gt;&lt;br&gt;&lt;u&gt;&lt;font size=&quot;4&quot;&gt;&lt;br&gt;&lt;/font&gt;&lt;/u&gt;&lt;/font&gt;&lt;u&gt;Hiding the Close button&lt;/u&gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;There is a very easy way to do this without programming it. This is usefull for a splash-screen.&lt;br&gt;&lt;br&gt;&lt;ol&gt;&lt;li&gt;Click on your form&lt;/li&gt;&lt;li&gt;Look in the Object Inspector, under &amp;#39;Border Icons&amp;#39;&lt;/li&gt;&lt;li&gt;Select False in &amp;#39;biSystemMenu&amp;#39; dropdown window&lt;/li&gt;&lt;li&gt;Run your app and you will see that there isn&amp;#39;t a close button!&lt;/li&gt;&lt;li&gt;Press Alt-F4 to exit&lt;br&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;u&gt;&lt;font size=&quot;4&quot;&gt;Hide/Show Application in Taskbar&lt;/font&gt;&lt;/u&gt;&lt;br&gt;&lt;br&gt;&lt;ul&gt;&lt;li&gt;Hide&lt;/li&gt;&lt;/ul&gt; ShowWindow(Application.Handle, SW_HIDE);&lt;br&gt;&lt;br&gt;&lt;ul&gt;&lt;li&gt;Show&lt;/li&gt;&lt;/ul&gt; ShowWindow(Application.Handle, SW_SHOW);&lt;br&gt; &lt;br&gt; &lt;br&gt; &lt;font size=&quot;4&quot;&gt;&lt;u&gt;The Message Box&lt;/u&gt;&lt;/font&gt;&lt;br&gt; &lt;br&gt; Sometimes it is inconveniant to have to display something on a label. ShowMessage is a very neat way to do this:&lt;br&gt; &lt;br&gt; ShowMessage(&amp;#39;type your message here&amp;#39;);&lt;br&gt; &lt;br&gt; &lt;br&gt; &lt;u&gt;&lt;font size=&quot;4&quot;&gt;The inputbox&lt;/font&gt;&lt;/u&gt;&lt;br&gt; &lt;br&gt; If you want to quickly provide a name or password, but haven&amp;#39;t got the space to use a editbox, the inputbox command is perfect. Here&amp;#39;s an example:&lt;br&gt; &lt;br&gt; var&lt;br&gt; example :string;&lt;br&gt; &lt;br&gt; procedure TForm1.Button1Click(Sender: TObject);&lt;br&gt; begin&lt;br&gt; &lt;br&gt; example:=inputbox(&amp;#39;The caption of the inputbox&amp;#39;, &amp;#39;The prompt&amp;#39;, &amp;#39;The Default input&amp;#39;);&lt;br&gt; &lt;br&gt; end;&lt;br&gt; &lt;br&gt; &lt;br&gt; &lt;u&gt;&lt;font size=&quot;4&quot;&gt;&lt;br&gt; The Registry&lt;br&gt; &lt;/font&gt;&lt;/u&gt;&lt;font size=&quot;4&quot;&gt;&lt;/font&gt;&lt;font size=&quot;4&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;4&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;br&gt; &lt;br&gt; 1.Reading from the registry&lt;br&gt; &lt;br&gt; &lt;/font&gt;&lt;/font&gt; &lt;ol&gt;&lt;br&gt;&lt;/ol&gt; In this example we&amp;#39;ll tell delphi to show us were the windows wallpapers are hidden&lt;br&gt; &lt;br&gt; &lt;ol&gt;&lt;/ol&gt; &lt;u&gt;&lt;font size=&quot;4&quot;&gt;&lt;/font&gt;&lt;/u&gt;uses Registry;&lt;br&gt; &lt;br&gt; var&lt;br&gt; reg :TRegistry;&lt;br&gt; begin&lt;br&gt; &lt;br&gt; &lt;font color=&quot;#ffffff&quot; face=&quot;Verdana&quot; size=&quot;3&quot;&gt; Reg:=TRegistry.Create;        //Create an instance of the registry&lt;br&gt; Reg.RootKey:=HKEY_LOCAL_MACHINE;  //Set the root key&lt;br&gt; Reg.OpenKey(&amp;#39;Software\Microsoft\Windows\CurrentVersion&amp;#39;, False); //Open the key, the last paramater indicates                          //that if the key doesn&amp;#39;t exist, it should be                          //created. In this case, false&lt;br&gt; ShowMessage(  &lt;u&gt;Reg.ReadString&lt;/u&gt;  (&amp;#39;WallPaperDir&amp;#39;)); //Show it in messagebox&lt;br&gt; Reg.Free;   //Always free your registry afterwards&lt;br&gt; &lt;br&gt; end;&lt;br&gt; &lt;br&gt; &lt;br&gt; &lt;br&gt; 2.Writing to the registry&lt;br&gt; &lt;br&gt; &lt;br&gt; In this example we&amp;#39;ll write our name into the registry&lt;br&gt; &lt;br&gt; uses registry;&lt;br&gt; &lt;br&gt; var&lt;br&gt; reg :TRegistry;&lt;br&gt; begin&lt;br&gt; Reg:=Tregistry.Create;&lt;br&gt; Reg.Rootkey:=HKEY_LOCAL_MACHINE;&lt;br&gt; Reg.Openkey(&amp;#39;DelphiCoding\MyInfo&amp;#39;, True); //Note that we set it to true, meaning we WANT to create the path&lt;br&gt; &lt;br&gt; &lt;/font&gt;&lt;font color=&quot;#ffffff&quot; face=&quot;Verdana&quot; size=&quot;3&quot;&gt;&lt;u&gt; Reg.WriteString&lt;/u&gt; (&amp;#39;MyName&amp;#39;,InputBox(&amp;#39;Write to Reg:&amp;#39;,&amp;#39;What&amp;#39;&amp;#39;s your name?&amp;#39;,&amp;#39;&amp;#39;));&lt;br&gt; //       !           !&lt;br&gt; //     The key name     The Data (whatever you put into the inputbox)&lt;br&gt; reg.free;&lt;br&gt; end;&lt;/font&gt;&lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item><item><title>Main</title><link>http://themoddoctor.wetpaint.com/page/Main</link><author>TheModDoctor</author><guid isPermaLink="false">http://themoddoctor.wetpaint.com/page/Main</guid><pubDate>Tue, 19 Jun 2007 08:19:23 CDT</pubDate><description> 				&lt;div align=&quot;center&quot;&gt;&lt;u&gt;&lt;font face=&quot;Arial&quot; size=&quot;6&quot;&gt;Welcome to TheModDoctor&amp;#39;s site&lt;br&gt;&lt;/font&gt;&lt;/u&gt;&lt;div align=&quot;left&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div align=&quot;center&quot;&gt;In time I will upgrade my site with Tutorials for Modding Call of Duty 2. Please be patient.&lt;br&gt;&lt;br&gt;But, In the mean time, I will have some source code for Borland Delphi 7.&lt;br&gt;&lt;a href=&quot;http://themoddoctor.wetpaint.com/page/Delphi+Source+Code&quot; target=&quot;_top&quot;&gt;Click Here&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item></channel></rss>