> How feasible is it to write programs like the supplied example in pure > python, ideally without resorting to ctypes? (ctypes is bloody useful > but if I'm going to that amount of trouble I could just write plain C)
It should be quite feasable. Obviously a few things would need to be done differently, including the WndProc, and the timer would use the win32 "timer" module with a callback function. Note that there is no reason you can't use ctypes for any missing corners - that still gives you better productivity than C. Of course, if you have a C compiler and the missing functions are quite simple (ie, take simple types as params), then adding them to win32gui and submitting the patch to me is another option. > WRT to the supplied example, I couldn't find the GetMessage function > in the win32gui module. Seems like it would be nearly mandatory, from > my very sketchy knowledge of Windows. The internal "message loop" is built into win32gui in PumpMessages() - internally we do that Get/Translate/Dispatch dance, and delegate the message itself to a Python function via the Python "message map". For completeness though I have just added GetMessage() - but it should only be used in rare cases - the performance of the loop in C will be much better. > Googling around I found this old post to the list > http://mail.python.org/pipermail/python-win32/2004-December/002771.html > but had the same problems as the original poster and I couldn't find > any followups on the thread with fixes. That question seemed to have been re-asked in January, and I saw that one :) See http://mail.python.org/pipermail/python-win32/2005-January/002859.html - and note that build 204 already has the modified demo as mentioned in that mail. Alan _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32