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

<channel>
	<title>simra &#187; C++</title>
	<atom:link href="http://www.simra.ch/category/c-plus-plus/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.simra.ch</link>
	<description>development &#38; design</description>
	<lastBuildDate>Fri, 26 Mar 2010 15:57:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Code::Blocks and SQLite3</title>
		<link>http://www.simra.ch/2010/02/codeblocks-and-sqlite3/</link>
		<comments>http://www.simra.ch/2010/02/codeblocks-and-sqlite3/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 21:47:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[dlltool]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[wxwidgets]]></category>

		<guid isPermaLink="false">http://www.simra.ch/?p=1177</guid>
		<description><![CDATA[This is a little tutorial of how to use SQLite with Code::Blocks. It is assumed that you have already installed Code::Blocks with MinGW.

This is the way I did it:
1. Download sqlitedll-3_6_22.zip and sqlite-source-3_6_22.zip from http://www.sqlite.org/download.html
2. Extract sqlitedll-3.6.22.zip and then run from the command line:
dlltool -D sqlite3.dll -d sqlite3.def -l libsqlite3dll.a
You will now have libsqlite3dll.a, which [...]]]></description>
			<content:encoded><![CDATA[<p>This is a little tutorial of how to use SQLite with Code::Blocks. It is assumed that you have already installed Code::Blocks with MinGW.<br />
<span id="more-1177"></span><br />
This is the way I did it:</p>
<p>1. Download sqlitedll-3_6_22.zip and sqlite-source-3_6_22.zip from <a href="http://www.sqlite.org/download.html">http://www.sqlite.org/download.html</a></p>
<p>2. Extract sqlitedll-3.6.22.zip and then run from the command line:</p>
<blockquote><p>dlltool -D sqlite3.dll -d sqlite3.def -l libsqlite3dll.a</p></blockquote>
<p>You will now have libsqlite3dll.a, which should be placed in the MinGW lib directory.</p>
<p>3. Place sqlite3.dll in your system path.</p>
<p>4. Extract sqlite-source-3_6_22.zip and place sqlite3.h in your MinGW include directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simra.ch/2010/02/codeblocks-and-sqlite3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++ Installations-Assistent</title>
		<link>http://www.simra.ch/2009/11/installations-assistent/</link>
		<comments>http://www.simra.ch/2009/11/installations-assistent/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 10:33:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[bmFinanz]]></category>
		<category><![CDATA[Client]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Visual FoxPro]]></category>

		<guid isPermaLink="false">http://www.simra.ch/?p=538</guid>
		<description><![CDATA[Ein einfacher Installations-Assistent, der bei bedarf Daten vom Internet holt, diese entpackt, gegebenenfalls Systemdateien registriert und wenn alles in Ordnung ist die Software startet.]]></description>
			<content:encoded><![CDATA[<p>Ein einfacher Installations-Assistent, der bei bedarf Daten vom Internet holt, diese entpackt, gegebenenfalls Systemdateien registriert und wenn alles in Ordnung ist die Software startet.<br />
<span id="more-538"></span></p>
<p><a href="http://www.simra.ch/wordpress/../uploads/cinstaller.jpg"><img class="alignnone size-full wp-image-542" title="cinstaller" src="http://www.simra.ch/wordpress/../uploads/cinstaller.jpg" alt="cinstaller" width="445" height="165" /></a></p>
<blockquote><p>Der Assistent wurde für die Software <a href="http://www.bmfinanz.ch">bmFinanz</a> entwickelt, welches auf Visual FoxPro basiert und deshalb abhängig von der Microsoft Visual FoxPro Library bez. einem Client ist. Mit diesem C++ Programm kann die Software immer und überall gestartet werden, unabhängig davon, ob ein Client installiert wurde oder nicht.</p></blockquote>
<p>Hier der komplette C++ Code. Das Programm wurde mit Dev-C++ 4.9.9.0 geschrieben.</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339900;">#include &lt;windows.h&gt;</span><br />
<span style="color: #339900;">#include &lt;sys/stat.h&gt;</span><br />
<span style="color: #339900;">#include &lt;iostream&gt;</span><br />
<span style="color: #339900;">#include &lt;string&gt;</span><br />
<br />
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span> <span style="color: #666666;">// translate std:: </span><br />
<span style="color: #339900;">#define IDC_MAIN_EDIT 101 // ID of textbox</span><br />
<br />
<span style="color: #ff0000; font-style: italic;">/* &nbsp;Declare Windows procedure &nbsp;*/</span><br />
LRESULT CALLBACK WindowProcedure <span style="color: #008000;">&#40;</span>HWND, UINT, WPARAM, LPARAM<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
<span style="color: #0000ff;">void</span> CenterWindow <span style="color: #008000;">&#40;</span>HWND<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<span style="color: #0000ff;">bool</span> existsFile <span style="color: #008000;">&#40;</span>string<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<span style="color: #0000ff;">void</span> proto <span style="color: #008000;">&#40;</span>string<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<span style="color: #0000ff;">void</span> downloadFile <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">char</span><span style="color: #000040;">*</span>,<span style="color: #0000ff;">char</span><span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<span style="color: #0000ff;">void</span> loader<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">char</span><span style="color: #000040;">*</span>,<span style="color: #0000ff;">bool</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
<span style="color: #ff0000; font-style: italic;">/* &nbsp;Make the class name into a global variable &nbsp;*/</span><br />
<span style="color: #0000ff;">char</span> szClassName<span style="color: #008000;">&#91;</span> <span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;WindowsApp&quot;</span><span style="color: #008080;">;</span><br />
HWND hwnd<span style="color: #008080;">;</span><br />
<br />
<span style="color: #0000ff;">int</span> WINAPI WinMain <span style="color: #008000;">&#40;</span>HINSTANCE hThisInstance,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HINSTANCE hPrevInstance,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LPSTR lpszArgument,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">int</span> nFunsterStil<span style="color: #008000;">&#41;</span><br />
<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; MSG messages<span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000; font-style: italic;">/* Here messages to the application are saved */</span><br />
&nbsp; &nbsp; WNDCLASSEX wincl<span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000; font-style: italic;">/* Data structure for the windowclass */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* The Window structure */</span><br />
&nbsp; &nbsp; wincl.<span style="color: #007788;">hInstance</span> <span style="color: #000080;">=</span> hThisInstance<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; wincl.<span style="color: #007788;">lpszClassName</span> <span style="color: #000080;">=</span> szClassName<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; wincl.<span style="color: #007788;">lpfnWndProc</span> <span style="color: #000080;">=</span> WindowProcedure<span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp;<span style="color: #ff0000; font-style: italic;">/* This function is called by windows */</span><br />
&nbsp; &nbsp; wincl.<span style="color: #007788;">style</span> <span style="color: #000080;">=</span> CS_DBLCLKS<span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* Catch double-clicks */</span><br />
&nbsp; &nbsp; wincl.<span style="color: #007788;">cbSize</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">sizeof</span> <span style="color: #008000;">&#40;</span>WNDCLASSEX<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* Use default icon and mouse-pointer */</span><br />
&nbsp; &nbsp; wincl.<span style="color: #007788;">hIcon</span> <span style="color: #000080;">=</span> LoadIcon <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">NULL</span>, IDI_APPLICATION<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; wincl.<span style="color: #007788;">hIconSm</span> <span style="color: #000080;">=</span> LoadIcon <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">NULL</span>, IDI_APPLICATION<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; wincl.<span style="color: #007788;">hCursor</span> <span style="color: #000080;">=</span> LoadCursor <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">NULL</span>, IDC_ARROW<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; wincl.<span style="color: #007788;">lpszMenuName</span> <span style="color: #000080;">=</span> <span style="color: #0000ff;">NULL</span><span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* No menu */</span><br />
&nbsp; &nbsp; wincl.<span style="color: #007788;">cbClsExtra</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000; font-style: italic;">/* No extra bytes after the window class */</span><br />
&nbsp; &nbsp; wincl.<span style="color: #007788;">cbWndExtra</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000; font-style: italic;">/* structure or the window instance */</span><br />
&nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* Use Windows's default color as the background of the window */</span><br />
&nbsp; &nbsp; wincl.<span style="color: #007788;">hbrBackground</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>HBRUSH<span style="color: #008000;">&#41;</span> COLOR_BACKGROUND<span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* Register the window class, and if it fails quit the program */</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #000040;">!</span>RegisterClassEx <span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>wincl<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* The class is registered, let's create the program*/</span><br />
&nbsp; &nbsp; hwnd <span style="color: #000080;">=</span> CreateWindowEx <span style="color: #008000;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000dd;">0</span>, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* Extended possibilites for variation */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;szClassName, &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* Classname */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #FF0000;">&quot;bmFinanz Installer&quot;</span>,<span style="color: #ff0000; font-style: italic;">/* Title Text */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WS_OVERLAPPEDWINDOW, <span style="color: #ff0000; font-style: italic;">/* default window */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CW_USEDEFAULT, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* Windows decides the position */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CW_USEDEFAULT, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* where the window ends up on the screen */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000dd;">544</span>, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* The programs width */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000dd;">200</span>, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* and height in pixels */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HWND_DESKTOP, &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000; font-style: italic;">/* The window is a child-window to desktop */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">NULL</span>, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000; font-style: italic;">/* No menu */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hThisInstance, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* Program Instance handler */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">NULL</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* No Window Creation data */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000ff;">bool</span> err <span style="color: #000080;">=</span> <span style="color: #0000ff;">false</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">!</span>existsFile<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;vfp7r.dll&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #000040;">||!</span>existsFile<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;vfp7rdeu.dll&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #000040;">||!</span>existsFile<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;msvcr70.dll&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #000040;">||!</span>existsFile<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;main000.exe&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CenterWindow<span style="color: #008000;">&#40;</span>hwnd<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ShowWindow <span style="color: #008000;">&#40;</span>hwnd, nFunsterStil<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proto<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;Downloading bmFinanz....&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000dd;">remove</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;buclient.exe&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;downloadFile<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;http://www.bm-informatik.ch/update_buha/buclient.e00&quot;</span>,<span style="color: #FF0000;">&quot;buclient.e00&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">rename</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;buclient.e00&quot;</span>, <span style="color: #FF0000;">&quot;buclient.exe&quot;</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proto<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>bmFinanz wird installiert....&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loader<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;buclient.exe -y&quot;</span>,<span style="color: #0000ff;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000dd;">remove</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;buclient.exe&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proto<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>Downloading Updates....&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000dd;">remove</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;kom07.exe&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; downloadFile<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;http://www.bm-informatik.ch/update_buha/kom07.e00&quot;</span>,<span style="color: #FF0000;">&quot;kom07.e00&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">rename</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;kom07.e00&quot;</span>, <span style="color: #FF0000;">&quot;kom07.exe&quot;</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proto<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>Update wird installiert....&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loader<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;kom07.exe -y&quot;</span>,<span style="color: #0000ff;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000dd;">remove</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;kom07.exe&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><span style="color: #0000ff;">else</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proto<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>Fehler beim Umbenennen der Datei....&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; err<span style="color: #000080;">=</span><span style="color: #0000ff;">true</span><span style="color: #008080;">;</span> &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">&#125;</span><span style="color: #0000ff;">else</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proto<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>Fehler beim Umbenennen der Datei....&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; err<span style="color: #000080;">=</span><span style="color: #0000ff;">true</span><span style="color: #008080;">;</span> &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span> <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span> &nbsp;<span style="color: #000040;">!</span>err<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; loader<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;REGSVR32.EXE vfp7r.dll /s&quot;</span>,<span style="color: #0000ff;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; loader<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;REGSVR32.EXE vfp7rdeu.dll /s&quot;</span>,<span style="color: #0000ff;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; loader<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;REGSVR32.EXE MSCOMCTL.OCX /s&quot;</span>,<span style="color: #0000ff;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; WinExec<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;main000.exe&quot;</span>,SW_SHOW<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* Close the window */</span><br />
&nbsp; &nbsp; PostQuitMessage <span style="color: #008000;">&#40;</span>0<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* Run the message loop. It will run until GetMessage() returns 0 */</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">while</span> <span style="color: #008000;">&#40;</span>GetMessage <span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>messages, <span style="color: #0000ff;">NULL</span>, <span style="color: #0000dd;">0</span>, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* Translate virtual-key messages into character messages */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; TranslateMessage<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>messages<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* Send message to WindowProcedure */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; DispatchMessage<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>messages<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* The program return-value is 0 - The value that PostQuitMessage() gave */</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> messages.<span style="color: #007788;">wParam</span><span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span><br />
<br />
<span style="color: #ff0000; font-style: italic;">/* &nbsp;This function is called by the Windows function DispatchMessage() &nbsp;*/</span><br />
<br />
LRESULT CALLBACK WindowProcedure <span style="color: #008000;">&#40;</span>HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">switch</span> <span style="color: #008000;">&#40;</span>message<span style="color: #008000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000; font-style: italic;">/* handle the messages */</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> WM_CREATE<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; HFONT hfDefault<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; HWND hEdit<span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; hEdit <span style="color: #000080;">=</span> CreateWindowEx<span style="color: #008000;">&#40;</span>WS_EX_CLIENTEDGE, <span style="color: #FF0000;">&quot;EDIT&quot;</span>, <span style="color: #FF0000;">&quot;&quot;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; WS_CHILD <span style="color: #000040;">|</span> WS_VISIBLE <span style="color: #000040;">|</span> WS_VSCROLL <span style="color: #000040;">|</span> WS_HSCROLL <span style="color: #000040;">|</span> ES_MULTILINE <span style="color: #000040;">|</span> ES_AUTOVSCROLL <span style="color: #000040;">|</span> ES_AUTOHSCROLL, <br />
&nbsp; &nbsp; &nbsp; &nbsp; 0, 0, 100, 100, hwnd, <span style="color: #008000;">&#40;</span>HMENU<span style="color: #008000;">&#41;</span>IDC_MAIN_EDIT, GetModuleHandle<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">NULL</span><span style="color: #008000;">&#41;</span>, <span style="color: #0000ff;">NULL</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>hEdit <span style="color: #000080;">==</span> <span style="color: #0000ff;">NULL</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style="color: #008000;">&#40;</span>hwnd, <span style="color: #FF0000;">&quot;Could not create edit box.&quot;</span>, <span style="color: #FF0000;">&quot;Error&quot;</span>, MB_OK <span style="color: #000040;">|</span> MB_ICONERROR<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; hfDefault <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>HFONT<span style="color: #008000;">&#41;</span>GetStockObject<span style="color: #008000;">&#40;</span>DEFAULT_GUI_FONT<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; SendMessage<span style="color: #008000;">&#40;</span>hEdit, WM_SETFONT, <span style="color: #008000;">&#40;</span>WPARAM<span style="color: #008000;">&#41;</span>hfDefault, MAKELPARAM<span style="color: #008000;">&#40;</span>FALSE, 0<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> WM_SIZE<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; HWND hEdit<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; RECT rcClient<span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; GetClientRect<span style="color: #008000;">&#40;</span>hwnd, <span style="color: #000040;">&amp;</span>rcClient<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; hEdit <span style="color: #000080;">=</span> GetDlgItem<span style="color: #008000;">&#40;</span>hwnd, IDC_MAIN_EDIT<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; SetWindowPos<span style="color: #008000;">&#40;</span>hEdit, <span style="color: #0000ff;">NULL</span>, 0, 0, rcClient.<span style="color: #007788;">right</span>, rcClient.<span style="color: #007788;">bottom</span>, SWP_NOZORDER<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">case</span> WM_DESTROY<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PostQuitMessage <span style="color: #008000;">&#40;</span>0<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* send a WM_QUIT to the message queue */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">default</span><span style="color: #008080;">:</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000; font-style: italic;">/* for messages that we don't deal with */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">return</span> DefWindowProc <span style="color: #008000;">&#40;</span>hwnd, message, wParam, lParam<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span><br />
<br />
<br />
<span style="color: #0000ff;">void</span> proto<span style="color: #008000;">&#40;</span>string s<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; HWND hEdit <span style="color: #000080;">=</span> GetDlgItem<span style="color: #008000;">&#40;</span>hwnd, IDC_MAIN_EDIT<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">int</span> nLen <span style="color: #000080;">=</span> GetWindowTextLength <span style="color: #008000;">&#40;</span>hEdit<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <br />
&nbsp; &nbsp; <span style="color: #0000ff;">int</span> nLen2 <span style="color: #000080;">=</span> s.<span style="color: #007788;">length</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000ff;">char</span><span style="color: #000040;">*</span> buffer <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> <span style="color: #0000ff;">char</span><span style="color: #008000;">&#91;</span>nLen<span style="color: #000040;">+</span>nLen2<span style="color: #000040;">+</span>1<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span> <br />
&nbsp; &nbsp; GetWindowText<span style="color: #008000;">&#40;</span>hEdit, buffer, nLen<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>nLen<span style="color: #000080;">&gt;</span>0<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000dd;">strcat</span><span style="color: #008000;">&#40;</span>buffer,s.<span style="color: #007788;">c_str</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; SetWindowText<span style="color: #008000;">&#40;</span>hEdit, buffer<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><span style="color: #0000ff;">else</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; SetWindowText<span style="color: #008000;">&#40;</span>hEdit, s.<span style="color: #007788;">c_str</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; UpdateWindow<span style="color: #008000;">&#40;</span>hwnd<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">//refresh &nbsp; &nbsp; &nbsp; </span><br />
<span style="color: #008000;">&#125;</span> &nbsp; &nbsp;<br />
<br />
<span style="color: #0000ff;">void</span> loader<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">char</span> szArgs<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span>, <span style="color: #0000ff;">bool</span> hiden<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; STARTUPINFO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;si <span style="color: #000080;">=</span> <span style="color: #008000;">&#123;</span> <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>si<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; PROCESS_INFORMATION &nbsp;pi<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>hiden<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; si.<span style="color: #007788;">dwFlags</span> <span style="color: #000080;">=</span> STARTF_USESHOWWINDOW or STARTF_USESTDHANDLES<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; si.<span style="color: #007788;">wShowWindow</span> <span style="color: #000080;">=</span> SW_HIDE<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span> &nbsp; &nbsp;<br />
&nbsp;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>CreateProcess<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">NULL</span>, szArgs, <span style="color: #0000dd;">0</span>, <span style="color: #0000dd;">0</span>, FALSE, <span style="color: #0000dd;">0</span>, <span style="color: #0000dd;">0</span>, <span style="color: #0000dd;">0</span>, LPSTARTUPINFOA<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>si<span style="color: #008000;">&#41;</span>, <span style="color: #000040;">&amp;</span>pi<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// optionally wait for process to finish</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; WaitForSingleObject<span style="color: #008000;">&#40;</span>pi.<span style="color: #007788;">hProcess</span>, INFINITE<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CloseHandle<span style="color: #008000;">&#40;</span>pi.<span style="color: #007788;">hProcess</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; CloseHandle<span style="color: #008000;">&#40;</span>pi.<span style="color: #007788;">hThread</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span><br />
<br />
<br />
<br />
<br />
<span style="color: #0000ff;">void</span> CenterWindow <span style="color: #008000;">&#40;</span>HWND hwnd<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; RECT rc<span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; GetWindowRect<span style="color: #008000;">&#40;</span>hwnd,<span style="color: #000040;">&amp;</span>rc<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">int</span> nWidth <span style="color: #000080;">=</span> rc.<span style="color: #007788;">right</span> <span style="color: #000040;">-</span> rc.<span style="color: #007788;">left</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">int</span> nHeight <span style="color: #000080;">=</span> rc.<span style="color: #007788;">bottom</span> <span style="color: #000040;">-</span> rc.<span style="color: #007788;">top</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">int</span> X <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span><span style="color: #008000;">&#41;</span> GetSystemMetrics<span style="color: #008000;">&#40;</span>SM_CXFULLSCREEN<span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> nWidth<span style="color: #008000;">&#41;</span> <span style="color: #000040;">/</span><span style="color: #0000dd;">2</span><span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// center window horizontally</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">int</span> Y <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span><span style="color: #008000;">&#41;</span> GetSystemMetrics<span style="color: #008000;">&#40;</span>SM_CYFULLSCREEN<span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> nHeight<span style="color: #008000;">&#41;</span> <span style="color: #000040;">/</span><span style="color: #0000dd;">2</span><span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp;<span style="color: #666666;">// and vertically</span><br />
&nbsp; &nbsp; &nbsp; MoveWindow<span style="color: #008000;">&#40;</span>hwnd,X,Y,nWidth,nHeight,TRUE<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span><br />
<br />
<br />
<span style="color: #0000ff;">void</span> downloadFile<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">char</span><span style="color: #000040;">*</span> url, <span style="color: #0000ff;">char</span><span style="color: #000040;">*</span> fileName<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span> &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000ff;">typedef</span> <span style="color: #0000ff;">int</span> <span style="color: #000040;">*</span> <span style="color: #008000;">&#40;</span><span style="color: #000040;">*</span>URLDownloadToFileA<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000040;">*</span>,<span style="color: #0000ff;">char</span><span style="color: #000040;">*</span>,<span style="color: #0000ff;">char</span><span style="color: #000040;">*</span>,DWORD,<span style="color: #0000ff;">void</span><span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; HINSTANCE LibHnd <span style="color: #000080;">=</span> LoadLibrary<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;Urlmon.dll&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; URLDownloadToFileA URLDownloadToFile <span style="color: #000080;">=</span> &nbsp;<span style="color: #008000;">&#40;</span>URLDownloadToFileA<span style="color: #008000;">&#41;</span> GetProcAddress<span style="color: #008000;">&#40;</span>LibHnd,<span style="color: #FF0000;">&quot;URLDownloadToFileA&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; URLDownloadToFile<span style="color: #008000;">&#40;</span>0, url, fileName, 0, 0<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> &nbsp; &nbsp; &nbsp; &nbsp;<br />
<span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <br />
<br />
<br />
<span style="color: #0000ff;">bool</span> existsFile<span style="color: #008000;">&#40;</span>string strFilename<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">struct</span> stat stFileInfo<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">bool</span> blnReturn<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">int</span> intStat<span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666;">// Attempt to get the file attributes</span><br />
&nbsp; &nbsp; intStat <span style="color: #000080;">=</span> stat<span style="color: #008000;">&#40;</span>strFilename.<span style="color: #007788;">c_str</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>,<span style="color: #000040;">&amp;</span>stFileInfo<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>intStat <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// We were able to get the file attributes</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// so the file obviously exists.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; blnReturn <span style="color: #000080;">=</span> <span style="color: #0000ff;">true</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span> <span style="color: #0000ff;">else</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// We were not able to get the file attributes.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// This may mean that we don't have permission to</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// access the folder which contains this file. If you</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// need to do that level of checking, lookup the</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// return values of stat which will give you</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// more details on why stat failed.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; blnReturn <span style="color: #000080;">=</span> <span style="color: #0000ff;">false</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span> &nbsp;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span><span style="color: #008000;">&#40;</span>blnReturn<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.simra.ch/2009/11/installations-assistent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
