Copyright: Produced by WebTwin (www.webtwin.com) HTML->WinHelp converter.


My CodeMax Work - Introduction

Introduction

CodeMax is a powerful Win32-based custom control that allows developers to add code-editing capabilities to their applications quickly and easily. It's used by a number of big-name companies to develop high-powered solutions to real business problems. And best of all, it's completely free - source and all - from WinMain Software!

But even though CodeMax is an excellent control, the current version is missing a couple of features I needed. Namely, I wanted to be able to provide word completion and syntax highlighting similar to that found in products such as Microsoft Visual C++ 6.0, Microsoft Visual Basic 6.0 and Borland Delphi 3.0.

For example, if a developer cannot remember the exact keyword they need to use in Visual C++, they can press Ctrl + Space to display a context menu that lists all the keywords available:

Then when they hit the left parenthesis, a tooltip that indicates the expected parameter list is displayed:

Naturally, the contents of the context menu and tooltip would be highly application-specific. For example, a C++ parser would need to display a different function and parameter list than a Pascal parser. But I figured that if I could make the interfaces generic enough, these features might make it into the official CodeMax release sometime in the future.

Word Completion

In the DLL version of CodeMax, the word completion process is fired off by the CMD_CODELIST command, which can be invoked programmatically using the CMM_EXECUTECMD CodeMax message, or by using the hotkey associated with the "CodeList" command in the CodeMax Properties dialog shown below. By default, this hotkey is set to Ctrl + Space.

When the CMD_CODELIST command is invoked, the CodeMax control creates a list view control and sends a CMN_CODELIST notification to the application. The application should use the hListCtrl member of the CM_CODELISTDATA structure passed in this notification to initialize the contents of the list view control. This can be done using standard Win32 API functions such as ListView_InsertItem, ListView_SetImageList and the other ListView_* macros.

If the user presses a character key while the list view control is active, the CodeMax control will send a CMN_CODELISTCHAR notification to the application. And if the user cancels the list view control, by either clicking the mouse outside of it or hitting the Esc key, the CodeMax control will send a CMN_CODELISTCANCEL notification to the application.

Finally, when the user selects an item from the list view control, the CodeMax control sends the CMN_CODELISTSELMADE notification to the application. The application should use the hListCtrl member of the CM_CODELISTDATA structure passed in this notification to determine which item was selected, and to get the text and custom data associated with that item. This can be done using standard Win32 API functions such as ListView_GetNextItem, ListView_GetItemText and the other ListView_* macros.

The ActiveX version of CodeMax operates in much the same way as described above, but naturally uses ActiveX events and methods. For an overview of how word completion works in the ActiveX version of the control, refer to the documentation of the ICodeList Interface.

Syntax Highlighting

Syntax highlighting in the DLL version of CodeMax functions in much the same way as word completion. It is invoked by the CMD_CODETIP command, which can be invoked programmatically using the CMM_EXECUTECMD CodeMax message, or by using the hotkey associated with the "CodeTip" command in the CodeMax Properties dialog (see above).

Note: The "CodeTip" hotkey is not set by default. Use the CMRegisterHotKey CodeMax function if you need to associate a hotkey with the command programmatically; it can also be set using the CodeMax Properties dialog.

When the CMD_CODETIP command is invoked, the CodeMax control sends a CMN_CODETIP notification to the application to determine what kind of tooltip is needed. It then creates the appropriate tooltip control and sends a CMN_CODETIPUPDATE event to allow the application to initialize the tooltip control. The application should use the hToolTip member of the CM_CODETIPDATA structure passed in this notification to initialize the contents of the tooltip using the Win32 API SetWindowText function.

The CMN_CODETIPUPDATE notification is then sent each time the user presses a key in the CodeMax control to allow the application to update the tooltip as needed. If the user cancels the tooltip control, by either hitting the Esc key or removing the input focus from the CodeMax control, the CodeMax control will send a CMN_CODETIPCANCEL notification to the application. The hToolTip member of the CM_CODETIPDATA structure passed by these notifications can be used to perform any custom actions needed, and the Win32 API DestroyWindow function can be used to remove the tooltip from the screen once the application has finished with it.

The ActiveX version of CodeMax operates in much the same way as described above, but naturally uses ActiveX events and methods. For an overview of how syntax highlighting works in the ActiveX version of the control, refer to the documentation of the ICodeTip Interface.

[http://www.ticz.com/~nlewis/cmax_intro.htm]

This help file was generated from HTML source using WebTwin version 1.1b


CMD_CODELIST

CMD_CODELIST

This command invokes the word completion list view control, which displays as a popup window over the CodeMax control and allows the user to select an item from the list.

Parameters

This command has no parameters.

See Also

CMN_CODELIST, CodeList Event

[http://www.ticz.com/~nlewis/CMD_CODELIST.html]

This help file was generated from HTML source using WebTwin version 1.1b


CMN_CODELIST

CMN_CODELIST

A CodeMax control sends the CMN_CODELIST notification in response to a CMD_CODELIST command. This notification message is sent in the form of a WM_NOTIFY message.

CMN_CODELIST
    lpcld = (CM_CODELISTDATA*) lParam;

Parameters

lpcld

Address of a CM_CODELISTDATA structure that contains additional information about this notification message.

Return Values

Return TRUE if the list view control has been initialized by the application, and should be displayed.

Return FALSE if the list view control should not be displayed.

Remarks

When the CMD_CODELIST command is invoked, the CodeMax control creates a list view control and sends the application a CMN_CODELIST notification message. The handle to the list view control is stored in the hListCtrl member of the CM_CODELISTDATA structure passed in this message. The application should use this handle to populate the list view control with the desired strings, and to perform other initialization such as associating an image list with the control. When the user selects an item from the list view control, a CMN_CODELISTSELMADE notification message is sent to the application to allow it to determine which item was selected and react accordingly.

See Also

CMD_CODELIST, CMN_CODELISTSELMADE, CM_CODELISTDATA

[http://www.ticz.com/~nlewis/CMN_CODELIST.html]

This help file was generated from HTML source using WebTwin version 1.1b


CM_CODELISTDATA

CM_CODELISTDATA

Contains information about a CMN_CODELIST or CMN_CODELISTSELMADE notification message.

typedef struct _CM_CODELISTDATA {
    NMHDR hdr;
    HWND  hListCtrl;
} CM_CODELISTDATA, *LPCM_CODELISTDATA;

Members

hdr

NMHDR structure that contains information about this notification message.

hListCtrl

Window handle to the list view control.

See Also

CMN_CODELIST, CMN_CODELISTCANCEL, CMN_CODELISTSELMADE

[http://www.ticz.com/~nlewis/CM_CODELISTDATA.html]

This help file was generated from HTML source using WebTwin version 1.1b


CMN_CODELISTCHAR

CMN_CODELISTCHAR

A CodeMax control sends the CMN_CODELISTCHAR notification when the user presses a character key in the word completion list view control. This notification message is sent in the form of a WM_NOTIFY message.

CMN_CODELISTCHAR
    lpclkd = (CM_CODELISTKEYDATA*) lParam;

Parameters

lpclkd

Address of an CM_CODELISTKEYDATA structure that contains additional information about this notification message.

Return Values

Return TRUE if the parent handled the message.

Return FALSE if the list view control should perform the default action.

See Also

CMD_CODELIST, CM_CODELISTKEYDATA

[http://www.ticz.com/~nlewis/CMN_CODELISTCHAR.html]

This help file was generated from HTML source using WebTwin version 1.1b


CMN_CODELISTCANCEL

CMN_CODELISTCANCEL

A CodeMax control sends the CMN_CODELISTCANCEL notification when the user cancels the word completion list view control by either hitting the Esc key or clicking the mouse outside the control. This notification message is sent in the form of a WM_NOTIFY message.

CMN_CODELISTCANCEL
    lpcld = (CM_CODELISTDATA*) lParam;

Parameters

lpcld

Address of an CM_CODELISTDATA structure that contains additional information about this notification message.

Return Values

Return TRUE if the list view control should remain visible.

Return FALSE if the list view control should be hidden.

See Also

CMD_CODELIST, CMN_CODELIST, CM_CODELISTDATA

[http://www.ticz.com/~nlewis/CMN_CODELISTCANCEL.html]

This help file was generated from HTML source using WebTwin version 1.1b


CMN_CODELISTSELMADE

CMN_CODELISTSELMADE

A CodeMax control sends the CMN_CODELISTSELMADE notification when the user selects an item from the word completion list view control. This notification message is sent in the form of a WM_NOTIFY message.

CMN_CODELISTSELMADE
    lpcld = (CM_CODELISTDATA*) lParam;

Parameters

lpcld

Address of an CM_CODELISTDATA structure that contains additional information about this notification message.

Return Values

Return TRUE if the list view control should remain visible.

Return FALSE if the list view control should be hidden.

Remarks

When the CMD_CODELIST command is invoked, the CodeMax control creates a list view control and sends the application a CMN_CODELIST notification message. Then when the user selects an item from the list view control, a CMN_CODELISTSELMADE notification message is sent to the application. The handle to the list view control is stored in the hListCtrl member of the CM_CODELISTDATA structure passed in this message. The application should use this handle to determine which item is selected, and to get the item text if necessary.

See Also

CMD_CODELIST, CMN_CODELIST, CMN_CODELISTCANCEL, CM_CODELISTDATA

[http://www.ticz.com/~nlewis/CMN_CODELISTSELMADE.html]

This help file was generated from HTML source using WebTwin version 1.1b


ICodeList Interface

ICodeList Interface

When the cmCmdCodeList command is invoked, the CodeMax control creates a list view control, attaches it to an ICodeList interface, and sends an CodeList event to the application. The ICodeList interface can be used during this event to initialize the contents of the list view control with the strings to be displayed.

If the user presses a character key while the list view control is active, the CodeMax control will send an CodeListChar event to the application. And if the user cancels the list view control, by either clicking the mouse outside of it or hitting the Esc key, the CodeMax control will send an CodeListCancel event to the application. The ICodeList interface passed during these events can be used to perform any custom actions needed.

Finally, when the user selects an item from the list view control, the CodeMax control sends the CodeListSelMade event. The ICodeList inteface can then be used to determine which item was selected, and to get the text and custom data associated with that item.

Note: Since a new ICodeList interface is created each time the CodeList hotkey is invoked, you should never store the interface in a variable for later use.

[http://www.ticz.com/~nlewis/ICodeList_Overview.html]

This help file was generated from HTML source using WebTwin version 1.1b


CMD_CODETIP

CMD_CODETIP

This command invokes the syntax highlighting control, which displays as a tooltip window over the CodeMax control and informs the user of the proper syntax for the current line.

Parameters

This command has no parameters.

See Also

CMN_CODETIP, CodeTip Event

[http://www.ticz.com/~nlewis/CMD_CODETIP.html]

This help file was generated from HTML source using WebTwin version 1.1b


CMN_CODETIP

CMN_CODETIP

A CodeMax control sends the CMN_CODETIP notification in response to a CMD_CODETIP command. This notification message is sent in the form of a WM_NOTIFY message.

CMN_CODETIP
    lpnmh = (LPNMHDR) lParam;

Parameters

lpnmh

Address of a NMHDR structure that contains additional information about this notification message.

Return Values

The application should return one of the values in the following table:

Value	Description
CM_TIPSTYLE_NONE	No tooltip control should be displayed. This is the default.
CM_TIPSTYLE_NORMAL	Creates a standard tooltip window that does not support highlighting.
CM_TIPSTYLE_HIGHLIGHT	Creates a tooltip window that supports highlighting a specific range of text.
CM_TIPSTYLE_FUNCHIGHLIGHT	Creates a tooltip window that supports highlighting a specific argument in a comma-delimited function prototype.
CM_TIPSTYLE_MULTIFUNC	Creates a tooltip window similar to CM_TIPSTYLE_FUNCHIGHLIGHT, but also allows user to choose from mulitple function prototypes.

See Also

CM_CODETIPDATA, CMN_CODETIPUPDATE, CMN_CODETIPCANCEL

[http://www.ticz.com/~nlewis/CMN_CODETIP.html]

This help file was generated from HTML source using WebTwin version 1.1b


CMN_CODETIPUPDATE

CMN_CODETIPUPDATE

A CodeMax control sends the CMN_CODETIPUPDATE notification just before the syntax highlighting tooltip control is updated. The application should take advantage of this notification to adjust the tip text or highlighting information. This notification message is sent in the form of a WM_NOTIFY message.

CMN_CODETIPUPDATE
    lpctd = (LPCM_CODETIPDATA) lParam;

Parameters

lpctd

Address of a CM_CODETIPDATA structure that contains additional information about this notification message.

Return Values

Return TRUE if the application has modified any of the members of the structure passed in the lpctd parameter, and these changes should be applied.

Return FALSE if the application has not modified any of the members of the structure passed in the lpctd parameter.

Remarks

The nTipType member of the lpctd parameter passed in this notification indicates the type of tooltip control that was created in response to the initial CMN_CODETIP notification. It also indicates the actual type of structure passed in as the lpctd parameter, as indicated in the following table:

lpctd->nTipType	Structure Type
CM_TIPSTYLE_NORMAL	CM_CODETIPDATA
CM_TIPSTYLE_HIGHLIGHT	CM_CODETIPHIGHLIGHTDATA
CM_TIPSTYLE_FUNCHIGHLIGHT	CM_CODETIPFUNCHIGHLIGHTDATA
CM_TIPSTYLE_MULTIFUNC	CM_CODETIPMULTIFUNCDATA

The following sample code demonstrates how to properly determine which structure is in use:

BOOL OnCodeTipUpdate( LPCM_CODETIPDATA lpctd )
{
   switch( lpctd->nTipType )
   {
   case CM_TIPSTYLE_NORMAL:
      {
         // Do something with lpctd...
      }
      break;

   case CM_TIPSTYLE_HIGHLIGHT:
      {
         LPCM_CODETIPHIGHLIGHTDATA pData =
            (LPCM_CODETIPHIGHLIGHTDATA) lpctd;

         // Highlight some text...
         pData->nHighlightStartPos = 0;
         pData->nHighlightEndPos = 5;
      }
      return TRUE;

   case CM_TIPSTYLE_FUNCHIGHLIGHT:
      {
         LPCM_CODETIPFUNCHIGHLIGHTDATA pData =
            (LPCM_CODETIPFUNCHIGHLIGHTDATA) lpctd;

         // Highlight a function argument...
         pData->nArgument = 3;
      }
      return TRUE;

   case CM_TIPSTYLE_MULTIFUNC:
      {
         LPCM_CODETIPMULTIFUNCDATA pData =
            (LPCM_CODETIPMULTIFUNCDATA) lpctd;

         // Highlight a function argument...
         pData->ctfData.nArgument = 3;

         // This function has one overload in addition to
         // the normal prototype, i.e.:
         //
         //    void SomeFunc()              <= Normal prototype
         //    void SomeFunc( int nParam )  <= First overload
         //
         pData->nFuncCount = 1; // Number of overloads

         // Default to normal prototype
         pData->nCurrFunc = 0; // Zero-based index of prototype
      }
      return TRUE;
   }

   // We didn't change any structure members...
   return FALSE;
}

See Also

CMN_CODETIP, CMN_CODETIPCANCEL, CM_CODETIPDATA, CM_CODETIPHIGHLIGHTDATA, CM_CODETIPFUNCHIGHLIGHTDATA, CM_CODETIPMULTIFUNCDATA

[http://www.ticz.com/~nlewis/CMN_CODETIPUPDATE.html]

This help file was generated from HTML source using WebTwin version 1.1b


CM_CODETIPDATA

CM_CODETIPDATA

Contains information about a CMN_CODETIPUPDATE or CMN_CODETIPCANCEL notification message.

typedef struct _CM_CODETIPDATA {
    NMHDR hdr;
    HWND  hToolTip;
    UINT  nTipType;
} CM_CODETIPDATA, *LPCM_CODETIPDATA;

Members

hdr

NMHDR structure that contains information about this notification message.

hListCtrl

Window handle to the tooltip control.

nTipType

The type of tooltip control returned by the CMN_CODETIP notification handler.

See Also

CMN_CODETIP, CMN_CODETIPUPDATE, CMN_CODETIPCANCEL

[http://www.ticz.com/~nlewis/CM_CODETIPDATA.html]

This help file was generated from HTML source using WebTwin version 1.1b


CMN_CODETIPCANCEL

CMN_CODETIPCANCEL

A CodeMax control sends the CMN_CODETIPCANCEL notification when the user cancels the syntax highlighting tooltip control by either hitting the Esc key or removing the input focus from the CodeMax control. This notification message is sent in the form of a WM_NOTIFY message.

CMN_CODETIPCANCEL
    lpctd = (LPCM_CODETIPDATA) lParam;

Parameters

lpctd

Address of a CM_CODETIPDATA structure that contains additional information about this notification message.

Return Values

Return TRUE if the tooltip control should remain visible.

Return FALSE if the tooltip control should be hidden.

Remarks

The nTipType member of the lpctd parameter passed in this notification indicates the type of tooltip control that was created in response to the initial CMN_CODETIP notification. It also indicates the actual type of structure passed in as the lpctd parameter, as indicated in the following table:

lpctd->nTipType	Structure Type
CM_TIPSTYLE_NORMAL	CM_CODETIPDATA
CM_TIPSTYLE_HIGHLIGHT	CM_CODETIPHIGHLIGHTDATA
CM_TIPSTYLE_FUNCHIGHLIGHT	CM_CODETIPFUNCHIGHLIGHTDATA
CM_TIPSTYLE_MULTIFUNC	CM_CODETIPMULTIFUNCDATA

See Also

CMN_CODETIP, CMN_CODETIPUPDATE, CM_CODETIPDATA, CM_CODETIPHIGHLIGHTDATA, CM_CODETIPFUNCHIGHLIGHTDATA, CM_CODETIPMULTIFUNCDATA

[http://www.ticz.com/~nlewis/CMN_CODETIPCANCEL.html]

This help file was generated from HTML source using WebTwin version 1.1b


ICodeTip Interface

ICodeTip Interface

When the cmCmdCodeTip command is invoked, the CodeMax control sends a CodeTip event to the application to determine what kind of tooltip is needed. It then creates the appropriate tooltip control, attaches it to the associated interface (ICodeTip, ICodeTipHighlight, ICodeTipFuncHighlight or ICodeTipMultiFunc), and sends a CodeTipUpdate event to allow the application to initialize the tooltip control.

The CodeTipUpdate event is then sent each time the user presses a key in the CodeMax control to allow the application to update the tooltip as needed. If the user cancels the tooltip control, by either hitting the Esc key or removing the input focus from the CodeMax control, the CodeMax control will send a CodeTipCancel event to the application. The ICodeTip interface passed during these events can be used to perform any custom actions needed, and the Destroy method can be used to remove the tooltip from the screen once the application has finished with it.

The ICodeTip interface does not support highlighting, and is therefore most often used to display general information:

If highlighting is required, one of the classes derived from ICodeTip (ICodeTipHighlight, ICodeTipFuncHighlight or ICodeTipMultiFunc) can be used.

[http://www.ticz.com/~nlewis/ICodeTip_Overview.html]

This help file was generated from HTML source using WebTwin version 1.1b


CodeList Event

CodeList Event

A CodeMax control sends the CodeList event when the cmCmdCodeList command is invoked.

MIDL
void CodeList( [in] ICodeMax *Control, [in] ICodeList* ListCtrl, [out,retval] VARIANT_BOOL *bContinue );

Visual Basic
Private Function controlname_CodeList( ByVal Control As CodeMaxCtl.ICodeMax, ByVal ListCtrl As CodeMaxCtl.ICodeList ) As Boolean

Parameters

Control

Address of an ICodeMax object.

ListCtrl

Address of an ICodeList object.

bContinue

Address of a VARIANT_BOOL used for the return code (either VARIANT_TRUE or VARIANT_FALSE) from the event handler.

Return Values

Return TRUE if the list view control has been initialized by the application, and should be displayed.

Return FALSE if the list view control should not be displayed.

See Also

CMN_CODELIST, ICodeList Interface

[http://www.ticz.com/~nlewis/CodeLIst.html]

This help file was generated from HTML source using WebTwin version 1.1b


WM_NOTIFY

WM_NOTIFY

This message is sent by the CodeMax control to its parent window when an event has occurred or the control requires some information.

WM_NOTIFY
    wParam = (WPARAM) (int) idCtrl;
    lParam = (LPARAM) (LPNMHDR) pnmh;

Parameters

idCtrl

Identifier of the control sending the message. This identifier is not guaranteed to be unique. An application should use the hwndFrom or idFrom member of the NMHDR structure (passed as the lParam parameter) to identify the control.

pnmh

Pointer to an NMHDR structure that contains the notification code and additional information. For some notification messages, this parameter points to a larger structure that has the NMHDR structure as its first member.

Return Values

The return value is ignored except for notification messages that specify otherwise.

Remarks

This is a standard Win32 message, and is not specific to the CodeMax control.

See Also

NMHDR

[http://www.ticz.com/~nlewis/WM_NOTIFY.html]

This help file was generated from HTML source using WebTwin version 1.1b


NMHDR

NMHDR

Contains information about a notification message.

typedef struct tagNMHDR {
    HWND hwndFrom;
    UINT idFrom;
    UINT code;
} NMHDR;

Members

hwndFrom

Window handle to the control sending a message.

idFrom

Identifier of the control sending a message.

code

Notification code. This member can be a control-specific notification code or it can be one of the common notification codes.

Remarks

This is a standard Win32 structure, and is not specific to the CodeMax control.

See Also

WM_NOTIFY

[http://www.ticz.com/~nlewis/NMHDR.html]

This help file was generated from HTML source using WebTwin version 1.1b


CM_CODELISTKEYDATA

CM_CODELISTKEYDATA

Contains information about a CMN_CODELISTCHAR notification message.

typedef struct _CM_CODELISTKEYDATA {
    CM_CODELISTDATA    clData;
    WPARAM             wChar;
    LPARAM             lKeyData;
} CM_CODELISTKEYDATA, *LPCM_CODELISTKEYDATA;

Members

clData

CM_CODELISTDATA structure that contains information about this notification message.

wChar

Specifies the character code of the key pressed.

lKeyData

Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
Value	Description
0-15	Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23	Specifies the scan code. The value depends on the original equipment manufacturer (OEM).
24	Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28	Reserved; do not use.
29	Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
30	Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31	Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.

See Also

CMN_CODELISTCHAR, CM_CODELISTDATA

[http://www.ticz.com/~nlewis/CM_CODELISTKEYDATA.html]

This help file was generated from HTML source using WebTwin version 1.1b


CodeListChar Event

CodeListChar Event

A CodeMax control sends the CodeListChar event when the user presses a character key in the word completion list view control.

MIDL
void CodeListChar( [in] ICodeMax *Control, [in] ICodeList* ListCtrl, [in] long wChar, [in] long lKeyData, [out,retval] VARIANT_BOOL *bHandled );

Visual Basic
Private Function controlname_CodeListChar( ByVal Control As CodeMaxCtl.ICodeMax, ByVal ListCtrl As CodeMaxCtl.ICodeList, ByVal wChar As Long, ByVal lKeyData As Long ) As Boolean

Parameters

Control

Address of an ICodeMax object.

ListCtrl

Address of an ICodeList object.

wChar

Specifies the character code of the key pressed.

lKeyData

Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
Value	Description
0-15	Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23	Specifies the scan code. The value depends on the original equipment manufacturer (OEM).
24	Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28	Reserved; do not use.
29	Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
30	Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31	Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.
bHandled

Address of a VARIANT_BOOL used for the return code (either VARIANT_TRUE or VARIANT_FALSE) from the event handler.

Return Values

Return TRUE if the application handled the message.

Return FALSE if the list view control should perform the default action.

See Also

CMN_CODELISTCHAR, ICodeList Interface

[http://www.ticz.com/~nlewis/CodeListChar.html]

This help file was generated from HTML source using WebTwin version 1.1b


CodeListCancel Event

CodeListCancel Event

A CodeMax control sends the CodeListCancel event when the user cancels the word completion list view control by either hitting the Esc key or clicking the mouse outside the control.

MIDL
void CodeListCancel( [in] ICodeMax *Control, [in] ICodeList* ListCtrl, [out,retval] VARIANT_BOOL *bKeepVisible );

Visual Basic
Private Function controlname_CodeListCancel( ByVal Control As CodeMaxCtl.ICodeMax, ByVal ListCtrl As CodeMaxCtl.ICodeList ) As Boolean

Parameters

Control

Address of an ICodeMax object.

ListCtrl

Address of an ICodeList object.

bKeepVisible

Address of a VARIANT_BOOL used for the return code (either VARIANT_TRUE or VARIANT_FALSE) from the event handler.

Return Values

Return TRUE if the list view control should remain visible.

Return FALSE if the list view control should be hidden.

See Also

CMN_CODELISTCANCEL, ICodeList Interface

[http://www.ticz.com/~nlewis/CodeListCancel.html]

This help file was generated from HTML source using WebTwin version 1.1b


CodeListSelMade Event

CodeListSelMade Event

A CodeMax control sends the CodeListSelMade event when the user selects an item from the word completion list view control.

MIDL
void CodeListSelMade( [in] ICodeMax *Control, [in] ICodeList* ListCtrl, [out,retval] VARIANT_BOOL *bStop );

Visual Basic
Private Function controlname_CodeListSelMade( ByVal Control As CodeMaxCtl.ICodeMax, ByVal ListCtrl As CodeMaxCtl.ICodeList ) As Boolean

Parameters

Control

Address of an ICodeMax object.

ListCtrl

Address of an ICodeList object.

bStop

Address of a VARIANT_BOOL used for the return code (either VARIANT_TRUE or VARIANT_FALSE) from the event handler.

Return Values

Return TRUE if the list view control should remain visible.

Return FALSE if the list view control should be hidden.

See Also

CMN_CODELISTSELMADE, ICodeList Interface

[http://www.ticz.com/~nlewis/CodeListSelMade.html]

This help file was generated from HTML source using WebTwin version 1.1b


CodeTip Event

CodeTip Event

A CodeMax control sends the CodeTip event when the cmCmdCodeTip command is invoked.

MIDL
void CodeTip( [in] ICodeMax *Control, [out, retval] cmToolTipType* ToolTipType );

Visual Basic
Private Function controlname_CodeTip( ByVal Control As CodeMaxCtl.ICodeMax ) As CodeMaxCtl.cmToolTipType

Parameters

Control

Address of an ICodeMax object.

ToolTipType

Used for the return value from the function.

Return Values

The application should return one of the values in the following table:

Value	Description
cmToolTipTypeNone	No tooltip control should be displayed. This is the default.
cmToolTipTypeNormal	Creates a standard tooltip window that does not support highlighting, and attaches it to an ICodeTip interface.
cmToolTipTypeHighlight	Creates a tooltip window that supports highlighting a specific range of text, and attaches it to an ICodeTipHighlight interface.
cmToolTipTypeFuncHighlight	Creates a tooltip window that supports highlighting a specific argument in a comma-delimited function prototype, and attaches it to an ICodeTipFuncHighlight interface.
cmToolTipTypeMultiFunc	Creates a tooltip window similar to cmToolTipTypeFuncHighlight, but also allows user to choose from mulitple function prototypes, and attaches it to an ICodeTipMultiFunc interface.

See Also

CMN_CODETIP, ICodeTip Interface, ICodeTipHighlight Interface, ICodeTipFuncHighlight Interface, ICodeTipMultiFunc Interface

[http://www.ticz.com/~nlewis/CodeTip.html]

This help file was generated from HTML source using WebTwin version 1.1b


CM_CODETIPHIGHLIGHTDATA

CM_CODETIPHIGHLIGHTDATA

Contains information about a CMN_CODETIPUPDATE or CMN_CODETIPCANCEL notification message.

typedef struct _CM_CODETIPHIGHLIGHTDATA {
    CM_CODETIPDATA ctData
    UINT           nHighlightStartPos;
    UINT           nHighlightEndPos;
} CM_CODETIPHIGHLIGHTDATA, *LPCM_CODETIPHIGHLIGHTDATA;

Members

ctData

CM_CODETIPDATA structure that contains information about this notification message.

nHighlightStartPos

Zero-based index of text position where highlighting should begin.

nHighlightEndPos

Zero-based index of text position where highlighting should end.

See Also

CM_CODETIPDATA, CMN_CODETIPUPDATE, CMN_CODETIPCANCEL

[http://www.ticz.com/~nlewis/CM_CODETIPHIGHLIGHTDATA.html]

This help file was generated from HTML source using WebTwin version 1.1b


CM_CODETIPFUNCHIGHLIGHTDATA

CM_CODETIPFUNCHIGHLIGHTDATA

Contains information about a CMN_CODETIPUPDATE or CMN_CODETIPCANCEL notification message.

typedef struct _CM_CODETIPFUNCHIGHLIGHTDATA {
    CM_CODETIPDATA ctData
    UINT           nArgument;
} CM_CODETIPFUNCHIGHLIGHTDATA, *LPCM_CODETIPFUNCHIGHLIGHTDATA;

Members

ctData

CM_CODETIPDATA structure that contains information about this notification message.

nArgument

Zero-based index of function argument that should be highlighted.

See Also

CM_CODETIPDATA, CMN_CODETIPUPDATE, CMN_CODETIPCANCEL

[http://www.ticz.com/~nlewis/CM_CODETIPFUNCHIGHLIGHTDATA.html]

This help file was generated from HTML source using WebTwin version 1.1b


CM_CODETIPMULTIFUNCDATA

CM_CODETIPMULTIFUNCDATA

Contains information about a CMN_CODETIPUPDATE or CMN_CODETIPCANCEL notification message.

typedef struct _CM_CODETIPMULTIFUNCDATA {
    CM_CODETIPFUNCHIGHLIGHTDATA ctfData;
    UINT                        nFuncCount;
    UINT                        nCurrFunc;
} CM_CODETIPMULTIFUNCDATA, *LPCM_CODETIPMULTIFUNCDATA;

Members

ctfData

CM_CODETIPFUNCHIGHLIGHTDATA structure that contains information about this notification message.

nFuncCount

Number of times the function has been overloaded, or zero if the function has not been overloaded.

nCurrFunc

Zero-based index of the current function overload. Cannot be greater than nFuncCount.

Remarks

The nFuncCount member represents the number of times the function prototype has been overloaded, not the total number of prototypes available. For example, if this member is set to zero, the tooltip will behave exactly as if it had been created with the CM_TIPSTYLE_FUNCHIGHLIGHT style:

But if nFuncCount were set to 1 (one) for our example above, the user would be able to select either the original function prototype, or an overloaded version of the function - a total of two prototypes:

 int MessageBox( HWND hWnd, ... )">

 int CWnd::MessageBox( LPCTSTR lpszText, ... )">

Each time the user clicks on the left- or right-arrow buttons in the tooltip control, the nCurrFunc member of this structure is updated and a CMN_CODETIPUPDATE notification is sent to the application. The application should then adjust the text of the tooltip accordingly.

See Also

CM_CODETIPFUNCHIGHLIGHTDATA, CMN_CODETIPUPDATE, CMN_CODETIPCANCEL

[http://www.ticz.com/~nlewis/CM_CODETIPMULTIFUNCDATA.html]

This help file was generated from HTML source using WebTwin version 1.1b


ICodeTipHighlight Interface

ICodeTipHighlight Interface

This interface is derived from the ICodeTip interface, and therefore inherits all of it's properties and methods. The ICodeTipHighlight interface has two additional properties - HighlightStartPos and HighlightEndPos - to allow a specific range of text in the attached tooltip control window to be highlighted:

[http://www.ticz.com/~nlewis/ICodeTipHighlight_Overview.html]

This help file was generated from HTML source using WebTwin version 1.1b


ICodeTipFuncHighlight Interface

ICodeTipFuncHighlight Interface

This interface is derived from the ICodeTip interface, and therefore inherits all of it's properties and methods. The ICodeTipFuncHighlight interface has an additional property - Argument - to allow a specific function argument in the attached tooltip control window to be highlighted.

Note that in order to work properly, the function prototype must be comma-delimited. For example, consider the tooltip below:

In this example, the Argument property has been set to zero, so the first argument in the function has been highlighted. As the user enters text into the CodeMax control, the CodeTipUpdate event will be sent to the application so that it can determine which argument in the tooltip should be highlighted next.

[http://www.ticz.com/~nlewis/ICodeTipFuncHighlight_Overview.html]

This help file was generated from HTML source using WebTwin version 1.1b


ICodeTipMultiFunc Interface

ICodeTipMultiFunc Interface

This interface is derived from the ICodeTipFuncHighlight interface, and therefore inherits all of it's properties and methods. The ICodeTipMultiFunc interface has two additional properties - CurrentFunction and FunctionCount - to allow user to choose from mulitple function prototypes.

Note that the FunctionCount property represents the number of times the function prototype has been overloaded, not the total number of prototypes available. For example, if this property is set to zero, the ICodeTipMultiFunc interface will use the default ICodeTipFuncHighlight highlighting, i.e.:

But if the FunctionCount property were set to 1 (one) for our example above, the user would be able to select either the original function prototype, or an overloaded version of the function - a total of two prototypes:

 int MessageBox( HWND hWnd, ... )">

 int CWnd::MessageBox( LPCTSTR lpszText, ... )">

Each time the user clicks on the left- or right-arrow buttons in the tooltip control, the CurrentFunction property is updated and a CodeTipUpdate event is sent to the application to allow it to adjust the text of the tooltip accordingly. And as the user enters text into the CodeMax control, the CodeTipUpdate event will be sent to the application so that it can determine which argument in the tooltip should be highlighted next

[http://www.ticz.com/~nlewis/ICodeTipMultiFunc_Overview.html]

This help file was generated from HTML source using WebTwin version 1.1b


CodeTipUpdate Event

CodeTipUpdate Event

A CodeMax control sends the CodeTipUpdate event just before the syntax highlighting tooltip control is updated. The application should take advantage of this event to adjust the tip text or highlighting information.

MIDL
void CodeTipUpdate( [in] ICodeMax *Control, [in] ICodeTip* ToolTipCtrl );

Visual Basic
Private Sub controlname_CodeTipUpdate( ByVal Control As CodeMaxCtl.ICodeMax, ByVal ToolTipCtrl As CodeMaxCtl.ICodeTip )

Parameters

Control

Address of an ICodeMax object.

ToolTipCtrl

Address of an ICodeTip object.

Return Values

This event has no return value.

Remarks

The type of object passed as the ToolTipCtrl parameter depends on the response to the initial CodeTip event, as indicated in the following table:

CodeTip Event Return Value	Object Type
cmToolTipTypeNormal	ICodeTip
cmToolTipTypeHighlight	ICodeTipHighlight
cmToolTipTypeFuncHighlight	ICodeTipFuncHighlight
cmToolTipTypeMultiFunc	ICodeTipMultiFunc

See Also

CodeTip Event, ICodeTip Interface, ICodeTipHighlight Interface, ICodeTipFuncHighlight Interface, ICodeTipMultiFunc Interface

[http://www.ticz.com/~nlewis/CodeTipUpdate.html]

This help file was generated from HTML source using WebTwin version 1.1b


CodeTipCancel Event

CodeTipCancel Event

A CodeMax control sends the CodeTipCancel event when the user cancels the syntax highlighting tooltip control by either hitting the Esc key or removing the input focus from the CodeMax control.

MIDL
void CodeTipCancel( [in] ICodeMax *Control, [in] ICodeTip* ToolTipCtrl, [out,retval] VARIANT_BOOL *bKeepVisible );

Visual Basic
Private Function controlname_CodeTipCancel( ByVal Control As CodeMaxCtl.ICodeMax, ByVal ToolTipCtrl As CodeMaxCtl.ICodeTip ) As Boolean

Parameters

Control

Address of an ICodeMax object.

ToolTipCtrl

Address of an ICodeTip object.

bKeepVisible

Address of a VARIANT_BOOL used for the return code (either VARIANT_TRUE or VARIANT_FALSE) from the event handler.

Return Values

Return TRUE if the tooltip control should remain visible.

Return FALSE if the tooltip control should be hidden.

Remarks

The type of object passed as the ToolTipCtrl parameter depends on the response to the initial CodeTip event, as indicated in the following table:

CodeTip Event Return Value	Object Type
cmToolTipTypeNormal	ICodeTip
cmToolTipTypeHighlight	ICodeTipHighlight
cmToolTipTypeFuncHighlight	ICodeTipFuncHighlight
cmToolTipTypeMultiFunc	ICodeTipMultiFunc

See Also

CodeTip Event, ICodeTip Interface, ICodeTipHighlight Interface, ICodeTipFuncHighlight Interface, ICodeTipMultiFunc Interface

[http://www.ticz.com/~nlewis/CodeTipCancel.html]

This help file was generated from HTML source using WebTwin version 1.1b


ICodeTip.Destroy Method

ICodeTip.Destroy Method

Destroys the tooltip control window attached to an ICodeTip object.

MIDL
HRESULT Destroy();

Visual Basic
object.Destroy

Parameters

This method has no parameters.

Return Values

This method has no return values.

See Also

ICodeTip Interface

[http://www.ticz.com/~nlewis/ICodeTip_Destroy.html]

This help file was generated from HTML source using WebTwin version 1.1b


ICodeTipHighlight.HighlightStartPos Property

ICodeTipHighlight.HighlightStartPos Property

Retrieves or sets the starting position for text highlighting in the tooltip control attached to an ICodeTipHighlight object.

MIDL
(propput) HRESULT HighlightStartPos( [in] long lPos );
(propget) HRESULT HighlightStartPos( [out, retval] long* lPos );

Visual Basic
object.HighlightStartPos [= lPos as Long]

Parameters

lPos

Zero-based index of the starting position for text highlighting in the tooltip control.

Return Values

Returns the zero-based index of the starting position for text highlighting in the tooltip control.

See Also

ICodeTipHighlight Interface, ICodeTip Interface

[http://www.ticz.com/~nlewis/HighlightStartPos.html]

This help file was generated from HTML source using WebTwin version 1.1b


ICodeTipHighlight.HighlightEndPos Property

ICodeTipHighlight.HighlightEndPos Property

Retrieves or sets the ending position for text highlighting in the tooltip control attached to an ICodeTipHighlight object.

MIDL
(propput) HRESULT HighlightEndPos( [in] long lPos );
(propget) HRESULT HighlightEndPos( [out, retval] long* lPos );

Visual Basic
object.HighlightEndPos [= lPos as Long]

Parameters

lPos

Zero-based index of the ending position for text highlighting in the tooltip control.

Return Values

Returns the zero-based index of the ending position for text highlighting in the tooltip control.

See Also

ICodeTipHighlight Interface, ICodeTip Interface

[http://www.ticz.com/~nlewis/HighlightEndPos.html]

This help file was generated from HTML source using WebTwin version 1.1b


ICodeTipFuncHighlight.Argument Property

ICodeTipFuncHighlight.Argument Property

Retrieves or sets the currently highlighted function argument in the tooltip control attached to an ICodeTipFuncHighlight object.

MIDL
(propput) HRESULT Argument( [in] long lArgument );
(propget) HRESULT Argument( [out, retval] long* lArgument );

Visual Basic
object.Argument [= lArgument as Long]

Parameters

lArgument

Zero-based index of the highlighted argument.

Return Values

Returns the zero-based index of the highlighted argument.

See Also

ICodeTipFuncHighlight Interface, ICodeTip Interface

[http://www.ticz.com/~nlewis/Argument.html]

This help file was generated from HTML source using WebTwin version 1.1b


ICodeTipMultiFunc.CurrentFunction Property

ICodeTipMultiFunc.CurrentFunction Property

Retrieves or sets the currently displayed function prototype in the tooltip control attached to an ICodeTipMultiFunc object.

MIDL
(propput) HRESULT CurrentFunction( [in] long lIndex );
(propget) HRESULT CurrentFunction( [out, retval] long* lIndex );

Visual Basic
object.CurrentFunction [= lIndex as Long]

Parameters

lIndex

Zero-based index of the currently displayed function prototype.

Return Values

Returns the zero-based index of the currently displayed function prototype.

See Also

ICodeTipMultiFunc Interface

[http://www.ticz.com/~nlewis/CurrentFunction.html]

This help file was generated from HTML source using WebTwin version 1.1b


ICodeTipMultiFunc.FunctionCount Property

ICodeTipMultiFunc.FunctionCount Property

Retrieves or sets the number of times the function in the tooltip control attached to an ICodeTipMultiFunc object has been overloaded.

MIDL
(propput) HRESULT FunctionCount( [in] long lCount );
(propget) HRESULT FunctionCount( [out, retval] long* lCount );

Visual Basic
object.FunctionCount [= lCount as Long]

Parameters

lCount

Number of times the function has been overloaded, or zero if the function has not been overloaded.

Return Values

Returns the number of times the function has been overloaded, or zero if the function has not been overloaded.

See Also

ICodeTipMultiFunc Interface

[http://www.ticz.com/~nlewis/FunctionCount.html]

This help file was generated from HTML source using WebTwin version 1.1b


If you can see this, your help file has no topics! See the status tab and webtwin.log for more information.

Note that it is important that you exit WebTwin first to make sure the log file is up to date.

Be aware that restarting WebTwin will cause the log file to be emptied, so check it before restarting.


This URL was excluded from the pulldown


The protocol used in this URL is not at present supported by WebTwin


This URL referenced an unknown protocol


This link was broken when WebTwin tried to fetch it


This URL contained unknown content


Robots are excluded from this URL


This link was not retrieved


This link was skipped because it was suspected to be an invalid URL


This link was skipped at user request


This link was skipped it was suspected to be CGI. This can be changed from the WebTwin Options tab.


This link was skipped it was an image, and the NoImages option was on. This can be changed from the WebTwin Options tab.


This link was skipped because either the user pressed the WebTwin 'Enough' button or the given retrieval time limit expired.


Registration information goes here