The Python Oracle

I'm not sure win32gui.EnumWindows is working properly

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 5 Looping

--

Chapters
00:00 I'M Not Sure Win32gui.Enumwindows Is Working Properly
01:18 Accepted Answer Score 2
01:47 Thank you

--

Full question
https://stackoverflow.com/questions/2968...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #pywin32

#avk47



ACCEPTED ANSWER

Score 2


I think that EnumWindows is doing exactly what its documentation says it will do. Returning False from the callback function terminates the enumeration. Your statement "the wrapper can only sees the return value" means nothing, since according to the documentation this function isn't supposed to return anything. Why don't you forget about analyzing the return value and just wrap the call to EnumWindows in a try: except: block if you want to suppress the exception.