Problem with win32ui MessageBox

Maurizio Manetti giannozzo at arca.net
Tue Aug 21 02:04:30 EDT 2001


Stefan Schukat wrote:

> The win32ui is not just a call into the windows API. It depends
> on the framework used. Normally this is used in an application
> which is based on the Python MFC wrapping by MarkH.

Thank you a lot for the explanation!

> The pure windows API is implemented in the win32api module in
> which your code would look like:
> 
> import win32con
> import win32api
> win32api.MessageBox(0, "Test Message", 'Test', win32con.MB_OK)

That works fine!! Thanks!
 
> As you see there is an additional first parameter. This is
> the HANDLE to the parent window which is filled automagically
> in the win32ui environment.

But "0" is the HANDLE for which parent window, in this case?
 
> But that is not your problem. The problem is a small error
> in the win32ui implementation. Mark has used a windows hook
> to do the message routing. This hook was added twice by accident in
> a console app which caused an endless recursion and
> therefore a stack overflow in Win9X/ME, but not on WinNT/2000.
> The fix (more a hack) was included in the CVS sources at the 6. July.

That means I can download the source from the CVS and compile Python?
(I never compiled Python under Windows)

> So it may be included in ActivePython 211 (Ask Mark)
 
I downloaded and installed ActivePython 2.1.1 build 212 but the problem
is still there.
However I'll turn around it using directly the Windows API as you
suggested. Thank you very much.



More information about the Python-list mailing list