A module, encapsulating the Microsoft Foundation Classes.
-
Add a file name to the Recent File List.
-
Compares 2 paths.
-
Creates an MDI Frame window.
-
Creates an MDI Child window.
-
Create a bitmap object.
-
Creates a bitmap object from a HBITMAP.
-
Creates a new GDI brush object. Returns a PyCBrush object.
-
Creates a button object. PyCButton::CreateWindow creates the actual control.
-
Creates a color selection dialog box.
-
Creates an OLE control.
-
Creates an ControlBar
-
Creates a control view object.
-
Creates a PyCDC object.
-
Creates a PyCDC object from an integer handle.
-
Creates a PyCDialog object.
-
Creates a PyCDialogBar object.
-
Creates a PyCDialog object from a template.
-
Creates a PyCPrintDialog object.
-
Create a PyCDocTemplate object.
-
Creates an edit object. PyCEdit::CreateWindow creates the actual control.
-
Creates a FileOpen common dialog.
-
Creates a font selection dialog box.
-
Creates a form view object.
-
Creates a frame window.
-
Creates an PyCImageList object.
-
Creates a list control.
-
Creates a PyCListView object.
-
Creates a tree control.
-
Creates a PyCTreeView object.
-
Returns a HPALETTE
-
Creates a popup menu.
-
Creates a menu
-
Creates a PyCPen
object.
-
Creates a progress bar object. PyCProgressCtrl::CreateWindow creates the actual control.
-
Creates a PyCPropertyPage object.
-
Creates a PyCPropertyPage object from a template.
-
Creates a PyCPropertySheet object
-
Initializes a PyCRgn to a rectangle
-
Creates a new PyCRgn object.
-
Creates a rich edit control.
-
Create a PyCRichEditDocTemplate object.
-
Creates a PyCRichEditView object.
-
Creates a slider control object. PyCSliderCtrl::CreateWindow creates the actual control.
-
Creates a splitter window.
-
Creates a status bar object.
-
Creates a new status bar control object. PyCStatusBarCtrl::CreateWindow creates the actual control.
-
Creates a PyCFont object.
-
Creates a toolbar object.
-
Creates a toolbar object.
-
Creates a tooltip control object.
-
Creates a PyCWinThread object.
-
Creates a PyCView object.
-
Creates an PyCEditView object.
-
Starts a debugging thread.
-
Creates a PyCWnd from an integer containing a HWND
-
Create a new unitialized PyCWnd object
-
Cleans up the debugger thread.
-
Changes the cursor to/from a wait cursor.
-
Displays a traceback in a dialog box.
-
Enables 3d controls for the application.
-
Searches for the specified top-level window
-
Searches for the specified top-level or child window
-
Returns the full path name of the file.
-
Retrieves the active window.
-
Retrieves the application object.
-
Retrieves the name of the current application.
-
Returns the registry key for the application.
-
Gets raw bytes from memory
-
Returns the command line for hte application.
-
Calls the API version of GetDeviceCaps. See also PyCDC::GetDeviceCaps
-
Given a file name, return its title
-
Retrieves the window with the focus.
-
Retrieves the foreground window.
-
Returns a halftone brush.
-
Returns the requested state that the application start in. This is the same as the parameter available to PyCWnd::ShowWindow
-
Returns a window object for the main application frame.
-
Returns the name of the current application.
-
Returns the name of the INI file used by the application.
-
Returns a value from the applications INI file.
-
Returns the recent file list.
-
Gets a resource.
-
Retrieves the current thread object.
-
Retrieves a Python Type object given its name
-
Initializes the rich edit framework.
-
Installs a callback caller.
-
Returns a flag indicating if the current win32ui build is a DEBUG build.
-
Determines if the application is running under Win32s.
-
Determines if the passed object is a win32ui object.
-
Loads a dialog resource, and returns a list detailing the objects.
-
Creates a PyDLL object.
-
Loads a menu.
-
Loads standard application profile settings.
-
Loads a string from a resource file.
-
Displays a message box.
-
Writes output to the Windows debugger.
-
Call this function in your application object's InitInstance function to enable support for containment of OLE controls.
-
Prints a Traceback using the default Python traceback printer.
-
Pumps all waiting messages to the application.
-
Registers a window class
-
Removes the recent file at list index.
-
Sets the application help file path, i.e. the pApp->m_pszHelpFilePath member variable.
-
Sets the application name.
-
Sets the MFC variable afxCurrentInstanceHandle.
-
Sets the MFC variable afxCurrentResourceHandle.
-
Sets the default background and text color for dialog boxes and message boxes within the application.
-
Sets the INI file name used by the application.
-
Causes application settings to be stored in the registry instead of INI files.
-
Specifies the default DLL object for application resources.
-
Sets the text in the status bar.
-
Starts the debugger message pump.
-
Stops the debugger message pump.
-
Calls ::TranslateMessage.
-
Translates a virtual key.
-
Invokes the Window Help engine.
-
Writes a value to the INI file.
const win32ui.AFX_IDW_PANE_FIRST;
Id of the first splitter pane
const win32ui.AFX_IDW_PANE_LAST;
Id of the last splitter pane
const win32ui.AFX_WS_DEFAULT_VIEW;
win32ui.AddToRecentFileList
AddToRecentFileList(fileName) Adds an entry to the applications Recent File List.
-
fileName : string
The file name to be added to the list.
- CWinApp::AddToRecentFileList
const win32ui.CDocTemplate_Confidence_maybeAttemptForeign;
const win32ui.CDocTemplate_Confidence_maybeAttemptNative;
const win32ui.CDocTemplate_Confidence_noAttempt;
const win32ui.CDocTemplate_Confidence_yesAlreadyOpen;
const win32ui.CDocTemplate_Confidence_yesAttemptForeign;
const win32ui.CDocTemplate_Confidence_yesAttemptNative;
const win32ui.CDocTemplate_docName;
const win32ui.CDocTemplate_fileNewName;
const win32ui.CDocTemplate_filterExt;
const win32ui.CDocTemplate_filterName;
const win32ui.CDocTemplate_regFileTypeId;
const win32ui.CDocTemplate_regFileTypeName;
const win32ui.CDocTemplate_windowTitle;
const win32ui.CRichEditView_WrapNone;
const win32ui.CRichEditView_WrapToTargetDevice;
const win32ui.CRichEditView_WrapToWindow;
win32ui.ComparePath
int = ComparePath(path1, path2
) Compares 2 paths.
-
path1 : string
The path name.
-
path2 : string
The path name.
win32ui.CreateBitmap
PyCBitMap = CreateBitmap() Creates a bitmap object.
win32ui.CreateBitmapFromHandle
PyCBitMap = CreateBitmapFromHandle() Creates a bitmap object from a HBITMAP.
win32ui.CreateBrush
PyCBrush = CreateBrush() Creates a new brush object.
-
style
The brush style.
-
color
The brush color.
-
hatch
The brush hatching.
If called with no arguments, an uninitialized brush is created.
win32ui.CreateButton
PyCButton = CreateButton() Creates a button object. PyCButton::CreateWindow creates the actual control.
win32ui.CreateColorDialog
PyCColorDialog = CreateColorDialog(initColor, flags
, parent
) Creates a color selection dialog box.
self*/, PyObject *args )
-
initColor=0 : int
The initial color.
-
flags=0 : int
The choose-color flags to use.
-
parent=None : PyCWnd
The parent or owner window of the dialog.
win32ui.CreateControl
PyCWnd = CreateControl(classId, windowName
, style
, rect
, parent
, id
, obPersist
, bStorage
, licKey
) Creates an OLE control.
-
classId : string
The class ID for the window.
-
windowName : string
The title for the window.
-
style : int
The style for the control.
-
rect : (left, top, right, bottom)
The default position of the window.
-
parent : PyCWnd
The parent window
-
id : int
The child ID for the view
-
obPersist=None : object
Place holder for future support.
-
bStorage=FALSE : int
Not used.
-
licKey=None : string
The licence key for the control.
The result is a PyCWnd (or derived) object, or a win32ui.error exception is raised.
win32ui.CreateControlBar
PyCControlBar = CreateControlBar() Creates a control bar object.
win32ui.CreateCtrlView
PyCCtrlView = CreateCtrlView(doc, className
, style
) Creates a control view object.
-
doc : PyCDocument
The document.
-
className : string
The class name of the control
-
style=0 : int
Additional style bits
win32ui.CreateDC
CreateDC() Creates an uninitialised device context.
win32ui.CreateDCFromHandle
CreateDCFromHandle() Creates a DC object from an integer handle.
win32ui.CreateDebuggerThread
CreateDebuggerThread() Starts a debugging thread (ie, creates the "break" button).
This allows an application which is performing a long operation to dispatch paint messages during the operation.
win32ui.CreateDialog
PyCDialog = CreateDialog(idRes, dll
) Creates a dialog object.
-
idRes : int
The ID of the dialog resource to load.
-
dll=None : PyDLL
The DLL object to load the dialog from.
win32ui.CreateDialogBar
PyCDialogBar = CreateDialogBar() Creates a PyCDialogBar object.
win32ui.CreateDialogIndirect
PyCDialog = CreateDialogIndirect(obList) Creates a dialog object from a template.
-
obList : list
A list of [PyDLGTEMPLATE, PyDLGITEMTEMPLATE, ...], which describe the dialog to be created.
win32ui.CreateDocTemplate
PyCDocTemplate = CreateDocTemplate(idRes) Creates a document template object.
-
idRes : int
The ID for resources for documents of this type.
win32ui.CreateEdit
PyCEdit = CreateEdit() Creates an Edit object. PyCEdit::CreateWindow creates the actual control.
win32ui.CreateEditView
PyCEditView = CreateEditView(doc) Creates a PyEditView object.
-
doc : PyCDocument
The document to use with the view.
win32ui.CreateFileDialog
PyCFileDialog = CreateFileDialog(bFileOpen, defExt
, fileName
, flags
, filter
, parent
) Creates a File Open/Save/etc Common Dialog.
self*/, PyObject *args )
-
bFileOpen : int
A flag indicating if the Dialog is a FileOpen or FileSave dialog.
-
defExt=None : string
The default file extension for saved files. If None, no extension is supplied.
-
fileName=None : string
The initial filename that appears in the filename edit box. If None, no filename initially appears.
-
flags=win32con.OFN_HIDEREADONLY|win32con.OFN_OVERWRITEPROMPT : int
The flags for the dialog. See the API documentation for full details.
-
filter=None : string
A series of string pairs that specify filters you can apply to the file.
If you specify file filters, only selected files will appear
in the Files list box. The first string in the string pair describes
the filter; the second string indicates the file extension to use.
Multiple extensions may be specified using ';' as the delimiter.
The string ends with two '|' characters. May be None.
-
parent=None : PyCWnd
The parent or owner window of the dialog.
win32ui.CreateFont
PyCFont = CreateFont(properties) Creates a PyCFont object.
-
properties : dict
A dictionary containing the font
properties. Valid dictionary keys are:
height
width
escapement
orientation
weight
italic
underline
strike out
charset
out precision
clip precision
quality
pitch and family
name
The code for the PyCFont was contributed by Dave Brennan
(Last known address is brennan@hal.com, but I hear he is now at Microsoft)
args contains a dict of font properties
win32ui.CreateFontDialog
PyCFontDialog = CreateFontDialog(font, flags
, dcPrinter
, parent
) Creates a font selection dialog box.
self*/, PyObject *args )
-
font=None : dict/tuple
A dictionary describing a LOGFONT, or a tuple describing a CHARFORMAT.
-
flags=win32con.CF_EFFECTS|win32con.CF_SCREENFONTS : int
The choose-font flags to use.
-
dcPrinter=None : PyCDC
Show fonts available for the specified device.
-
parent=None : PyCWnd
The parent or owner window of the dialog.
win32ui.CreateFormView
PyCFormView = CreateFormView(doc, Template
) Creates a form view object.
-
doc : PyCDocument
The document to use with the view.
-
Template : int/str
Name or ID of the dialog template resource
win32ui.CreateFrame
PyFrameWnd
= CreateFrame() Creates a Frame window.
The window object (not the OS window) created. An exception is raised if an error occurs.
win32ui.CreateImageList
int = CreateImageList(cx, cy
, mask
, initial
, grow
) Creates an image list.
-
cx : int
Dimension of each image, in pixels.
-
cy : int
Dimension of each image, in pixels.
-
mask : int
TRUE if the image contains a mask; otherwise FALSE.
-
initial : int
Number of images that the image list initially contains.
-
grow : int
Number of images by which the image list can grow when the system needs to resize the list to make room for new images. This parameter represents the number of new images the resized image list can contain.
-
bitmapId
Resource name or ID of the bitmap to be associated with the image list.
-
cx
Dimension of each image, in pixels.
-
grow
Number of images by which the image list can grow when the system needs to resize the list to make room for new images. This parameter represents the number of new images the resized image list can contain.
-
crMask
Color used to generate a mask. Each pixel of this color in the specified bitmap is changed to black, and the corresponding bit in the mask is set to one.
win32ui.CreateListCtrl
PyCListCtrl = CreateListCtrl() Creates a list control.
win32ui.CreateListView
PyCListView = CreateListView(doc) Creates a PyCListView object.
-
doc : PyCDocument
The document to use with the view.
win32ui.CreateMDIChild
PyCMDIChildWnd = CreateMDIChild() Creates an MDI Child window.
The window object created. An exception is raised if an error occurs.
win32ui.CreateMDIFrame
PyCMDIFrameWnd = CreateMDIFrame() Creates an MDI Frame window.
An MDI Frame Window is usually the main application window.
Therefore there is uaually only one of these windows per application.
An application can only hae one main window. This method will fail if the application
window already exists.
The window object created. An exception is raised if an error occurs.
win32ui.CreateMenu
PyCMenu = CreateMenu() Creates a menu object.
win32ui.CreatePalette
int = CreatePalette(lp) Creates a HPALETTE
-
lp : LOGPALETTE
The entries for the palette.
win32ui.CreatePen
PyCPen
= CreatePen(style, width
, color
) Creates a PyCPen
object.
static*/ PyObject *
-
style : int
The pen style.
-
width : int
The pen width.
-
color : long
The pen color.
win32ui.CreatePopupMenu
PyCMenu = CreatePopupMenu() Creates a popup menu object.
win32ui.CreatePrintDialog
PyCPrintDialog = CreatePrintDialog(idRes, bPrintSetupOnly
, dwFlags
, parent
, dll
) Creates a print dialog object.
-
idRes : int
The ID of the dialog resource to load.
-
bPrintSetupOnly=FALSE : int
Specifies whether the standard Windows Print dialog box or Print Setup dialog box is displayed.
-
dwFlags=PD_ALLPAGES|PD_USEDEVMODECOPIES|PD_NOPAGENUMS|PD_HIDEPRINTTOFILE|PD_NOSELECTION : int
One or more flags you can use to customize the settings of the dialog box, combined using the bitwise OR operator.
-
parent=None : PyCWnd
A pointer to the dialog box parent or owner window.
-
dll=None : PyDLL
The DLL object to load the dialog from.
win32ui.CreateProgressCtrl
PyCProgressCtrl = CreateProgressCtrl() Creates a progress control object. PyProgressCtrl::Create
creates the actual control.
win32ui.CreatePropertyPage
PyCPropertyPage = CreatePropertyPage(resource, caption
) Creates a property page object.
-
resource : PyResourceId
String template name or inteter resource ID to use for the page.
-
caption=0 : int
The ID if the string resource to use for the caption.
win32ui.CreatePropertyPageIndirect
PyCPropertyPage = CreatePropertyPageIndirect(resourceList, caption
) Creates a property page object from a template.
-
resourceList : PyDialogTemplate
Definition of the page to be created.
-
caption=0 : int
The ID if the string resource to use for the caption.
win32ui.CreatePropertySheet
PyCPropertySheet = CreatePropertySheet(caption, parent
, select
) Creates a property sheet object.
-
caption : PyResourceId
The caption for the property sheet, or id of the caption
-
parent=None : PyCWnd
The parent window of the property sheet.
-
select=0 : int
The index of the first page to be selected.
win32ui.CreateRgn
PyCRgn = CreateRgn() Creates a new rgn object.
Return Values: a PyCRgn object
win32ui.CreateRichEditCtrl
PyCRichEditCtrl = CreateRichEditCtrl() Creates a rich edit control.
This method only creates the RichEdit object. To create the window, (ie, the control itself), call PyCRichEdit::CreateWindow
win32ui.CreateRichEditDocTemplate
PyCRichEditDocTemplate = CreateRichEditDocTemplate(idRes) Creates a document template object.
-
idRes : int
The ID for resources for documents of this type.
win32ui.CreateRichEditView
PyCRichEditView = CreateRichEditView(doc) Creates a PyRichEditView object.
-
doc=None : PyCDocument
The document to use with the view, or None for NULL.
win32ui.CreateSliderCtrl
PyCSliderCtrl = CreateSliderCtrl() Creates a Slider control object.
The method PySliderCtrl::CreateWindow
is used to
create the actual control.
win32ui.CreateSplitter
PyCSplitterWnd = CreateSplitter() Creates a splitter window object.
win32ui.CreateStatusBar
PyCStatusBar = CreateStatusBar(parent, style
, windowId
, ctrlStype
) Creates a statusbar object.
-
parent : PyCWnd
The parent window for the status bar.
-
style=afxres.WS_CHILD | afxres.WS_VISIBLE | afxres.CBRS_BOTTOM : int
The style for the status bar.
-
windowId=afxres.AFX_IDW_STATUS_BAR : int
The child window ID.
-
ctrlStype=0 : int
Additional styles for the creation of the embedded PyCStatusBarCtrl object.
Status bar styles supported are: commctrl.SBARS_SIZEGRIP - The status bar control includes a
sizing grip at the right end of the status bar. A sizing grip is similar to a sizing border;
it is a rectangular area that the user can click and drag to resize the parent window.
commctrl.SBT_TOOLTIPS - The status bar supports tooltips.
You must ensure no 2 status bars share the same ID.
- CStatusBar::CreateEx
win32ui.CreateStatusBarCtrl
PyCStatusBarCtrl = CreateStatusBarCtrl() Creates a progress control object. PyStatusBarCtrl::Create
creates the actual control.
win32ui.CreateThread
PyCWinThread = CreateThread() Creates a new PyCWinThread object
win32ui.CreateToolBar
PyCToolBar = CreateToolBar(parent, style
, windowId
) Creates a toolbar object.
-
parent : PyCWnd
The parent window for the toolbar.
-
style : int
The style for the toolbar.
-
windowId=afxres.AFX_IDW_TOOLBAR : int
The child window ID.
You must ensure no 2 toolbars share the same ID.
win32ui.CreateToolBarCtrl
PyCToolBarCtrl = CreateToolBarCtrl() Creates a toolbar control object. PyCToolBarCtrl::CreateWindow creates the actual control.
win32ui.CreateToolTipCtrl
PyCToolTipCtrl = CreateToolTipCtrl() Creates a progress control object. PyToolTipCtrl::Create
creates the actual control.
win32ui.CreateTreeCtrl
PyCTreeCtrl = CreateTreeCtrl() Creates a tree control.
win32ui.CreateTreeView
PyCTreeView = CreateTreeView(doc) Creates a PyCTreeView object.
-
doc : PyCDocument
The document to use with the view.
win32ui.CreateView
PyCScrollView = CreateView(doc) Creates a generic view object.
-
doc : PyCDocument
The document to use with the view.
win32ui.CreateWindowFromHandle
PyCWnd = CreateWindowFromHandle(hwnd) Creates a PyCWnd from an integer containing a HWND
-
hwnd : int
The window handle.
The result is a PyCWnd (or derived) object, or a win32ui.error exception is raised.
win32ui.CreateWnd
PyCWnd = CreateWnd() Creates an unitialized PyCWnd
win32ui.DestroyDebuggerThread
DestroyDebuggerThread() Cleans up the debugger thread. See win32ui::CreateDebuggerThread.
win32ui.DisplayTraceback
DisplayTraceback() Displays a traceback in a dialog box.
win32ui.DoWaitCursor
DoWaitCursor(code) Dispay a wait cursor.
-
code : int
If this parameter is 0, the original cursor is restored. If 1, a wait cursor appears. If -1, the wait cursor ends.
win32ui.Enable3dControls
int = Enable3dControls() Enables 3d controls for the application.
True if 3d controls could be enabled, false otherwise.
win32ui.EnableControlContainer
int = EnableControlContainer() Enables support for containment of OLE controls.
const win32ui.FWS_ADDTOTITLE;
MFC Frame Window style extension. Add document title to window title.
const win32ui.FWS_PREFIXTITLE;
MFC Frame Window style extension.
const win32ui.FWS_SNAPTOBARS;
MFC Frame Window style extension.
win32ui.FindWindow
PyCWnd = FindWindow(className, windowName
) Searches for the specified top-level window
-
className : string
The window class name to find, else None
-
windowName : string
The window name (ie, title) to find, else None
The result is a PyCWnd (or derived) object, or a win32ui.error exception is raised.
win32ui.FindWindowEx
PyCWnd = FindWindowEx(parentWindow, childAfter
, className
, windowName
) Searches for the specified top-level or child window
-
parentWindow : PyCWnd
The parent whose children will be searched. If None, the desktops window will be used.
-
childAfter : PyCWnd
The search begins with the next window in the Z order. If None, all children are searched.
-
className : string
The window class name to find, else None
-
windowName : string
The window name (ie, title) to find, else None
The result is a PyCWnd (or derived) object, or a win32ui.error exception is raised.
win32ui.FullPath
string = FullPath(path) Return the fully qualified path of a file name.
-
path : string
The path name.
win32ui.GetActiveWindow
PyCWnd = GetActiveWindow() Retrieves the active window.
The result is a PyCWnd (or derived) object, or a win32ui.error exception is raised.
win32ui.GetApp
PyCWinApp = GetApp() Retrieves the application object.
There will only ever be one application object per application.
win32ui.GetAppName
int = GetAppName() Returns the application name.
win32ui.GetAppRegistryKey
GetAppRegistryKey() Returns the registry key for the application.
win32ui.GetBytes
string = GetBytes(address, size
) Gets raw bytes from memory
-
address : int
The memory address
-
size : int
The size to get.
This method is useful to help decode unknown notify messages.
You must be very carefull when using this method.
The result is a string with a length of size.
win32ui.GetCommandLine
string = GetCommandLine() Returns the application's command line.
- Search for GetCommandLine at msdn, google or google groups.
win32ui.GetDeviceCaps
int = GetDeviceCaps(hdc, index
) Calls the API version of GetDeviceCaps. See also PyCDC::GetDeviceCaps
-
hdc : int
-
index : int
win32ui.GetFileTitle
string = GetFileTitle(fileName) Given a file name, return its title
-
fileName : string
The file name.
win32ui.GetFocus
PyCWnd = GetFocus() Retrieves the window with the focus.
The result is a PyCWnd (or derived) object, or a win32ui.error exception is raised.
win32ui.GetForegroundWindow
PyCWnd = GetForegroundWindow() Retrieves the foreground window.
The result is a PyCWnd (or derived) object, or a win32ui.error exception is raised.
win32ui.GetHalftoneBrush
PyCBrush = GetHalftoneBrush() Creates a new halftone brush object.
win32ui.GetInitialStateRequest
int = GetInitialStateRequest() Returns the requested state that the application start in. This is the same as the parameter available to PyCWnd::ShowWindow
In some cases, it may not be possible to start in the requested mode. An application
may start in its default mode, then set its mode to match the value returned from this method.
win32ui.GetMainFrame
PyCWnd = GetMainFrame() Returns a window object for the main application frame.
win32ui.GetName
string = GetName() Returns the name of the current executable.
win32ui.GetProfileFileName
string = GetProfileFileName() Returns the name of the INI file used by the application.
win32ui.GetProfileVal
int/string = GetProfileVal(section, entry
, defValue
) Returns a value from the application's INI file.
-
section : string
The section in the INI file to read from.
-
entry : string
The entry within the section in the INI file to read.
-
defValue : int/string
The default value. The type of this parameter determines the method's return type.
win32ui.GetRecentFileList
list = GetRecentFileList() Returns the entries in the applications Recent File List.
A list of strings containing the fully qualified file names.
win32ui.GetRect
tuple = GetRect() Returns the rectangle of the main application frame. See PyCWnd::GetWindowRecr
for further details.
A tuple of integers with (left, top, right, bottom)
win32ui.GetResource
PyDLL = GetResource() Retrieve the object associated with the applications resources.
win32ui.GetThread
PyCWinApp = GetThread() Retrieves the current thread object.
win32ui.GetType
object = GetType() Retrieves a Python Type object given its name
const win32ui.IDB_BROWSER_HIER;
Id of built in bitmap for the browser
const win32ui.IDB_DEBUGGER_HIER;
const win32ui.IDB_HIERFOLDERS;
Id of built in bitmap for default hierarchical list
const win32ui.IDC_ABOUT_VERSION;
Id of 'Version' control
const win32ui.IDC_AUTOCOMPLETE;
const win32ui.IDC_AUTO_RELOAD;
const win32ui.IDC_BUTTON1;
const win32ui.IDC_BUTTON2;
const win32ui.IDC_BUTTON3;
const win32ui.IDC_BUTTON4;
const win32ui.IDC_CALLTIPS;
const win32ui.IDC_CHECK1;
const win32ui.IDC_CHECK2;
const win32ui.IDC_CHECK3;
const win32ui.IDC_COMBO1;
const win32ui.IDC_COMBO2;
const win32ui.IDC_EDIT1;
const win32ui.IDC_EDIT2;
const win32ui.IDC_EDIT3;
const win32ui.IDC_EDIT4;
const win32ui.IDC_EDIT_COLOE;
const win32ui.IDC_EDIT_TABS;
const win32ui.IDC_INDENT_SIZE;
const win32ui.IDC_KEYBOARD_CONFIG;
const win32ui.IDC_LIST1;
const win32ui.IDC_PROMPT1;
const win32ui.IDC_PROMPT2;
const win32ui.IDC_PROMPT3;
const win32ui.IDC_PROMPT4;
const win32ui.IDC_PROMPT_TABS;
const win32ui.IDC_RADIO1;
const win32ui.IDC_RADIO2;
const win32ui.IDC_RIGHTEDGE_COLUMN;
const win32ui.IDC_RIGHTEDGE_DEFINE;
const win32ui.IDC_RIGHTEDGE_ENABLE;
const win32ui.IDC_RIGHTEDGE_SAMPLE;
const win32ui.IDC_SPIN1;
const win32ui.IDC_SPIN2;
const win32ui.IDC_SPIN3;
const win32ui.IDC_TAB_SIZE;
const win32ui.IDC_USE_SMART_TABS;
const win32ui.IDC_USE_TABS;
const win32ui.IDC_VIEW_WHITESPACE;
const win32ui.IDC_VSS_INTEGRATE;
const win32ui.IDD_ABOUTBOX;
Id of built in 'About Box' dialog
const win32ui.IDD_DUMMYPROPPAGE;
Id of built in dummy property page
const win32ui.IDD_GENERAL_STATUS;
Id of a general status dialog box (fairly small, 3 static controls, minimize box)
const win32ui.IDD_LARGE_EDIT;
Id of built in 'Large Edit' dialog (dialog box with a large edit control)
const win32ui.IDD_PP_DEBUGGER;
const win32ui.IDD_PP_EDITOR;
Id of built in 'Editor' property page
const win32ui.IDD_PP_FORMAT;
Id of built in 'Format' property page
const win32ui.IDD_PP_IDE;
Id of built in 'IDE' property page
const win32ui.IDD_PP_TABS;
Id of built in 'Tabs and Whitespace' property page
const win32ui.IDD_PP_TOOLMENU;
Id of built in 'ToolsMenu' property page
const win32ui.IDD_PROPDEMO1;
Id of built in Property Page demo dialog 1
const win32ui.IDD_PROPDEMO2;
Id of built in Property Page demo dialog 2
const win32ui.IDD_RUN_SCRIPT;
Id of built in 'Run Script' dialog
const win32ui.IDD_SET_TABSTOPS;
Id of built in 'Set Tab Stops' dialog
const win32ui.IDD_SIMPLE_INPUT;
Id of built in 'Simple Input' property page.
const win32ui.IDD_TREE;
Id of built in dialog with a tree control.
const win32ui.IDD_TREE_MB;
Id of built in dialog with a tree control with multiple buttons.
const win32ui.IDR_CNTR_INPLACE;
const win32ui.IDR_DEBUGGER;
const win32ui.IDR_MAINFRAME;
const win32ui.IDR_PYTHONCONTYPE;
const win32ui.IDR_PYTHONTYPE;
const win32ui.IDR_PYTHONTYPE_CNTR_IP;
const win32ui.IDR_TEXTTYPE;
const win32ui.ID_APP_ABOUT;
const win32ui.ID_APP_EXIT;
const win32ui.ID_EDIT_CLEAR;
const win32ui.ID_EDIT_CLEAR_ALL;
const win32ui.ID_EDIT_COPY;
const win32ui.ID_EDIT_CUT;
const win32ui.ID_EDIT_FIND;
const win32ui.ID_EDIT_GOTO_LINE;
const win32ui.ID_EDIT_PASTE;
const win32ui.ID_EDIT_REDO;
const win32ui.ID_EDIT_REPEAT;
const win32ui.ID_EDIT_REPLACE;
const win32ui.ID_EDIT_SELECT_ALL;
const win32ui.ID_EDIT_SELECT_BLOCK;
const win32ui.ID_EDIT_UNDO;
const win32ui.ID_FILE_CHECK;
const win32ui.ID_FILE_CLOSE;
const win32ui.ID_FILE_IMPORT;
const win32ui.ID_FILE_LOCATE;
const win32ui.ID_FILE_MRU_FILE1;
const win32ui.ID_FILE_MRU_FILE2;
const win32ui.ID_FILE_MRU_FILE3;
const win32ui.ID_FILE_MRU_FILE4;
const win32ui.ID_FILE_NEW;
const win32ui.ID_FILE_OPEN;
const win32ui.ID_FILE_PAGE_SETUP;
const win32ui.ID_FILE_PRINT;
const win32ui.ID_FILE_PRINT_PREVIEW;
const win32ui.ID_FILE_PRINT_SETUP;
const win32ui.ID_FILE_RUN;
const win32ui.ID_FILE_SAVE;
const win32ui.ID_FILE_SAVE_ALL;
const win32ui.ID_FILE_SAVE_AS;
const win32ui.ID_HELP_GUI_REF;
const win32ui.ID_HELP_OTHER;
const win32ui.ID_HELP_PYTHON;
const win32ui.ID_INDICATOR_COLNUM;
const win32ui.ID_INDICATOR_LINENUM;
const win32ui.ID_NEXT_PANE;
const win32ui.ID_PREV_PANE;
const win32ui.ID_SEPARATOR;
const win32ui.ID_VIEW_BROWSE;
const win32ui.ID_VIEW_EOL;
const win32ui.ID_VIEW_FIXED_FONT;
const win32ui.ID_VIEW_FOLD_COLLAPSE;
const win32ui.ID_VIEW_FOLD_COLLAPSE_ALL;
const win32ui.ID_VIEW_FOLD_EXPAND;
const win32ui.ID_VIEW_FOLD_EXPAND_ALL;
const win32ui.ID_VIEW_FOLD_TOGGLE;
const win32ui.ID_VIEW_INDENTATIONGUIDES;
const win32ui.ID_VIEW_INTERACTIVE;
const win32ui.ID_VIEW_OPTIONS;
const win32ui.ID_VIEW_RIGHT_EDGE;
const win32ui.ID_VIEW_STATUS_BAR;
const win32ui.ID_VIEW_TOOLBAR;
const win32ui.ID_VIEW_TOOLBAR_DBG;
const win32ui.ID_VIEW_WHITESPACE;
const win32ui.ID_WINDOW_ARRANGE;
const win32ui.ID_WINDOW_CASCADE;
const win32ui.ID_WINDOW_NEW;
const win32ui.ID_WINDOW_SPLIT;
const win32ui.ID_WINDOW_TILE_HORZ;
const win32ui.ID_WINDOW_TILE_VERT;
win32ui.InitRichEdit
string = InitRichEdit() Initializes the rich edit framework.
win32ui.InstallCallBackCaller
object = InstallCallBackCaller() Install a Python method which will dispatch all callbacks into Python.
The previous callback caller.
win32ui.IsDebug
int = IsDebug() Returns a flag indicating if the current win32ui build is a DEBUG build.
This should not normally be of relevance to the Python
programmer. However, under certain circumstances Python code may
wish to detect this.
win32ui.IsObject
int = IsObject(o) Determines if the passed object is a win32ui object.
-
o : object
The object to check.
win32ui.IsWin32s
int = IsWin32s() Determines if the application is running under Win32s.
const win32ui.LM_COMMIT;
Remember MRUWidth
const win32ui.LM_HORZ;
same as bHorz in CalcFixedLayout
const win32ui.LM_HORZDOCK;
Horizontal Docked Dimensions
const win32ui.LM_LENGTHY;
Set if nLength is a Height instead of a Width
const win32ui.LM_MRUWIDTH;
Most Recently Used Dynamic Width
const win32ui.LM_STRETCH;
same meaning as bStretch in CalcFixedLayout. If set, ignores nLength and returns dimensions based on LM_HORZ state, otherwise LM_HORZ is used to determine if nLength is the desired horizontal or vertical length and dimensions are returned based on nLength
const win32ui.LM_VERTDOCK;
Vertical Docked Dimensions
win32ui.LoadDialogResource
list = LoadDialogResource(idRes, dll
) Loads a dialog resource, and returns a list detailing the objects.
-
idRes : int
The ID of the dialog resource to load.
-
dll=None : PyDLL
The DLL object to load the dialog from.
win32ui.LoadLibrary
PyDLL = LoadLibrary(fileName) Creates a DLL object, and loads a Windows DLL into the object.
-
fileName : string
The name of the DLL file to load.
win32ui.LoadMenu
PyCMenu = LoadMenu(id, dll
) Creates and loads a menu resource from a DLL.
-
id : int
The Id of the menu to load.
-
dll=None : PyDLL
The DLL to load from.
win32ui.LoadStdProfileSettings
LoadStdProfileSettings(maxFiles) Loads MFC standard settings from the applications INI file. This includes the Recent File List, etc.
-
maxFiles=_AFX_MRU_COUNT : int
The maximum number of files to maintain on the Recently Used File list.
This function can only be called once in an applications lifetime, else an exception is raised.
win32ui.LoadString
PyUnicode = LoadString(stringId) Loads a string from a resource file.
-
stringId : int
The ID of the string to load.
const win32ui.MFS_4THICKFRAME;
thick frame all around (no tiles)
const win32ui.MFS_BLOCKSYSMENU;
block hit testing on system menu
const win32ui.MFS_MOVEFRAME;
no sizing, just moving
const win32ui.MFS_SYNCACTIVE;
syncronize activation w/ parent
const win32ui.MFS_THICKFRAME;
use instead of WS_THICKFRAME
win32ui.MessageBox
int = MessageBox(message, title
, style
) Display a message box.
-
message : string
The message to be displayed in the message box.
-
title=None : string/None
The title for the message box. If None, the applications title will be used.
-
style=win32con.MB_OK : int
The style of the message box.
An integer identifying the button pressed to dismiss the dialog.
win32ui.OutputDebugString
OutputDebugString(msg) Sends a string to the Windows debugging device.
-
msg : string
The string to write.
const win32ui.PD_ALLPAGES;
The default flag that indicates that the All radio button is initially selected. This flag is used as a placeholder to indicate that the PD_PAGENUMS and PD_SELECTION flags are not specified.
const win32ui.PD_COLLATE;
If this flag is set, the Collate check box is checked. If this flag is set when the PrintDlg function returns, the application must simulate collation of multiple copies. For more information, see the description of the PD_USEDEVMODECOPIESANDCOLLATE flag.
const win32ui.PD_DISABLEPRINTTOFILE;
Disables the Print to File check box.
const win32ui.PD_ENABLEPRINTHOOK;
Enables the hook procedure specified in the lpfnPrintHook member. This enables the hook procedure for the Print dialog box.
const win32ui.PD_ENABLEPRINTTEMPLATE;
PD_ENABLEPRINTTEMPLATE
const win32ui.PD_ENABLEPRINTTEMPLATEHANDLE;
Indicates that the hPrintTemplate member identifies a data block that contains a preloaded dialog box template. This template replaces the default template for the Print dialog box. The system ignores the lpPrintTemplateName member if this flag is specified.
const win32ui.PD_ENABLESETUPHOOK;
Enables the hook procedure specified in the lpfnSetupHook member. This enables the hook procedure for the Print Setup dialog box.
const win32ui.PD_ENABLESETUPTEMPLATE;
Indicates that the hInstance and lpSetupTemplateName members specify a replacement for the default Print Setup dialog box template.
const win32ui.PD_ENABLESETUPTEMPLATEHANDLE;
Indicates that the hSetupTemplate member identifies a data block that contains a preloaded dialog box template. This template replaces the default template for the Print Setup dialog box. The system ignores the lpSetupTemplateName member if this flag is specified.
const win32ui.PD_HIDEPRINTTOFILE;
Hides the Print to File check box.
const win32ui.PD_NONETWORKBUTTON;
Hides and disables the Network button.
const win32ui.PD_NOPAGENUMS;
Disables the Pages radio button and the associated edit controls.
const win32ui.PD_NOSELECTION;
Disables the Selection radio button.
const win32ui.PD_NOWARNING;
Prevents the warning message from being displayed when there is no default printer.
const win32ui.PD_PAGENUMS;
If this flag is set, the Pages radio button is selected. If this flag is set when the PrintDlg function returns, the nFromPage and nFromPage members indicate the starting and ending pages specified by the user.
const win32ui.PD_PRINTSETUP;
Causes the system to display the Print Setup dialog box rather than the Print dialog box.
const win32ui.PD_PRINTTOFILE;
If this flag is set, the Print to File check box is selected. If this flag is set when the PrintDlg function returns, the offset indicated by the wOutputOffset member of the DEVNAMES structure contains the string "FILE:". When you call theStartDoc function to start the printing operation, specify this "FILE:" string in the lpszOutput member of theDOCINFO structure. Specifying this string causes the print subsystem to query the user for the name of the output file.
const win32ui.PD_RETURNDC;
Causes PrintDlg to return a device context matching the selections the user made in the dialog box. The device context is returned in hDC.
const win32ui.PD_RETURNDEFAULT;
If this flag is set, the PrintDlg function does not display the dialog box. Instead, it sets the hDevNames and hDevMode members to handles toDEVMODE and DEVNAMES structures that are initialized for the system default printer. Both hDevNames and hDevMode must be NULL, or PrintDlg returns an error. If the system default printer is supported by an old printer driver (earlier than Windows version 3.0), only hDevNames is returned; hDevMode is NULL.
const win32ui.PD_RETURNIC;
Similar to the PD_RETURNDC flag, except this flag returns an information context rather than a device context. If neither PD_RETURNDC nor PD_RETURNIC is specified, hDC is undefined on output.
const win32ui.PD_SELECTION;
If this flag is set, the Selection radio button is selected. If neither PD_PAGENUMS nor PD_SELECTION is set, the All radio button is selected.
const win32ui.PD_SHOWHELP;
Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button.
const win32ui.PD_USEDEVMODECOPIES;
Same as PD_USEDEVMODECOPIESANDCOLLATE
const win32ui.PD_USEDEVMODECOPIESANDCOLLATE;
This flag indicates whether your application supports multiple copies and collation. Set this flag on input to indicate that your application does not support multiple copies and collation. In this case, the nCopies member of the PRINTDLG structure always returns 1, and PD_COLLATE is never set in the Flags member. If this flag is not set, the application is responsible for printing and collating multiple copies. In this case, the nCopies member of the PRINTDLG structure indicates the number of copies the user wants to print, and the PD_COLLATE flag in the Flags member indicates whether the user wants collation. Regardless of whether this flag is set, an application can determine from nCopies and PD_COLLATE how many copies to render and whether to print them collated. If this flag is set and the printer driver does not support multiple copies, the Copies edit control is disabled. Similarly, if this flag is set and
const win32ui.PSWIZB_BACK;
Enable/Disable the Property sheet Back button
const win32ui.PSWIZB_DISABLEDFINISH;
Enable/Disable the Property sheet disabled Finish button
const win32ui.PSWIZB_FINISH;
Enable/Disable the Property sheet Finish button
const win32ui.PSWIZB_NEXT;
Enable/Disable the Property sheet Next button
win32ui.PrintTraceback
PrintTraceback(tb, output) Prints a traceback using the internal Python mechanism.
-
tb : object
The traceback to print.
-
output : object
The object to write the traceback to.
win32ui.PumpWaitingMessages
int = PumpWaitingMessages(firstMessage, lastMessage
) Recursively start a new message dispatching loop while any message remain in the queue.
-
firstMessage=WM_PAINT : int
The lowest message ID to retrieve
-
lastMessage=WM_PAINT : int
The highest message ID to retrieve
This allows an application which is performing a long operation to dispatch paint messages during the operation.
The result is 1 if a WM_QUIT message was processed, otherwise 0.
win32ui.RegisterWndClass
string = RegisterWndClass(style, hCursor
, hBrush
, hIcon
) Registers a window class
-
style : int
Specifies the Windows class style or combination of styles
-
hCursor=0 : int
-
hBrush=0 : int
-
hIcon=0 : int
The Microsoft Foundation Class Library automatically registers several standard window classes for you. Call this function if you want to register your own window classes.
win32ui.RemoveRecentFile
RemoveRecentFile(index) Removes the entry in the applications Recent File List at index.
-
index=0 : int
Zero-based index of the file to be removed from the MRU (most recently used) file list.
win32ui.SetAppHelpPath
int = SetAppHelpPath() Set the pApp->m_pszHelpFilePath variable.
win32ui.SetAppName
int = SetAppName(appName) Sets the name of the application.
-
appName : string
The new name for the application. This is used for the default registry key, and the title bar of the application.
- CWinApp::m_pszAppName
win32ui.SetCurrentInstanceHandle
int = SetCurrentInstanceHandle(newVal) Sets the MFC variable afxCurrentInstanceHandle
-
newVal : int
The new value for afxCurrentInstanceHandle
The result is the previous value of afxCurrentInstanceHandle
win32ui.SetCurrentResourceHandle
int = SetCurrentResourceHandle(newVal) Sets the MFC variable afxCurrentResourceHandle
-
newVal : int
The new value for afxCurrentResourceHandle
The result is the previous value of afxCurrentResourceHandle
win32ui.SetDialogBkColor
int = SetDialogBkColor(clrCtlBk, clrCtlText
) Sets the default background and text color for dialog boxes and message boxes within the application.
-
clrCtlBk=win32ui.RGB(192, 192, 192) : int
The color for the controls background.
-
clrCtlText=win32ui.RGB(0, 0, 0) : int
The color for the controls text.
- CWinApp::SetDialogBkColor
win32ui.SetProfileFileName
SetProfileFileName(filename) Sets the name of the INI file used by the application.
-
filename : string
The name of the ini file.
win32ui.SetRegistryKey
SetRegistryKey(key) Causes application settings to be stored in the registry instead of INI files.
-
key : string
A string containing the name of the key.
Causes application settings to be stored in the registry instead of INI files. This function sets m_pszRegistryKey, which
is then used by the GetProfileXXX and WriteProfileXXX member functions of CWinApp. If this function has been
called, the list of most recently-used (MRU) files is also stored in the registry. The registry key is usually the name of a
company. It is stored in a key of the following form:
HKEY_CURRENT_USER\\Software\\<company name>\\<application name>\\<section name>\\<value name>.
win32ui.SetResource
PyDLL = SetResource(dll) Specifies the default DLL object for application resources.
-
dll : PyDll
The dll object to use for default resources.
The previous default DLL object.
win32ui.SetStatusText
SetStatusText(msg, bForce) Sets the text in the status bar of the application.
-
msg : string
The message to write to the status bar.
-
bForce=0 : int
A flag indicating if the message should be forced to the status bar, or written in idle time.
win32ui.StartDebuggerPump
StartDebuggerPump() Starts a recursive message loop, waiting for an application close message.
This function is used by the debugger. It allows the debugger to
interact with the user, even while the Python code is stopped.
As the Python code may be responding to a Windows Event, this function
works around the inherent message queue problems.
win32ui.StopDebuggerPump
StopDebuggerPump() Stops the debugger pump. See win32ui::StartDebuggerPump.
win32ui.TranslateMessage
int = TranslateMessage() Calls the API version of TranslateMessage.
win32ui.TranslateVirtualKey
string/None = TranslateVirtualKey(vk)
-
vk : int
The key to translate
win32ui.WinHelp
WinHelp(cmd, data) Invokes the Windows Help system.
-
cmd=win32con.HELP_CONTEXT : int
The type of help. See the api for full details.
-
data : int/string
Additional data specific to the help call.
win32ui.WriteProfileVal
WriteProfileVal(section, entry, value) Writes a value to the application's INI file.
-
section : string
The section in the INI file to write to.
-
entry : string
The entry within the section in the INI file to write to.
-
value : int/string
The value to write. The type of this parameter determines the method's return type.
const win32ui.debug;
1 if we are current using a _DEBUG build of win32ui, else 0.