cpython: cb55aedcc7e8 (original) (raw)

--- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1672,32 +1672,30 @@ different ways, depending on the type an The optional third item is the default value for this parameter. -This example demonstrates how to wrap the Windows MessageBoxA function so +This example demonstrates how to wrap the Windows MessageBoxW function so that it supports default parameters and named arguments. The C declaration from the windows header file is this:: WINUSERAPI int WINAPI

Here is the wrapping with :mod:ctypes:: >>> from ctypes import c_int, WINFUNCTYPE, windll

-The MessageBox foreign function can now be called in these ways::

+The MessageBox foreign function can now be called in these ways:: >>> MessageBox() >>> MessageBox(text="Spam, spam, spam") >>> MessageBox(flags=2, text="foo bar")

A second example demonstrates output parameters. The win32 GetWindowRect function retrieves the dimensions of a specified window by copying them into