Share
 
 

Registering Objects Derived from CAdUiDockControlBar

Windows derived from CAdUiDockControlBar—which includes CAcUiDockControlBar, CAdUiPaletteSet, and CAcTcUiToolPaletteSet—can register themselves using the global function AdUiRegisterTool(). Registered windows that were visible when a session of AutoCAD closed will be automatically started in the next session and will be saved and restored in workspaces.

In order for the window to appear in the Customize User Interface dialog (CUI dialog) and to operate in workspaces more safely, an entry for it should also be added to the system registry.

Add the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R25.0\
    ACAD-8101:409\DockingTools\<classId>

The class ID is returned by the CAdUiDockControlBar::GetToolID() method, and it can be turned into a string using the COM method StringFromCLSID(). For example, the class ID string for Properties palette is {6D32A2D9-832E-11D2-A83C-0060B0872C0B}.

This key should contain the following properties:

Property Name

Type

Description of Data

Command

REG_SZ

Command to invoke the window

CommandClose

REG_SZ

Command to close the window

Name

REG_SZ

Localized name of the window

The two command names should be the global command names, but without any preceding underscore. For example, the global command for the Properties palette is "PROPERTIES", not "_PROPERTIES". The command to invoke the window should be the same command registered using AdUiRegisterTool(). The requirement for a command to close the window was introduced in AutoCAD 2006, so your window might not have such a command. As a fallback, AutoCAD will attempt to close the window using direct Windows messages when necessary.

The Name property should be a localized descriptive name of the window. This is the name by which the CUI dialog will refer to the window when populating a workspace.

You can test whether the registry entries are correct by checking whether the window is listed in the CUI dialog and whether the window can be opened and closed by switching to and from a workspace that contains it.

Was this information helpful?