Problem with win32ui MessageBox

Stefan Schukat SSchukat at dspace.de
Tue Aug 21 09:50:05 CEST 2001


> -----Ursprüngliche Nachricht-----
> Von: Maurizio Manetti [mailto:giannozzo at arca.net]
> Gesendet: Dienstag, 21. August 2001 07:10
> An: Stefan Schukat
> Betreff: Re: Problem with win32ui MessageBox
> 
> 
> 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?
>  

>From the MSDN MessageBox help:

hWnd [in] 	Handle to the owner window of the message box to be created.

		If this parameter is NULL, the message box has no owner
window. 

> > 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)
> 

Sure you can it is open source. Look at 
http://starship.python.net/crew/mhammond/cvs.html
and
http://www.python.org/download/download_source.html

> > 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.
> 


	Stefan




More information about the Python-list mailing list