win32gui.FindWindow problems

Tim Roberts timr at probo.com
Sun Nov 12 23:37:21 EST 2000


"Alex Martelli" <aleaxit at yahoo.com> wrote:

>"Dale Strickland-Clark" <dale at out-think.NOSPAMco.uk> wrote in message
>news:q05p0told569nfa8m1j0gougvau06a5h0u at 4ax.com...
>    [snip]
>> I can't make it work either. It's not clear from the docs how to specify a
>NULL for the first arg -
>> which is what I think you need. I tried 0 and None but both crash Python.
>
>FindWindow is not documented in the Win32 API's to support NULL as
>a first parameter.

I was going to give you a big "HUH?" in response to this, but I see that
the MSDN web page on FindWindow does not explicitly state that NULL is
allowed for the class name.  This is a documentation failure, not an API
restriction: the MSDN web page is incomplete.  NULL is a valid option for
either parameter to FindWindow, and specifies that the option is not to be
used as a criteria in the search.  It has always worked, and it will
continue to work.

The page on CWnd::FindWindow says this explicitly:

http://msdn.microsoft.com/library/devprods/vs6/visualc/vcmfc/_mfc_cwnd.3a3a.findwindow.htm

and CWnd::FindWindow is implemented as an inline call to FindWindow.
Microsoft uses the NULL first parameter in their examples; see knowledge
base article Q124103.

Dale correctly pointed out the problem; he needs to pass a NULL, not a
zero-length string.  I don't know how to do this, either.
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list