<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: ShowWindow</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2004/10/26/showwindow/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2004/10/26/showwindow/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Wed, 08 Feb 2012 23:58:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Jared</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/10/26/showwindow/#comment-34985</link>
		<dc:creator>Jared</dc:creator>
		<pubDate>Wed, 08 Oct 2008 13:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=830#comment-34985</guid>
		<description>&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Declare&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; FindWindow &lt;span class=&quot;kw1&quot;&gt;Lib&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;user32&quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Alias&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;FindWindowA&quot;&lt;/span&gt; (&lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; lpClassName &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;, &lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; lpWindowName &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;) &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Declare&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; ShowWindow &lt;span class=&quot;kw1&quot;&gt;Lib&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;user32&quot;&lt;/span&gt; (&lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; hwnd &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, &lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; nCmdShow &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;)&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; NetName_Click()&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; lHwnd &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; vncinstall = &lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;And&lt;/span&gt; NetName.Caption &#160;&lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; Shell &lt;span class=&quot;st0&quot;&gt;&quot;C:Program FilesRealVNCVNC4vncviewer &quot;&lt;/span&gt; &amp; NetName.Caption, vbNormalFocus&lt;br&gt;
&#160; &#160; Application.Wait (Now + TimeValue(&lt;span class=&quot;st0&quot;&gt;&quot;0:00:01&quot;&lt;/span&gt;))&lt;br&gt;
&#160; &#160; SendKeys &lt;span class=&quot;st0&quot;&gt;&quot;*****~&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; Application.Wait (Now + TimeValue(&lt;span class=&quot;st0&quot;&gt;&quot;0:00:02&quot;&lt;/span&gt;))&lt;br&gt;
&#160; &#160; lHwnd = FindWindow(vbNullString, NetName.Caption)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; lHwnd &#160;0 &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; ShowWindow lHwnd, 1&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039;Every time it gets to here I get a Runtime Error 49&lt;br&gt;
&lt;/span&gt; &#160; &#160; &#160; &#160;&lt;span class=&quot;co1&quot;&gt;&#039;Bad DLL calling convention &#160;&lt;br&gt;
&lt;/span&gt; &#160; &#160;&lt;span class=&quot;kw1&quot;&gt;Else&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; Beep&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Private</span> <span class="kw1">Declare</span> <span class="kw1">Function</span> FindWindow <span class="kw1">Lib</span> <span class="st0">&#8220;user32&#8243;</span> <span class="kw1">Alias</span> <span class="st0">&#8220;FindWindowA&#8221;</span> (<span class="kw1">ByVal</span> lpClassName <span class="kw1">As</span> <span class="kw1">String</span>, <span class="kw1">ByVal</span> lpWindowName <span class="kw1">As</span> <span class="kw1">String</span>) <span class="kw1">As</span> <span class="kw1">Long</span><br />
<span class="kw1">Private</span> <span class="kw1">Declare</span> <span class="kw1">Function</span> ShowWindow <span class="kw1">Lib</span> <span class="st0">&#8220;user32&#8243;</span> (<span class="kw1">ByVal</span> hwnd <span class="kw1">As</span> <span class="kw1">Long</span>, <span class="kw1">ByVal</span> nCmdShow <span class="kw1">As</span> <span class="kw1">Long</span>)</p>
<p><span class="kw1">Private</span> <span class="kw1">Sub</span> NetName_Click()<br />
<span class="kw1">Dim</span> lHwnd <span class="kw1">As</span> <span class="kw1">Long</span><br />
<span class="kw1">If</span> vncinstall = <span class="kw1">True</span> <span class="kw1">And</span> NetName.Caption &nbsp;<span class="st0">&#8220;&#8221;</span> <span class="kw1">Then</span><br />
&nbsp; &nbsp; Shell <span class="st0">&#8220;C:Program FilesRealVNCVNC4vncviewer &#8220;</span> &amp;amp; NetName.Caption, vbNormalFocus<br />
&nbsp; &nbsp; Application.Wait (Now + TimeValue(<span class="st0">&#8220;0:00:01&#8243;</span>))<br />
&nbsp; &nbsp; SendKeys <span class="st0">&#8220;*****~&#8221;</span><br />
&nbsp; &nbsp; Application.Wait (Now + TimeValue(<span class="st0">&#8220;0:00:02&#8243;</span>))<br />
&nbsp; &nbsp; lHwnd = FindWindow(vbNullString, NetName.Caption)<br />
&nbsp; &nbsp; <span class="kw1">If</span> lHwnd &nbsp;0 <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ShowWindow lHwnd, 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">&#8216;Every time it gets to here I get a Runtime Error 49<br />
</span> &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">&#8216;Bad DLL calling convention &nbsp;<br />
</span> &nbsp; &nbsp;<span class="kw1">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Beep<br />
&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
<span class="kw1">End</span> <span class="kw1">If</span><br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
</channel>
</rss>

