<div>Bingo That Worked.</div>
<div>&nbsp;</div>
<div>Thanks,</div>
<div>Tim<br></div>
<div class="gmail_quote">On Mon, Mar 17, 2008 at 11:25 PM, &lt;<a href="mailto:python-win32-request@python.org">python-win32-request@python.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Send python-win32 mailing list submissions to<br>&nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
<br>To subscribe or unsubscribe via the World Wide Web, visit<br>&nbsp; &nbsp; &nbsp; &nbsp;<a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br>or, via email, send a message with subject or body &#39;help&#39; to<br>
&nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:python-win32-request@python.org">python-win32-request@python.org</a><br><br>You can reach the person managing the list at<br>&nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:python-win32-owner@python.org">python-win32-owner@python.org</a><br>
<br>When replying, please edit your Subject line so it is more specific<br>than &quot;Re: Contents of python-win32 digest...&quot;<br><br><br>Today&#39;s Topics:<br><br>&nbsp; 1. Re: python-win32 Digest, Vol 60, Issue 26 (Tim Golden)<br>
&nbsp; 2. Re: Skip Alt+F4 (le dahut)<br>&nbsp; 3. Re: Running SQL queries on excel sheets (Rickey, Kyle W)<br>&nbsp; 4. Re: How to create a com_record? (Kevin Patterson)<br>&nbsp; 5. Confusion with &#39;SetForegroundWindow() (Scott Nelson)<br>
&nbsp; 6. python 2.5 (Tarun Kapoor)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Mon, 17 Mar 2008 11:51:01 +0000<br>From: Tim Golden &lt;<a href="mailto:mail@timgolden.me.uk">mail@timgolden.me.uk</a>&gt;<br>
Subject: Re: [python-win32] python-win32 Digest, Vol 60, Issue 26<br>Cc: <a href="mailto:python-win32@python.org">python-win32@python.org</a><br>Message-ID: &lt;<a href="mailto:47DE5B25.6070804@timgolden.me.uk">47DE5B25.6070804@timgolden.me.uk</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br><br>siddhartha veedaluru wrote:<br>&gt; Hi Tim,<br>&gt;<br>&gt; I tried the snippet you sent to me.<br>&gt; Same error.<br>&gt;<br>&gt; i opened the python shell and gave &quot;import wmi&quot;<br>
&gt; It give the same error.<br>&gt;<br>&gt; comobj._oleobj_.GetTypeInfo().GetContainingTypeLib()[0].GetTypeComp()<br>&gt; com_error: (-2147319779, &#39;Library not registered.&#39;, None, None)<br><br>Aha. That&#39;s what I wanted to know. (In fact, now I look<br>
at your original post, the same information&#39;s shown there.<br>Shame on me for not checking).<br><br>It *looks* as though one (or more) of the WMI DLLs which in<br>my system are in c:\windows\system32\wbem need to be reregistered.<br>
It might be something else, however. Can you try running<br><br>regsvr32.exe against the DLLs in (your equivalent of)<br>c:\windows\system32\wbem?<br><br>I&#39;m sorry this is so involved: I&#39;ve never encountered someone<br>
with this error before when running WMI.<br><br>TJG<br><br><br>------------------------------<br><br>Message: 2<br>Date: Mon, 17 Mar 2008 14:11:14 +0100<br>From: le dahut &lt;<a href="mailto:le.dahut@laposte.net">le.dahut@laposte.net</a>&gt;<br>
Subject: Re: [python-win32] Skip Alt+F4<br>To: Paul Moore &lt;<a href="mailto:p.f.moore@gmail.com">p.f.moore@gmail.com</a>&gt;<br>Cc: Python-Win32 List &lt;<a href="mailto:python-win32@python.org">python-win32@python.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:47DE6DF2.6050108@laposte.net">47DE6DF2.6050108@laposte.net</a>&gt;<br>Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br><br>Oh yes ! That&#39;s it. Thank you.<br><br>It is a frame that&#39;s used by a service to display some information<br>
before uncancelable forced reboot.<br><br>I now have to determinate how to modify the informations displayed in<br>the frame.<br><br>Should my program run in the class of the frame ? Or should it get a<br>sort of handler to the frame and modify the content of a text box ?<br>
I don&#39;t know if the second way is possible.<br><br>Paul Moore a ?crit :<br>&gt; On 17/03/2008, le dahut &lt;<a href="mailto:le.dahut@laposte.net">le.dahut@laposte.net</a>&gt; wrote:<br>&gt;&gt; I&#39;m writting a Wx app and I want to skip Alt+F4. I&#39;ve used somehting<br>
&gt;&gt; like that :<br>&gt;&gt; &nbsp; &nbsp; def OnKeyDown(self, event):<br>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; print event.AltDown(), event.GetKeyCode()<br>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; if event.AltDown() and event.GetKeyCode() == wx.WXK_F4:<br>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &#39;try to close&#39;<br>
&gt;&gt;<br>&gt;&gt; Everything gets printed but my app closes anyway on Alt+F4, is there a<br>&gt;&gt; way to skip this ?<br>&gt;<br>&gt; (a) you should think hard before doing this - about the only<br>&gt; reasonable reason for overriding the standard Alt-F4 on Windows, is to<br>
&gt; minimise to the tray rather than closing<br>&gt;<br>&gt; (b) if you still want to do this, look at the OnClose event, and override that.<br>&gt;<br>&gt; Paul.<br>&gt;<br>&gt;<br><br><br>------------------------------<br>
<br>Message: 3<br>Date: Mon, 17 Mar 2008 08:40:45 -0500<br>From: &quot;Rickey, Kyle W&quot; &lt;<a href="mailto:Kyle.Rickey@bakerhughes.com">Kyle.Rickey@bakerhughes.com</a>&gt;<br>Subject: Re: [python-win32] Running SQL queries on excel sheets<br>
To: &lt;<a href="mailto:python-win32@python.org">python-win32@python.org</a>&gt;<br>Message-ID:<br>&nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="mailto:E369D273B0E6904EA8D4A952BA05953C07DD323B@MSGCLAMBX.ent.bhicorp.com">E369D273B0E6904EA8D4A952BA05953C07DD323B@MSGCLAMBX.ent.bhicorp.com</a>&gt;<br>
Content-Type: text/plain; &nbsp; &nbsp; &nbsp; charset=&quot;us-ascii&quot;<br><br>Thanks John, I&#39;ll check that out.<br><br>-Kyle Rickey<br><br>-----Original Message-----<br>From: John Machin [mailto:<a href="mailto:sjmachin@lexicon.net">sjmachin@lexicon.net</a>]<br>
Sent: Sunday, March 16, 2008 4:40 AM<br>To: Rickey, Kyle W<br>Cc: <a href="mailto:python-win32@python.org">python-win32@python.org</a><br>Subject: Re: [python-win32] Running SQL queries on excel sheets<br><br>Rickey, Kyle W wrote:<br>
&gt; Tim, thanks for your response. I&#39;ve got 7 excel files that need<br>reading<br>&gt; containing a total of ~6100 rows. I agree, about this code making me<br>&gt; sick :)<br><br>That&#39;s not exactly &quot;absolutely tons of data&quot; :-)<br>
<br>One problem with the ODBC approach to reading spreadsheets (at least<br>with the MS Excel ODBC driver) is that it examines a limited number<br>(e.g. 8 or 10) of rows to determine what type a column is. So the first<br>
10 rows have floats in column X then Noddy&#39;s managed to get some text in<br><br>cell X11 which is a fatal error for ODBC -- you can&#39;t continue.<br><br>[snip]<br><br>&gt; Obviously, all that is only helpful up to a point. Is there some<br>
&gt; reason why you can&#39;t just pull the data out straight into Python<br>&gt; structures and take it from there (or even push it into a Sqlite<br>&gt; memory database)? Perhaps you&#39;ve got absolutely tons of data so<br>
&gt; extracting it would be a pain? If not, consider using one of<br>&gt; the COM packages (win32com.client or comtypes) or something like<br>&gt; pyExcelerator to pull it out.<br>&gt; &lt;/more helpful&gt;<br><br>Consider the xlrd package (<a href="http://www.lexicon.net/sjmachin/xlrd.htm" target="_blank">http://www.lexicon.net/sjmachin/xlrd.htm</a>).<br>
It&#39;ll tell you what type the data is cell-by-cell -- you can then<br>compare that with your expectations.<br><br>HTH,<br>John<br><br><br><br><br>------------------------------<br><br>Message: 4<br>Date: Mon, 17 Mar 2008 12:18:26 -0400<br>
From: &quot;Kevin Patterson&quot; &lt;<a href="mailto:patter001@gmail.com">patter001@gmail.com</a>&gt;<br>Subject: Re: [python-win32] How to create a com_record?<br>To: <a href="mailto:mhammond@skippinet.com.au">mhammond@skippinet.com.au</a><br>
Cc: Python-Win32 List &lt;<a href="mailto:python-win32@python.org">python-win32@python.org</a>&gt;<br>Message-ID:<br>&nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="mailto:a41467040803170918t5071e46bq160cb0e164b2d256@mail.gmail.com">a41467040803170918t5071e46bq160cb0e164b2d256@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br><br>In case it helps, here&#39;s the overall description of the COM/app and what how<br>this function fits: &quot;COM_App&quot; is a typelib (with multiple classes) for<br>
interfacing to an application that controls hardware on a USB port. When<br>multiple applications are started it becomes impossible for users to write<br>code for accessing a particular instance of the app, therefore a manager com<br>
&quot;COM_Manager&quot; was created. There are two important level of the COM_Manager.<br>The first call gets you an object representing the particular application<br>(Its not really &quot;COM_App&quot; per-se, its just another object that handles that<br>
app). Then there is &nbsp;&quot;SomeFunction&quot; below, it gives you the particular class<br>for the particular COM_App. That is why it is takes a GUID as a parameter.<br><br>I&#39;m still learning about the details of the COM, I guess VT_RECORD &nbsp;is sort<br>
of the standard way of passing any structure information back and forth? My<br>email access for the first half of the week is fairly limited but I&#39;ll still<br>try to learn my way around the test harness to see if I can create an<br>
example.<br><br>On Sat, Mar 15, 2008 at 12:54 PM, Mark Hammond &lt;<a href="mailto:skippy.hammond@gmail.com">skippy.hammond@gmail.com</a>&gt;<br>wrote:<br><br>&gt; Just to clarify:<br>&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; HRESULT SomeFunction( [in] GUID* pGuid, [out, retval,<br>
&gt; iid_is(pGuid)]<br>&gt; IUnknown** ppUnknown);<br>&gt;<br>&gt; &gt; &nbsp; &nbsp; &nbsp; win32com says that it needs a VT_RECORD in order to pass the GUID<br>&gt; information<br>&gt; &gt; to the COM. But from previous email exchanges I can&#39;t just deifne some<br>
&gt; GUID<br>&gt;<br>&gt; My understanding is that the IDispatch implementation of this method<br>&gt; declares that it wants a VT_RECORD - which win32com is trying to comply<br>&gt; with.<br>&gt;<br>&gt; When I get back home, my approach will be to simply try and repro the<br>
&gt; issue<br>&gt; in the win32com test suite, which will at least give me a clearer picture<br>&gt; of<br>&gt; what is happening. &nbsp;If Kevin could take some steps towards this it would<br>&gt; help.<br>&gt;<br>&gt; Cheers,<br>
&gt;<br>&gt; Mark<br>&gt;<br>&gt;<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://mail.python.org/pipermail/python-win32/attachments/20080317/a1a03bc2/attachment-0001.htm" target="_blank">http://mail.python.org/pipermail/python-win32/attachments/20080317/a1a03bc2/attachment-0001.htm</a><br>
<br>------------------------------<br><br>Message: 5<br>Date: Mon, 17 Mar 2008 12:09:32 -0500<br>From: &quot;Scott Nelson&quot; &lt;<a href="mailto:sirgnip@gmail.com">sirgnip@gmail.com</a>&gt;<br>Subject: [python-win32] Confusion with &#39;SetForegroundWindow()<br>
To: <a href="mailto:python-win32@python.org">python-win32@python.org</a><br>Message-ID:<br>&nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="mailto:2682ac9b0803171009h25213a3bsbd55b93760bbf988@mail.gmail.com">2682ac9b0803171009h25213a3bsbd55b93760bbf988@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br><br>Greets...<br><br>I&#39;m looking to use the win32api and win32gui modules to do a bit of<br>Windows tinkering (win2k, ActiveState&#39;s Python 2.4.1 distribution) and<br>
I&#39;ve hit a snag.<br><br>I&#39;d like to have my process/window &quot;steal&quot; the focus from whatever<br>window currently has it, get a bit of input from the keyboard, and<br>then restore the focus back to the original window.<br>
<br>In simple cases win32gui.SetForegroundWindow(hwnd) seems to be what<br>I&#39;m looking for. &nbsp;It works fine when I simply try to set focus to<br>another window from my app.<br><br>But, I&#39;m seeing unexpected behavior when I go beyond that. &nbsp;I wrote a<br>
simple test script that enumerates through all visible windows and<br>tries to give each one the focus in turn, after a short delay. &nbsp;It<br>gets through 1-2 windows out of the 8-10 non-minimized windows I have<br>open (IE, notepad, wordpad, etc.) and then gives me this:<br>
<br>Traceback (most recent call last):<br>&nbsp;File &quot;D:\_code\python\apps\WinTests.py&quot;, line 25, in ?<br>&nbsp; cycle_foreground()<br>&nbsp;File &quot;D:\_code\python\apps\WinTests.py&quot;, line 20, in cycle_foreground<br>&nbsp; win32gui.SetForegroundWindow(handle)<br>
pywintypes.error: (0, &#39;SetForegroundWindow&#39;, &#39;No error message is available&#39;)<br><br>What am I doing wrong in this case? &nbsp;Do I have some bad assumptions?<br>Is my app allowed to &quot;give away&quot; its focus but can&#39;t force a different<br>
app&#39;s window with focus to &quot;give away&quot; its focus? &nbsp;Is there any other<br>way to accomplish this? &nbsp;I&#39;ve attempted using a mix of SetFocus(),<br>BringWindowToTop(), and EnableWindow() but couldn&#39;t find a magic<br>
combo.<br><br>I&#39;ve attached my test script. &nbsp;Run it as &quot;WinTests cycle&quot; to attempt<br>to cycle the focus through all top level windows and see the<br>traceback. &nbsp;Run it as &quot;WinTests 12345&quot; to successfully set the focus<br>
to the window with hwnd of 12345. &nbsp;Run it as &quot;WinTests&quot; to get a list<br>of all top level window names and their hwnd&#39;s.<br><br>I&#39;ve tried reading the win32 docs provided with ActiveState&#39;s<br>PythonWin, I&#39;ve read a bit on the win32 API on MSDN and I&#39;ve googled<br>
around a bit, and haven&#39;t found much.<br><br>So, I got curious and tried to code up something similar in C++. &nbsp;It<br>uses the identical API calls (from what I can tell) and It seems to<br>have no problem cycling through all the top-level windows. &nbsp;I&#39;ve<br>
attached my .cpp file as well.<br><br>Why the discrepancy between what I&#39;m seeing with win32gui and c++? &nbsp;Thoughts?<br><br>-Scott<br>-------------- next part --------------<br>An embedded and charset-unspecified text was scrubbed...<br>
Name: SetForegroundWindow.cpp<br>Url: <a href="http://mail.python.org/pipermail/python-win32/attachments/20080317/b29565b5/attachment-0002.txt" target="_blank">http://mail.python.org/pipermail/python-win32/attachments/20080317/b29565b5/attachment-0002.txt</a><br>
-------------- next part --------------<br>An embedded and charset-unspecified text was scrubbed...<br>Name: WinTests.py<br>Url: <a href="http://mail.python.org/pipermail/python-win32/attachments/20080317/b29565b5/attachment-0003.txt" target="_blank">http://mail.python.org/pipermail/python-win32/attachments/20080317/b29565b5/attachment-0003.txt</a><br>
<br>------------------------------<br><br>Message: 6<br>Date: Mon, 17 Mar 2008 12:53:23 -0500<br>From: &quot;Tarun Kapoor&quot; &lt;<a href="mailto:tkapoor@wscm.net">tkapoor@wscm.net</a>&gt;<br>Subject: [python-win32] python 2.5<br>
To: &lt;<a href="mailto:python-win32@python.org">python-win32@python.org</a>&gt;<br>Message-ID:<br>&nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="mailto:C1E12E3378F89C4DA422B4089741418408B160@wscmmail.wscm.corp">C1E12E3378F89C4DA422B4089741418408B160@wscmmail.wscm.corp</a>&gt;<br>
Content-Type: text/plain; charset=&quot;us-ascii&quot;<br><br>I want to use python win32 extensions on python 2.5 but it seems like<br>they were built for 2.3...<br><br>I copied the win32 folders from C:\python23\lib\site-packages to<br>
C:\python25\lib\site-packages but it does not work....<br><br>Is there a workaround ? anyone using it ?<br><br>-TK<br><br><br><br>Disclaimer<br><br>This e-mail and any attachments is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Waterstone Capital Management, L.P and affiliates. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this e-mail in error. You should also be aware that e-mails are susceptible to interference and you should not assume that the contents of this e-mail originated from the sender above or that they have been accurately reproduced in their original form. Waterstone Capital Management, L.P. and affiliates accepts no responsibility for information, or errors or omissions in this e-mail or use or misuse thereof. If in doubt, please verify the authenticity with the!<br>
&nbsp;sender.<br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://mail.python.org/pipermail/python-win32/attachments/20080317/82b9be5d/attachment.htm" target="_blank">http://mail.python.org/pipermail/python-win32/attachments/20080317/82b9be5d/attachment.htm</a><br>
<br>------------------------------<br><br>_______________________________________________<br>python-win32 mailing list<br><a href="mailto:python-win32@python.org">python-win32@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br>
<br><br>End of python-win32 Digest, Vol 60, Issue 28<br>********************************************<br></blockquote></div><br>