Product Documentation

ActivePython 2.4 Documentation

Module win32gui

A module which provides an interface to the native win32 GUI API.
Note that a module winxpgui also exists, which has the same methods as win32gui, but has an XP manifest and is setup for side-by-side sharing support for certain system DLLs, notably commctl32.

Methods

EnumFontFamilies
Enumerates the available font families. 

set_logger
Sets a logger object for exceptions and error information 

LOGFONT
Creates a LOGFONT object. 

CreateFontIndirect
function creates a logical font that has the specified characteristics. The font can subsequently be selected as the current font for any device context. 

GetObject
 

GetObjectType
Returns the type (OBJ_* constant) of a GDI handle 

PyMakeBuffer
Returns a buffer object from addr,len or just len 

PyGetString
Returns a string object from an address. 

PySetString
Copies a string to an address (null terminated). You almost certainly should use win32gui::PySetMemory instead. 

PySetMemory
Copies bytes to an address. 

PyGetArraySignedLong
Returns a signed long from an array object at specified index 

PyGetBufferAddressAndLen
Returns a buffer object address and len 

FlashWindow
The FlashWindow function flashes the specified window one time. It does not change the active state of the window. 

FlashWindowEx
The FlashWindowEx function flashes the specified window a specified number of times. 

AnimateWindow
Enables you to produce special effects when showing or hiding windows. There are three types of animation: roll, slide, and alpha-blended fade. 

UpdateLayeredWindow
Updates the position, size, shape, content, and translucency of a layered window. 

GetWindowLong
 

GetClassLong
 

SetWindowLong
 

CallWindowProc
 

SendMessage
Sends a message to the window. 

SendMessageTimeout
Sends a message to the window. 

PostMessage
 

PostThreadMessage
 

ReplyMessage
Used to reply to a message sent through the SendMessage function without returning control to the function that called SendMessage. 

RegisterWindowMessage
Defines a new window message that is guaranteed to be unique throughout the system. The message value can be used when sending or posting messages. 

DefWindowProc
 

EnumWindows
Enumerates all top-level windows on the screen by passing the handle to each window, in turn, to an application-defined callback function. EnumWindows continues until the last top-level window is enumerated or the callback function returns FALSE 

EnumThreadWindows
Enumerates all top-level windows associated with a thread on the screen by passing the handle to each window, in turn, to an application-defined callback function. EnumThreadWindows continues until the last top-level window associated with the thread is enumerated or the callback function returns FALSE 

EnumChildWindows
Enumerates the child windows that belong to the specified parent window by passing the handle to each child window, in turn, to an application-defined callback function. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE. 

DialogBox
Creates a modal dialog box. 

DialogBoxParam
See win32gui::DialogBox 

DialogBoxIndirect
Creates a modal dialog box from a template, see win32ui::CreateDialogIndirect 

DialogBoxIndirectParam
See win32gui::DialogBoxIndirect 

CreateDialogIndirect
Creates a modeless dialog box from a template, see win32ui::CreateDialogIndirect 

DialogBoxIndirectParam
See win32gui::CreateDialogIndirect 

EndDialog
Ends a dialog box. 

GetDlgItem
Retrieves the handle to a control in the specified dialog box. 

GetDlgItemInt
Returns the integer value of a dialog control 

SetDlgItemInt
Places an integer value in a dialog control 

GetDlgCtrlID
Retrieves the identifier of the specified control. 

GetDlgItemText
Returns the text of a dialog control 

SetDlgItemText
Sets the text for a window or control 

GetNextDlgTabItem
Retrieves a handle to the first control that has the WS_TABSTOP style that precedes (or follows) the specified control. 

GetNextDlgGroupItem
Retrieves a handle to the first control in a group of controls that precedes (or follows) the specified control in a dialog box. 

SetWindowText
Sets the window text. 

GetWindowText
Get the window text. 

InitCommonControls
Initializes the common controls. 

InitCommonControlsEx
Initializes specific common controls. 

LoadCursor
Loads a cursor. 

SetCursor
 

GetCursor
 

GetCursorInfo
Retrieves information about the global cursor. 

CreateAcceleratorTable
Creates an accelerator table 

DestroyAccleratorTable
Destroys an accelerator table 

LoadMenu
Loads a menu 

DestroyMenu
Destroys a previously loaded menu. 

SetMenu
Sets the menu for the specified window. 

GetMenu
Gets the menu for the specified window. 

LoadIcon
Loads an icon 

CopyIcon
Copies an icon 

DrawIcon
Draws an icon or cursor into the specified device context. To specify additional drawing options, use the win32gui::DrawIconEx function. 

DrawIconEx
Draws an icon or cursor into the specified device context, performing the specified raster operations, and stretching or compressing the icon or cursor as specified. 

CreateIconIndirect
Creates an icon or cursor from an ICONINFO structure. 

CreateIconFromResource
Creates an icon or cursor from resource bits describing the icon. 

LoadImage
Loads a bitmap, cursor or icon 

DeleteObject
Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid. 

BitBlt
Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context. 

StretchBlt
Copies a bitmap from a source rectangle into a destination rectangle, stretching or compressing the bitmap to fit the dimensions of the destination rectangle, if necessary 

SetStretchBltMode
 

MaskBlt
Combines the color data for the source and destination bitmaps using the specified mask and raster operation. 

ImageList_Add
Adds an image or images to an image list. 

ImageList_Create
Create an image list 

ImageList_Destroy
Destroy an imagelist 

ImageList_Draw
Draw an image on an HDC 

ImageList_DrawEx
Draw an image on an HDC 

ImageList_GetIcon
Extract an icon from an imagelist 

ImageList_GetImageCount
Return count of images in imagelist 

ImageList_LoadImage
Loads bitmaps, cursors or icons, creates imagelist 

ImageList_LoadBitmap
Creates an image list from the specified bitmap resource. 

ImageList_Remove
Remove an image from an imagelist 

ImageList_Replace
Replace an image in an imagelist with a bitmap image 

ImageList_ReplaceIcon
Replace an image in an imagelist with an icon image 

ImageList_SetBkColor
Set the background color for the imagelist 

ImageList_SetOverlayImage
Adds a specified image to the list of images to be used as overlay masks. An image list can have up to four overlay masks in version 4.70 and earlier and up to 15 in version 4.71. The function assigns an overlay mask index to the specified image. 

MessageBox
Displays a message box 

MessageBeep
Plays a waveform sound. 

CreateWindow
Creates a new window. 

DestroyWindow
 

EnableWindow
Enables and disables keyboard and mouse input to a window 

FindWindow
Retrieves a handle to the top-level window whose class name and window name match the specified strings. 

FindWindowEx
Retrieves a handle to the top-level window whose class name and window name match the specified strings. 

DragAcceptFiles
Registers whether a window accepts dropped files. 

DragDetect
captures the mouse and tracks its movement until the user releases the left button, presses the ESC key, or moves the mouse outside the drag rectangle around the specified point. 

SetDoubleClickTime
 

GetDoubleClickTime
 

HideCaret
 

SetCaretPos
 

ShowCaret
 

ShowWindow
 

IsWindowVisible
Indicates if the window has the WS_VISIBLE style. 

IsWindowEnabled
Indicates if the window is enabled. 

SetFocus
Sets focus to the specified window. 

GetFocus
Returns the HWND of the window with focus. 

UpdateWindow
 

BringWindowToTop
 

SetActiveWindow
 

GetActiveWindow
 

SetForegroundWindow
 

GetForegroundWindow
 

GetClientRect
 

GetDC
Gets the device context for the window. 

DeleteDC
Deletes a DC 

CreateCompatibleDC
Creates a memory device context (DC) compatible with the specified device. 

CreateCompatibleBitmap
Creates a bitmap compatible with the device that is associated with the specified device context. 

CreateBitmap
Creates a bitmap 

SelectObject
Selects an object into the specified device context (DC). The new object replaces the previous object of the same type. 

GetWindowRect
 

GetStockObject
 

PostQuitMessage
 

WaitMessage
Waits for a message 

SetWindowPos
 

GetWindowPlacement
Returns placement information about the current window. 

SetWindowPlacement
Sets the windows placement 

RegisterClass
Registers a window class. 

UnregisterClass
 

PumpMessages
Runs a message loop until a WM_QUIT message is received. 

PumpWaitingMessages
Pumps all waiting messages for the current thread. 

GetMessage
 

TranslateMessage
 

DispatchMessage
 

TranslateAccelerator
 

PeekMessage
 

Shell_NotifyIcon
Adds, removes or modifies a taskbar icon, 

GetSystemMenu
 

DrawMenuBar
 

MoveWindow
 

CloseWindow
 

DeleteMenu
 

RemoveMenu
 

CreateMenu
 

CreatePopupMenu
 

TrackPopupMenu
Display popup shortcut menu 

CommDlgExtendedError
 

ExtractIcon
 

ExtractIconEx
 

DestroyIcon
 

GetIconInfo
 

ScreenToClient
Convert screen coordinates to client coords 

ClientToScreen
Convert client coordinates to screen coords 

GetTextExtentPoint32
Computes the width and height of the specified string of text. 

GetOpenFileName
Creates an Open dialog box that lets the user specify the drive, directory, and the name of a file or set of files to open. 

InsertMenuItem
Inserts a menu item 

SetMenuItemInfo
Sets menu information 

GetMenuItemInfo
Gets menu information 

GetMenuItemCount
 

GetMenuItemRect
 

GetMenuState
 

SetMenuDefaultItem
 

GetMenuDefaultItem
 

AppendMenu
 

InsertMenu
 

EnableMenuItem
 

CheckMenuItem
 

GetSubMenu
 

ModifyMenu
Changes an existing menu item. This function is used to specify the content, appearance, and behavior of the menu item. 

GetMenuItemID
Retrieves the menu item identifier of a menu item located at the specified position in a menu. 

SetMenuItemBitmaps
Associates the specified bitmap with a menu item. Whether the menu item is selected or clear, the system displays the appropriate bitmap next to the menu item. 

CheckMenuRadioItem
Checks a specified menu item and makes it a radio item. At the same time, the function clears all other menu items in the associated group and clears the radio-item type flag for those items. 

SetMenuInfo
Sets information for a specified menu. 

GetMenuInfo
Gets information about a specified menu. 

DrawFocusRect
 

DrawText
Draws formatted text on a device context 

ExtTextOut
Writes text to a DC. 

SetTextColor
Changes the text color for a device context 

SetBkMode
Sets the background mode for a device context 

SetBkColor
Sets the background color for a device context 

DrawEdge
 

FillRect
 

DrawAnimatedRects
 

CreateSolidBrush
 

CreatePen
 

GetSysColor
 

GetSysColorBrush
 

InvalidateRect
 

FrameRect
 

GetUpdateRgn
 

Rectangle
 

BeginPaint
 

EndPaint
 

CreateWindowEx
Creates a new window with Extended Style. 

GetParent
Retrieves a handle to the specified child window's parent window. 

SetParent
changes the parent window of the specified child window. 

GetCursorPos
retrieves the cursor's position, in screen coordinates. 

GetDesktopWindow
returns the desktop window 

GetWindow
returns a window that has the specified relationship (Z order or owner) to the specified window. 

GetWindowDC
returns the device context (DC) for the entire window, including title bar, menus, and scroll bars. 

IsIconic
determines whether the specified window is minimized (iconic). 

IsWindow
determines whether the specified window handle identifies an existing window. 

IsChild
Tests whether a window is a child window or descendant window of a specified parent window 

ReleaseCapture
Releases the moust capture for a window. 

GetCapture
Returns the window with the mouse capture. 

SetCapture
Captures the mouse for the specified window. 

_TrackMouseEvent
Posts messages when the mouse pointer leaves a window or hovers over a window for a specified amount of time. 

ReleaseDC
Releases a device context. 

CreateCaret
 

DestroyCaret
 

ScrollWindowEx
scrolls the content of the specified window's client area. 

SetScrollInfo
Sets information about a scroll-bar 

GetScrollInfo
Returns information about a scroll bar 

GetClassName
Retrieves the name of the class to which the specified window belongs. 

WindowFromPoint
Retrieves a handle to the window that contains the specified point. 

ChildWindowFromPoint
Determines which, if any, of the child windows belonging to a parent window contains the specified point. 

ChildWindowFromPoint
Determines which, if any, of the child windows belonging to a parent window contains the specified point. 

ListView_SortItems
Uses an application-defined comparison function to sort the items of a list view control. 

ListView_SortItemsEx
Uses an application-defined comparison function to sort the items of a list view control. 

CreateDC
Creates a device context for a printer or display device 

GetSaveFileNameW
Creates a dialog for user to specify location to save a file or files 

GetOpenFileNameW
Creates a dialog to allow user to select file(s) to open 

SystemParametersInfo
Queries or sets system-wide parameters. This function can also update the user profile while setting a parameter. 

SetLayeredWindowAttributes
Sets the opacity and transparency color key of a layered window. 

GetLayeredWindowAttributes
Retrieves the layering parameters of a window with the WS_EX_LAYERED extended style