Re: windll

eryk sun <[email protected]> Tue, 29 Nov 2016 02:45:00 +0000
Newsgroups gmane.comp.python.ctypes
Message-ID <CACL+1atu=1eZvk_KhCVKBGiW=aCPptW8o0AvaAoE0NRrFN-L5w@mail.gmail.com>
On Mon, Nov 28, 2016 at 5:08 PM, Michael C
<[email protected]> wrote:
> sorry I am new to this thing, I guess what I mean is I am looking for a list
> of every functions and classes available under ctypes, as seen here:
>
> http://nullege.com/codes/search/ctypes.windll.user32.SetWindowPos
>
> a complete list everything and a description for them,
>
> Is there something like that? especially for windll,

Actually, please avoid using cdll and windll. These global
LibraryLoader instances weren't a good idea. They cache CDLL and
WinDLL instances when accessed as attributes (e.g. windll.user32),
which cache function pointers. This leads to definition conflicts
between libraries that use the same DLL and define function prototypes
(i.e. restype, argtypes, errcheck), which is especially problematic
for common CRT and Windows API functions.

Use CDLL and WinDLL directly. I also recommend passing
use_last_error=True to WinDLL, e.g. user32 = ctypes.WinDLL('user32',
use_last_error=True) . This calls SetLastError and GetLastError around
each library function call, to set and get a thread-local value that's
more reliable in Python. You can get and set this thread-local value
via ctypes.get_last_error and ctypes.set_last_error.

------------------------------------------------------------------------------