Re: python, ctypes and GetIconInfo issue

2016-05-07 Thread mymyxin
Hello eryk sun, thank you very much for your help and detailed answers. With the provided links and useful information I should be able to get a better understanding how ctypes works internally. Thank you Hubert -- https://mail.python.org/mailman/listinfo/python-list

Re: python, ctypes and GetIconInfo issue

2016-05-06 Thread eryk sun
On Fri, May 6, 2016 at 9:49 AM, wrote: > > In your example you used a base class > and ICONINFO well as ICONINFOEX inherit it. > As the members of ICONINFO are part of ICONINFOEX > couldn't we do something like > > class ICONINFO_BASE(ctypes.Structure): > def __del__(self,

Re: python, ctypes and GetIconInfo issue

2016-05-06 Thread eryk sun
On Fri, May 6, 2016 at 8:36 AM, wrote: > >> Please avoid windll. It caches the loaded library, which in turn >> caches function pointers. So all packages that use windll.user32 are >> potentially stepping on each others' toes with mutually incompatible >> function prototypes.

Re: python, ctypes and GetIconInfo issue

2016-05-06 Thread mymyxin
A further question if you don't mind. In your example you used a base class and ICONINFO well as ICONINFOEX inherit it. As the members of ICONINFO are part of ICONINFOEX couldn't we do something like class ICONINFO_BASE(ctypes.Structure): def __del__(self, ): if self.hbmMask:

Re: python, ctypes and GetIconInfo issue

2016-05-06 Thread mymyxin
Hello eryk sun, first of all thank you very much, really appreciate your help. Please be informed that I'm a python beginner, so forgive me if my following questions sound stupid (also I'm not a native speaker). > Please avoid windll. It caches the loaded library, which in turn > caches function

Re: python, ctypes and GetIconInfo issue

2016-05-05 Thread eryk sun
On Thu, May 5, 2016 at 3:47 PM, wrote: > > I try to make the GetIconInfo function work, but I can't figure out > what I'm doing wrong. > > From the MSDN documentation the function is > > https://msdn.microsoft.com/en-us/library/windows/desktop/ms648070%28v=vs.85%29.aspx > >

python, ctypes and GetIconInfo issue

2016-05-05 Thread mymyxin
Hello, I try to make the GetIconInfo function work, but I can't figure out what I'm doing wrong. >From the MSDN documentation the function is https://msdn.microsoft.com/en-us/library/windows/desktop/ms648070%28v=vs.85%29.aspx # BOOL WINAPI GetIconInfo( # _In_ HICON hIcon, #