Re: [ctypes-users] windll
Brought to you by:
theller
From: eryk s. <er...@gm...> - 2016-11-29 02:45:47
|
On Mon, Nov 28, 2016 at 5:08 PM, Michael C <mys...@gm...> 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. |