Re: [python-win32] Pywin32 local variable

2021-08-13 Thread Greg Ewing
On 12/08/21 9:17 pm, Salih KUYUMCU via python-win32 wrote: I create a String value before the methods and try to return these values in another method. I get the problem local variable 'xxx' referenced before assignment. It sounds like you may want to store the value in an attribute of an

Re: [python-win32] Using win32gui.FindWindow() results in black or white screen

2021-06-03 Thread Greg Ewing
On 4/06/21 4:59 am, Dennis Lee Bieber wrote: Many video apps don't display in "Windows". The window you grabbed is a basically a hole through which the graphics chips are rendering and are not available, and the render is not part of the window itself. When grabbing the entire

[python-win32] Registering COM servers doesn't work out of the box any more

2017-07-26 Thread Greg Ewing
I recently tried to install a COM server written in Python and ran into a small problem. The procedure I used was this: 1. Install Python 3 using the standard Windows installer, as Administrator, for All Users, adding Python to the path. 2. pip install pypiwin32 3. Run my script for

Re: [python-win32] python-win32 Digest, Vol 165, Issue 3

2016-12-05 Thread Greg Ewing
Tim Roberts wrote: Is it possible your 2008 laptop had had the registry changes necessary to associate .P files with Excel, but your current laptop does not? He's running a program that explicitly tells Excel to open the file, so extension associations don't come into it. What matters is

Re: [python-win32] Calling unregistered COM libraries via Python

2016-01-12 Thread Greg Ewing
Manowitz, David wrote: Is it possible, either via the win32com extensions or the comtypes package (or some other package), to call to an unregistered COM library? It does appear to be possible, using a manifest file: https://msdn.microsoft.com/en-us/library/ms973913.aspx -- Greg

Re: [python-win32] Storing Passwords.

2015-01-19 Thread Greg Ewing
Bob Hood wrote: I'm probably missing some crucial point here, but with Python being the host environment, why wouldn't the Python keyring module provide the hardened storage the OP is seeking? The same problem arises. If the program can get the password out of the keyring, then so can any

Re: [python-win32] Windows automation basics

2014-03-05 Thread Greg Ewing
Alan Gauld wrote: And for interest only, where is COM in the world of .NET and Windows 8+ etc? Are there better options today? As far as I understand, not always. If the functionality you're after happens to exist in the form of a .NET library, and you're willing to use a .NET-compatible

Re: [python-win32] optimizing code to read serial port

2014-02-15 Thread Greg Ewing
Tony Cappellini wrote: Do you have any ides why running a terminal program written in (presumably C, mentioned in my original message) doesn't seem to suffer from the problems that my python app does, even when transferring the data at much higher baud rates? Could the terminal program

Re: [python-win32] Pythonwin Combobox

2011-08-19 Thread Greg Ewing
Manfred Schulte-Oversohl wrote: I'd like to use a combobox control. Getting it with dialog is no problem. But I could not create a combobox on a window. I had the same problem -- pywin32 is missing a CreateComboBox function. After much frustration, I found the following workaround: hwnd

[python-win32] Finding out whether there are any visible windows

2011-06-23 Thread Greg Ewing
In PyGUI I have a need to find out whether the application has any visible windows, so I can quit when the last visible window is closed. However, I can't seem to find a way of iterating over all the windows belonging to the application, without also getting windows belonging to *other*

Re: [python-win32] Finding out whether there are any visible windows

2011-06-23 Thread Greg Ewing
Tim Golden wrote: Just for information, my nearly-what-you-want is here: http://timgolden.me.uk/python/win32_how_do_i/find-the-window-for-my-subprocess.html Yep, I came up something similar -- was just wondering whether there was some more obvious way that I was missing. Seems not. Thanks,

Re: [python-win32] [Pygui] Convert RGBA to BGRA using standard library?

2011-06-21 Thread Greg Ewing
geoff wrote: Greg, I had to solve this problem in another application and ended up using the array module and the with the slice syntax. import array input = rgbaRGBA1234 ba = array.array('c', input) ba[0::4], ba[2::4] = ba[2::4], ba[0::4] Yep, I was thinking the same thing myself. I'll

Re: [python-win32] [Pygui] Installing PyGUI-2.5 on Mac OSX 10.5.8 fails

2011-06-17 Thread Greg Ewing
Colin Brown wrote: Macintosh:PyGUI-2.5 colin$ python setup.py install Traceback (most recent call last): File setup.py, line 12, in module from distutils_extensions import pygui_build_py ImportError: No module named distutils_extensions Sorry about that! The missing file is attached, and

[python-win32] ANN: PyGUI 2.5

2011-06-16 Thread Greg Ewing
PyGUI 2.5 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Lots of new stuff in this version. Highlights include: - Improved facilities for customising the standard menus. - Functions for creating PyGUI Images from PIL images and numpy arrays. - ListButton - a

Re: [python-win32] Creating PyCComboBox?

2011-06-15 Thread Greg Ewing
Mark Hammond wrote: I think you just want a CreateWindow(Ex) with Combobox as the class. Yes, but the puzzle was how to get a PyCComboBox object rather than a raw window handle. I discovered it can be done by calling CreateWindowFromHandle on the resulting handle, but I don't think I should

[python-win32] Creating PyCComboBox?

2011-06-11 Thread Greg Ewing
How are you supposed to create a PyCComboBox? There doesn't seem to be a CreateComboBox function anywhere. I tried using CreateControl(COMBOBOX, ...) but it says that the CLSID is invalid. -- Greg ___ python-win32 mailing list python-win32@python.org

Re: [python-win32] Creating PyCComboBox?

2011-06-11 Thread Greg Ewing
Vernon Cole wrote: The problem is that the Windows combobox does not allow for the user to type more than one letter to select an item from the list I'm not sure it's necessary to replace the entire thing just to fix that -- it ought to be possible to override the keyboard event handling and

[python-win32] Convert RGBA to BGRA using standard library?

2011-05-28 Thread Greg Ewing
Can anyone think of an efficient way to convert a string full of RGBA image data to BGRA, using only what's available in the standard library? I'm trying to add a function to PyGUI for creating an Image object from arbitrary data. The problem I'm having is that GDI+ on Windows expects BGRA,

Re: [python-win32] Bit of a strange one using py2exe

2011-05-23 Thread Greg Ewing
Tim Golden wrote: Backticks are a little-used alternative to the repr () function -- deprecated in Python 3 ISTR. Actually it's been *removed* in Python 3: Python 3.1.2 (r312:79147, Mar 2 2011, 17:43:12) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type help, copyright, credits or license

Re: [python-win32] Bundling font with application?

2011-05-17 Thread Greg Ewing
Gabriel Genellina wrote: I think AddFontResourceEx is what you are looking for. http://msdn.microsoft.com/en-us/library/dd183327(v=VS.85).aspx Yes, that sounds like it may do what I want, thanks. -- Greg ___ python-win32 mailing list

[python-win32] Bundling font with application?

2011-05-16 Thread Greg Ewing
Is there a way to tell an ordinary Windows application to look for fonts in a specific directory, or load a font from a specific file? The only things I've been able to find about this using Google all relate to .NET. -- Greg ___ python-win32 mailing

[python-win32] PyGUI Window Always Starts Behind Others

2011-03-28 Thread Greg Ewing
this? Is there something I should do when creating a window to make sure it appears on top? Original Message Subject:Re: [Pygui] Window Always Starts Behind Others Date: Mon, 28 Mar 2011 10:17:10 -0400 From: Mark Melvin mark.mel...@gmail.com To: Greg Ewing greg.ew

Re: [python-win32] Fonts behaving differently - The plot thickens a bit

2011-03-06 Thread Greg Ewing
Roger Upole wrote: The conversion in win32ui has changed since 212. At one time it was negating the height that was passed in: if (PyInt_Check (v)) pLF-lfHeight = -PyInt_AsLong(v); Ah, that explains it all! You can also extract the version embedded in the pyd's using

Re: [python-win32] Fonts behaving differently with Py3/216

2011-03-04 Thread Greg Ewing
Tim Roberts wrote: Are you running this on a different computer? No, it's the same computer. I can run 2.x and 3.x versions of the same test side by side, and the 2.x one has normal sized text whereas the 3.x one has tiny text. Oddly, it only seems to affect text drawn by the standard win32

Re: [python-win32] Possible trouble with pywin23-216 on python 3.2

2011-03-03 Thread Greg Ewing
Tim Golden wrote: Re: [python-win32] Possible trouble with pywin23-216 on python 3.2 Aha! There's your problem: you're trying to install pywin23. Unless of course you're using one of those rare machines based on Intel's little-known 23-bit architecture. (There was a typo early on in the

[python-win32] Fonts behaving differently with Py3/216

2011-03-03 Thread Greg Ewing
I recently tried running PyGUI on Python 3 using pywin32 build 216, and a couple of things are not working quite the same way as they were with Python 2 and build 213. 1) The default font used for control labels etc. is slightly smaller. 2) When I calculate the width of a piece of text using

Re: [python-win32] Fonts behaving differently with Py3/216

2011-03-03 Thread Greg Ewing
Mark Hammond wrote: What version of python and how many bits? I'm guessing you tried 3.2, which means you must have used the 64bit version No, it's 3.1, and 32 bit. It can't be 64, because the machine I'm running it on can't handle that. (And it's definitely not 23 bit either. :-) The only

Re: [python-win32] Possible future direction for PyGUI on Win32

2011-02-28 Thread Greg Ewing
Octavian Rasnita wrote: From: Greg Ewing greg.ew...@canterbury.ac.nz No, if I go this way, I would probably stop maintaining the current implementation. Oh, in that case imho I think this is a very bad idea. Can you elaborate on exactly what is bad about it, and suggest an alternative

Re: [python-win32] Possible future direction for PyGUI on Win32

2011-02-28 Thread Greg Ewing
Tim Golden wrote: Python.NET seems to sit in an awkward place in the ecosystem. Its niche seems to be: where you want a small bit of .NET technology (such as SQL-SMO in my case) but don't want to migrate any win-specific Python code. (ie stuff relying on pywin32) Or, as in my case, you are

Re: [python-win32] Possible future direction for PyGUI on Win32

2011-02-26 Thread Greg Ewing
From: Octavian Rasnita [mailto:orasn...@gmail.com] If it will still be possible to use the standard Win32 GUI, it is OK to be able to use Windows Forms as an adition. No, if I go this way, I would probably stop maintaining the current implementation. I don't want to have to support two

Re: [python-win32] Find containing window given a control handle

2011-02-01 Thread Greg Ewing
Reckoner wrote: Given the handle of a text field or button embedded in some window, how can I find the parent window that contains the handle? Use the win32gui.GetParent() function? -- Greg ___ python-win32 mailing list python-win32@python.org

Re: [python-win32] Prevent a (Tkinter) window from maximizing via win32 api call?

2010-12-02 Thread Greg Ewing
pyt...@bdurham.com wrote: I have a *resizable* Tkinter window with min and max sizes set. I want to prevent users from attempting to maximize this window because the window pops over to the upper left of the display - a behavior that my users find very frustrating (and of little value). If

Re: [python-win32] How to block ctrl-alt-delete on Windows 7?

2010-10-29 Thread Greg Ewing
Does the kiosk application need all 3 of those keys? If not, you could remove one of them from the keyboard and glue something over the hole. -- Greg ___ python-win32 mailing list python-win32@python.org

Re: [python-win32] PyGUI blobedit creashes with pywin32-214 but not 212 - traceback - related problems

2010-10-21 Thread Greg Ewing
Roger Upole wrote: The resource is actually in win32ui.pyd, rather than in Pythonwin itself. I've just verified that this method works from plain python.exe. That's great news! I thought I had already tried something very much like what you suggested, but maybe I hadn't hit upon the right

Re: [python-win32] PyGUI blobedit creashes with pywin32-214 but not 212 - traceback - related problems

2010-10-21 Thread Greg Ewing
Roger Upole wrote: You instantiate the MFC view object without a document, but in order to actually create a window and do anything useful with it, it needs a valid document. Are you absolutely sure about that? At the MFC level, I can't see anything to stop you from instantiating a CView and

Re: [python-win32] does pipes.quote() work properly on Windows?

2010-05-22 Thread Greg Ewing
Bill Janssen wrote: myprogram --title=That's the game! says Mike Hammer Brotsky --file=... Since cmd.exe also supports pipelines, I'd sort of expect it to do the right thing on Windows, too. Don't know about later versions, but in Python 2.5 the pipes module is listed under Unix

Re: [python-win32] recent spam

2010-04-06 Thread Greg Ewing
Mark Hammond wrote: as they were replies to legitimate mailing-list messages, I was fooled into approving them. Spammers are getting more obnoxiously devious all the time. You have to wonder at the mentality of someone who goes to such lengths to try to trick people into reading messages that

Re: [python-win32] Win API call to display a BMP/PNG file as a splash screen for a console app?

2010-03-23 Thread Greg Ewing
Andrew MacIntyre wrote: Is it possible to draw directly to the desktop? I vaguely recall reading somewhere that that is how some splash screens are done to avoid the overhead of a window... Somehow I doubt that. I have a hard time imagining that displaying a splash screen could be a serious

Re: [python-win32] Python Windows Socket problem after Py2exe and install

2010-03-14 Thread Greg Ewing
pyt...@bdurham.com wrote: ...'Choosing a collection of common modules/packages for a general purpose reusable PY2EXE runtime'. This post got zero feedback so our idea is either too stupid or too obvious to warrant further conversation :) I think the problem is that in the rare cases when you

Re: [python-win32] Technique to limit number of instances of our application under Terminal Server

2010-03-12 Thread Greg Ewing
Here's another possible solution. Each process tries to open a socket connection to a server process. When the maximum number of processes are connected, the server stops accepting connections. The server also selects all of its open connections for reading. When a process dies, the server will

Re: [python-win32] [Correction] Trying to get the Win32_PortableBattery and Win32_SystemEnclosure classes to work

2010-03-08 Thread Greg Ewing
pyt...@bdurham.com wrote: I'm not entirely clear on why there are 2 battery classes and why I would choose to use vs. the other, but I suspect the Win32_PortableBattery class is for machines with advanced power supply management capabilities. Obviously it's for machines that have a *wireless*

[python-win32] Solved - Printing coordinate system problem

2009-12-15 Thread Greg Ewing
Thomas Heller wrote: I would guess that GetDeviceCaps() returns the information that you need. Yep, this turns out to be right, although it's *very* difficult to find this out if you start looking in the area of the docs that talks about printing! My margins are spot-on now. I'm happy. Need

[python-win32] Printing coordinate system problem

2009-12-14 Thread Greg Ewing
I'm wrestling with printing support for PyGUI on Windows. I'd like to set up the coordinate system during printing so that (0, 0) is at the corner of the paper, so that I can arrange for the margins to have predictable sizes. However, the device context I get from calling PrintDlg() seems to be

Re: [python-win32] [Pygui] Printing coordinate system problem

2009-12-14 Thread Greg Ewing
Vernon Cole wrote: In searching for documentation, remember a quirk in Microsoft vocabulary... a printer is software, not hardware. The device on the corner of your desk with the paper in it is not a printer, it is a printing device. Yes, I know. I'll be happy if I can somehow find out what

[python-win32] PyCPrintDialog - Is it any use?

2009-11-30 Thread Greg Ewing
The PyCPrintDialog in pywin32 doesn't seem to have any methods or attributes. How are you supposed to get information out of it? -- Greg ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32

Re: [python-win32] ANN: PyGUI Mailing List

2009-11-28 Thread Greg Ewing
Thomas Heller wrote: Is the list available on gmane? I have received a reply from gmane saying that a subscription request has been sent and that the gmane group would be created when the first message arrives. I'm not a gmane user myself, so someone may want to take a look over there and

Re: [python-win32] ANN: PyGUI Mailing List

2009-11-28 Thread Greg Ewing
Thomas Heller wrote: Is the list available on gmane? I have received a reply from gmane saying that a subscription request has been sent and that the gmane group would be created when the first message arrives. I'm not a gmane user myself, so someone may want to take a look over there and

[python-win32] RichEditCtrl scrolling doesn't work properly

2009-11-23 Thread Greg Ewing
I'm trying to create a PyRichEditCtrl with scroll bars. I can get scroll bars to appear using the appropriate style flags in CreateWindow, but they don't entirely work. Clicking on the scrolling arrows causes the text to scroll, but the position of the thumb doesn't get updated to match. Can

Re: [python-win32] ANN: PyGUI Mailing List

2009-11-21 Thread Greg Ewing
Thomas Heller wrote: Is the list available on gmane? Not yet, but I'll look into making it so. -- Greg ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32

[python-win32] ANN: PyGUI 2.1.1

2009-11-19 Thread Greg Ewing
PyGUI 2.1.1 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ This is an emergency bugfix release to repair some major breakage in the gtk version. Also corrects some other problems. What is PyGUI? -- PyGUI is a cross-platform GUI toolkit designed to be

Re: [python-win32] [pygtk] ANN: PyGUI 2.1

2009-11-16 Thread Greg Ewing
John Finlay wrote: Start your own list for the community that is interested in your project. That's not going to reach anyone who doesn't already know about it. It's probably a good idea for ongoing discussion, though. Any suggestions on the best way of going about it? I could start a Google

Re: [python-win32] [pygtk] ANN: PyGUI 2.1

2009-11-16 Thread Greg Ewing
Vernon Cole wrote: If it produces code for a cross platform GUI API then the resulting application will be cross platform. I would love to find one such that actually works and produces good code. Code produced by a GUI designer shouldn't be getting edited by humans, so the quality of the code

Re: [python-win32] ANN: PyGUI 2.0.5

2009-11-16 Thread Greg Ewing
Roger Upole wrote: Greg Ewing wrote: Randy Syring wrote: win32ui.error: The object has been destroyed. I looked at this a while ago, and have a good idea where the problem is. I'll try to get a fix in before the next build. If it's because of the screwy things I'm doing to get a dummy

Re: [python-win32] [pygtk] ANN: PyGUI 2.1

2009-11-16 Thread Greg Ewing
Sturla Molden wrote: The only GUI API that doesn't suck is no API at all. GUIs should be designed visually. There's a lot more to a GUI API than just specifying the layout. -- Greg ___ python-win32 mailing list python-win32@python.org

Re: [python-win32] [pygtk] ANN: PyGUI 2.1

2009-11-15 Thread Greg Ewing
John Finlay wrote: Greg, Why do you post to mailing lists that are unrelated to your project? I would appreciate it if in future you didn't post a message about your project ot the PyGTK mailing list. I posted the announcement to the pyobjc, pygtk and pywin32 lists because PyGUI uses all of

Re: [python-win32] ANN: PyGUI 2.0.5

2009-11-14 Thread Greg Ewing
Randy Syring wrote: I am still seeing the bug noted below in 2.1. Do you have plans to tackle it? win32ui.error: The object has been destroyed. Reportedly it can be worked around by reverting to build 212 of pywin32. I haven't had a chance to investigate what's causing it yet, sorry. --

[python-win32] ANN: PyGUI 2.1

2009-11-13 Thread Greg Ewing
PyGUI 2.1 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Highlights of this version: * Win32: Fixed bug preventing PyGUI apps from working under pythonw Fixed incorrect mouse coordinates in ScrollableView Added more standard cursors * MacOSX:

[python-win32] Pywin32 GUI not working with pythonw

2009-11-09 Thread Greg Ewing
I have a bizarre problem. The following program: import win32ui app = win32ui.GetApp() app.Run() works fine when run from a command window using python.exe -- it happily sits there waiting for events until I kill it with the task manager. However, if I run it using pythonw.exe, the GetApp()

Re: [python-win32] daemonized child

2009-09-28 Thread Greg Ewing
Elias Fotinis wrote: From: Antoine Martin I had forgotten about the pipes (doh), I guess I should start the child with stdin=stdout=stderr=None then? That won't necessarily close the OS-level file descriptors, though. If you want that, you need to do something like for i in xrange(3):

Re: [python-win32] regarding invoking command prompt using python

2009-06-18 Thread Greg Ewing
Tim Roberts wrote: Depending on your point of view, that's either a usage problem or a design flaw in the os module. The design of the os module does seem rather screwy in this area. Since os.environ is a custom mapping type, I don't know why it doesn't just pass all get and set operations on

Re: [python-win32] ANN: PyGUI 2.0.5

2009-06-04 Thread Greg Ewing
Randy Syring wrote: I am wondering if the problems with build 213 have ever been resolved on Windows. Or was I mistaken that build 213 was the problem? I don't know. I haven't heard any more about it from anyone since then. Has anyone else out there that's having this problem successfully

Re: [python-win32] Extract icon from exe files

2009-05-05 Thread Greg Ewing
Nicolas EISEN wrote: the icon have the tranparence but the bmp take this in black. In win32ui, there are not attribute to set the background in white before write the bmp in DC ... an idea ? Draw a white rectangle over the bmp before calling DrawIcon? -- Greg

[python-win32] ANN: PyGUI 2.0.5

2009-04-26 Thread Greg Ewing
PyGUI 2.0.5 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ More bug fixes for various platforms. Still no idea what's causing the object has been destroyed error on Windows XP, though. Does this happen for everyone? Is there anyone who *has* got 12-scroll.py working

Re: [python-win32] ANN: PyGUI 2.0.5

2009-04-26 Thread Greg Ewing
Randy Syring wrote: Could you tell me briefly how this project differs from something like wxPython? It wraps platform-specific libraries directly, rather than being a wrapper around another cross-platform library. This means less bloat and less dependencies. Chances are you already have the

[python-win32] ANN: PyGUI 2.0.4

2009-04-21 Thread Greg Ewing
PyGUI 2.0.4 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Fixes a few more bugs and hopefully improves things on Windows, although I can't be sure it will fix all the Windows problems people are having, because I haven't been able to reproduce some of them. What is

Re: [python-win32] ANN: PyGUI 2.0.4

2009-04-21 Thread Greg Ewing
Christian K. wrote: I'm afraid, that error is stil there: File c:\pythonxy\python\Lib\site-packages\GUI\Win32\ScrollableViews.py, line 31, in __init__ GScrollableView.__init__(self, _win = win) win32ui.error: The object has been destroyed. That's a bit of a problem, since it works

Re: [python-win32] ANN: PyGUI 2.0.2

2009-04-19 Thread Greg Ewing
Christian K. wrote: TypeError: 'pitch_and_family' is an invalid keyword argument for this function Looking at the source of pywin32, I can see why this happens -- it really is expecting 'pitch and family' with spaces (and it's abusing ParseTupleAndKeywords to unpack a dict, which is why it's

[python-win32] ANN: PyGUI 2.0.2

2009-04-16 Thread Greg Ewing
PyGUI 2.0.2 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Fixes problem on Windows causing This file should not be imported error. What is PyGUI? -- PyGUI is a cross-platform GUI toolkit designed to be lightweight and have a highly Pythonic API. --

[python-win32] ANN: PyGUI 2.0.1

2009-04-12 Thread Greg Ewing
PyGUI 2.0.1 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Fixes some problems in setup.py affecting installation on Linux and Windows. What is PyGUI? -- PyGUI is a cross-platform GUI toolkit designed to be lightweight and have a highly Pythonic API. --

[python-win32] ANN: PyGUI 2.0

2009-04-11 Thread Greg Ewing
PyGUI 2.0 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Highlights of this release: * Native Windows implementation, based on pywin32 and ctypes. * Full set of Postscript-style path construction operators available on all platforms. * Mouse and keyboard events can

[python-win32] PyGUI 2.0 setup.py fixes

2009-04-11 Thread Greg Ewing
france...@promotux.it wrote: error: package directory 'Gtk' does not exist Smeg, there's a bug in the installer. I'll release a fix soon. In the meantime, try replacing the following line in setup.py: packages.append(Gtk) with packages.append(GUI.Gtk) I've also noticed another problem

[python-win32] Rendering to bitmap with OpenGL

2009-03-24 Thread Greg Ewing
I'm trying to create an OpenGL context for rendering to an offscreen bitmap. The attached program gets as far as trying to call wglCreateContext, then fails with WindowsError: [Errno 8] Not enough storage is available to process this command. Can anyone see what's going wrong here?

[python-win32] GDI+ text rendering screwed up

2009-03-19 Thread Greg Ewing
I'm trying to use GDI+ (via ctypes) to draw text. It works for some fonts but messes up with others. Using Times, for example, it seems to be using the glyphs for one character earlier in the code sequence, so that Times comes out as Shldr -- except that it uses the widths of the original

Re: [python-win32] GDI+ text rendering screwed up

2009-03-19 Thread Greg Ewing
Tim Roberts wrote: Sadly, I see Times Italic 48 in black-on-yellow. Do you really have a font called Times? I'm not sure, but I can use the name Times with plain GDI and it works fine, so it seems to be able to find something equivalent. But I'll try using the exact name and see if it works

Re: [python-win32] GDI+ text rendering screwed up

2009-03-19 Thread Greg Ewing
Turns out I *sort* of have a font called Times... I've got Times Bold, Times Italic and Times Bold Italic, but no plain Times! Times New Roman works fine, though, and it seems that the same is true of all the other fonts for which there is a full set of variations. So it looks like I'll be

Re: [python-win32] PyCSlider notification messages

2009-03-17 Thread Greg Ewing
Mark Hammond wrote: Works for me. In sliderdemo.py, directly after the creation of the control I added: self.HookMessage(self.OnSliderMove, win32con.WM_HSCROLL) Okay, I've modified that demo similarly and it works for me too. I can investigate further from there, thanks. -- Greg

[python-win32] PyCSlider notification messages

2009-03-16 Thread Greg Ewing
I'm having trouble getting notification messages from a Slider control. According to MS, a Slider is supposed to send WM_HSCROLL messages to its parent window when the user changes it, but this isn't happening. I can get WM_HSCROLL messages from a normal scroll bar, but either the Slider isn't

[python-win32] PyCScrollView with no PyCDocument?

2009-03-09 Thread Greg Ewing
Is there any way of creating a ScrollView without needing a Document? I just want a scrollable user-drawable area, but CreateView insists that I supply a Document. What's more, the only way to create a Document seems to be to use a DocTemplate, and the only way to get one of those is to use a

Re: [python-win32] PyCScrollView with no PyCDocument?

2009-03-09 Thread Greg Ewing
Mark Hammond wrote: No not only can I no longer answer your question, I'm quite confident I never could :( Alternatively, is there a way of getting a valid DocTemplate without having to put a resource in the executable? Some kind of in-memory resource creation or something? -- Greg

Re: [python-win32] PyCScrollView with no PyCDocument?

2009-03-09 Thread Greg Ewing
Well, I think I've found a workaround. The following hack seems to create something looking enough like a PyCDocument to keep it happy while creating a PyCView: dummy = win32ui.CreateRichEditView().GetDocument() The result of this appears to be a PyCDocument that's wrapping a null pointer.

[python-win32] Focus lost when switching windows

2009-03-06 Thread Greg Ewing
The following program creates a FrameWnd with an Edit control in it. If I select some text in the control, then switch to another window and back again, the Edit control has lost the keyboard focus. Normal Windows applications don't behave that way. What do I have to do to get my controls to

[python-win32] Confused about PreTranslateMessage

2009-03-05 Thread Greg Ewing
I'm having trouble understanding how PreTranslateMessage is supposed to work. According to M$: Return value: Nonzero if the message was translated and should not be dispatched; 0 if the message was not translated and should be dispatched. and according to the pywin32 docs: The result

Re: [python-win32] Finding attached object?

2009-03-04 Thread Greg Ewing
Mark Hammond wrote: Hrm - m_pMenu (and m_pSubMenu) is *supposed* to return a PyCMenu object - what are you seeing? They're returning a PyCMenu, but not the object that I have attached to the PyCMenu. This seems to happen automatically in some other places, e.g. ui.GetFocus(). If m_pMenu

Re: [python-win32] Finding attached object?

2009-03-03 Thread Greg Ewing
Mark Hammond wrote: Apparently not from Python. It would be easy to add, If you do happen to add this, another thing you might want to investigate is why PyCCmdUI isn't automatically doing this when you read the m_pMenu property, as seems to happen in most other places if you call a method

Re: [python-win32] OnCtlColor not working?

2009-03-02 Thread Greg Ewing
Mike Driscoll wrote: I'm probably being naive, but why don't you just use one of Python excellent GUI toolkits? I'm implementing my own cross-platform toolkit, because I don't like any of the existing ones. See http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ -- Greg

Re: [python-win32] OnCtlColor not working?

2009-03-02 Thread Greg Ewing
Vernon Cole wrote: So, Greg, can we anticipate a python_gui flavor for Windows in native mode? Yes, it looks like there's a reasonable chance of that happening fairly soon. There are actually two possible ways it could go. I have a partial implementation contributed by one of my users based

[python-win32] OnCtlColor not working?

2009-03-01 Thread Greg Ewing
Has anyone successfully used the PyCWnd.OnCtlColor virtual function to change the appearance of a control? The program below tries to use it to set the colour of the text in a PyCButton. My OnCtlColor method gets called, but it doesn't have any effect on the appearance of the button. Also, if I

Re: [python-win32] OnCtlColor not working?

2009-03-01 Thread Greg Ewing
Roger Upole wrote: OnCtlColor is expected to return a GDI handle rather than a full MFC object. Ah, okay. It does say so, now that I come to look at the docs carefully enough. It works fine now. Thanks, Greg ___ python-win32 mailing list

Re: [python-win32] OnCtlColor not working?

2009-03-01 Thread Greg Ewing
Well, it *almost* works now... it's okay for all the button styles except BS_PUSHBUTTON. My OnCtlColor is still getting called, but the pushbutton seems to ignore the results. All the other button styles are okay. Am I still doing something wrong, or is this a known limitation of pushbuttons?

Re: [python-win32] Error with VixCom operation; TypeError: The VARIANT type is unknown (0x00000015)

2009-02-17 Thread Greg Ewing
Tim Roberts wrote: It's kind of loony for an API to use a 64-bit integer as an error number, but that's what they're doing. This is Windows, remember. There are large numbers of things that can go wrong. -- Greg ___ python-win32 mailing list

Re: [python-win32] Writing to Excel performance

2008-12-12 Thread Greg Ewing
Tim Roberts wrote: Dahlstrom, Roger wrote: My opinion is that determining file type by extension (arbitrary at that) is a bad thing to begin with. This is veering a bit off-topic for this mailing list, but I'd be curious to hear what alternatives you would suggest. The way classic MacOS

Re: [python-win32] Does Python need a native Windows GUI toolkit?

2008-11-28 Thread Greg Ewing
Thomas Heller wrote: Does Python need a native, pure Python, Windows GUI toolkit, one that uses win32 api calls directly to use native windows controls? I believe so. One of the long-term goals for PyGUI is to give it a native Windows backend. I share your dislike of layers on layers. Are

[python-win32] Python COM: Automatic wrap/unwrap?

2008-11-10 Thread Greg Ewing
I'm creating a COM server in Python that will have one main class, with methods that create and return instances of other classes. I've found that I need to use win32com.server.util.wrap and unwrap on these objects when they pass over a COM connection. This doesn't seem very convenient,