<!--/*SC*/DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"/*EC*/-->
<html><head><title></title><style type="text/css"><!--body{padding:1ex;margin:0px;font-family:sans-serif;font-size:small;}a[href]{color:-moz-hyperlinktext !important;text-decoration:-moz-anchor-decoration;}blockquote{margin:0;border-left:2px solid #144fae;padding-left:1em;}blockquote blockquote{border-color:#006312;}blockquote blockquote blockquote{border-color:#540000;}--></style></head><body><div style="font-family: Arial; font-size: medium;" dir="ltr"><div class="defangedMessage">
<div id="me19021">
<div>Hi Tony, </div>
<div>&nbsp;</div>
<div>Thanks for the wxPython code. My reason for wanting to avoid wxPython (and pyQt) is that I don't want to ship the wxPython framework just to display a splash screen. I believe this might triple the size of my PY2EXE generated executables - not a worthwhile tradeoff for a cosmetic feature like a splash screen.</div>
<div>&nbsp;</div>
<div>Regards,</div>
<div>Malcolm</div>
<div>&nbsp;</div>
<div>----- Original message -----</div>
<div>From: &quot;Tony Cappellini&quot; &lt;cappy2112@gmail.com&gt;</div>
<div>To: python-win32@python.org</div>
<div>Cc: python@bdurham.com</div>
<div>Date: Mon, 22 Mar 2010 15:47:47 -0700</div>
<div>Subject: Re:Win API call to display a BMP/PNG file as a splash screen for a         console app?</div>
<div>From: <a href="mailto:python@bdurham.com">python@bdurham.com</a><br>
To: &quot;zz Python Win32 Newsgroup&quot; &lt;<a href="mailto:python-win32@python.org">python-win32@python.org</a>&gt;<br>
Subject: [python-win32] Win API call to display a BMP/PNG file as a<br>
&nbsp; &nbsp; &nbsp; &nbsp;splash screen for a console app?<br>
Message-ID: &lt;<a href="mailto:1269295703.32357.1366163877@webmail.messagingengine.com">1269295703.32357.1366163877@webmail.messagingengine.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;us-ascii&quot;<br>
<br>
&gt;&gt;Is there a Windows API call I can use to display a BMP or a PNG<br>
&gt;&gt;file in a window centered on a user's display? This function<br>
&gt;&gt;would be called from a console app to display a splash screen.<br>
<br>
I don't know, but I suspect not.</div>
<div><br>
&gt;&gt;complexity of a full GUI framework like wxPython or pyQT and<br>
To do this in wxPython is approximately 10 lines of code, maybe 20 at the most.<br>
Actually- the # of lines to do this in wxPython is less than your original email.<br>
<br>
<br>
class SketchApp(wx.App):<br>
<br>
&nbsp;&nbsp;&nbsp; def OnInit(self):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bmp = wx.Image(&quot;splash.png&quot;).ConvertToBitmap()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wx.SplashScreen(bmp, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1000, None, -1)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wx.Yield()<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frame = SketchFrame(None)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frame.Show(True)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.SetTopWindow(frame)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return True<br>
<br>
if __name__ == '__main__':<br>
&nbsp;&nbsp;&nbsp; app = SketchApp(False)<br>
&nbsp;&nbsp;&nbsp; app.MainLoop()<br>
<br>
<br>
This is barebones, taken from wxPython In Action- ideally you should have some minimal exception handling<br>
to make your app more robust.</div>
</div>
</div></div></body></html>