Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL
Help

Part 4: Appendixes > Win32 Extensions Reference - Pg. 529

Appendix B B Win32 Extensions Reference Documenting the entire Windows SDK would require a number of books this size. Therefore, we limit ourselves to a brief reference to the SDK functions and objects presented in this book. For further information, you may wish to consult the reference guides distributed with the Python for Windows Extensions, the Microsoft SDK documentation, or any other good Windows programming text. Common Win32 Python Objects PyHANDLE A PyHANDLE object represents a Win32 handle. When a PyHANDLE object is no longer referenced, the Win32 handle is automatically closed. Thus, it isn't strictly necessary (although still considered good style) to explicitly close these handles. There are a number of variations on a PyHANDLE object, such as the PyHKEY object. These handle objects are identical in operation to a standard PyHANDLE object, but the underlying implementation uses different Win32 functions to close the handle automatically. From the Python programmers point of view, these han- dles all share the same interface. Handles are obtained from a number of Win32 functions, such as functions that open or create files or registry keys. When a function requires a PyHANDLE object, it usually also accepts an integer, which is expected to be the raw Win32 handle value. 529 This is the Title of the Book, eMatter Edition Copyright © 2008 O'Reilly & Associates, Inc. All rights reserved.