ComControl Control

 

The COMCONTROL is used to host an ActiveX, OLE, VB, or COM component control. You indicate the specific control by placing a programmatic identifier (progid), class identifier (classid) or moniker in the text attribute of the COMCONTROL definition string.

If the control requires a license, place the license string in the Variable attribute. If all computers that execute your script have a machine license then you can set the Variable attribute to an empty string (""). The DEFAULT keyword should be used as a placeholder in the Variable attribute position when the control does not require a license.

You can also find more information about using the Internet Explorer based WebBrowser and MSHTML: controls under the help topic "Internet Explorer COMCONTROL"

Return Value:

Depends on the control. Many COM controls support COM events. Events are notifications passed back to the control's container when a use action occurs or a control's state changes. COM events often provide detailed information about the event and some even allow you to pass information back to control. You can receive COM events and related information in your dialog's callback procedure by using the DialogObject function to indicate which control events should cause your dialog callback procedure to be invoked by the control. You can find more information about event handling, including an example, under the DialogObject help topic.

Control Definition:

 

<dlg-variable>nn =`x, y, width, height, type, control-name, license-string, progid/classid/moniker, value, tab-order, style, font, textcolor, backgroundcolor`

 

For Example:

MyDialog003=`007,007,224,132,COMCONTROL,"ComControl_1",DEFAULT,"ProgID/ClassID/URL required",DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

 

Attribute

Value

Meaning

dlg-variable

MyDialog

The name of the dialog box.

nn 

003

The ordinal position of the control in the dialog box (starting with 1).

x

007

The horizontal coordinate of the upper left corner of the control in Dialog Units.

y

007

The vertical coordinate of the upper left corner of the control in Dialog Units.

width

224

The width of the control in Dialog Units

height

132

The height of the control in Dialog Units.

type 

COMCONTROL

The type of control.

control-name

"ComControl_1"

The name used to identify the control in a user defined callback procedure. The name cannot be more than 30 characters in length and MUST be unique. ( This attribute can only be used with 6.2 or later dialog formats. )

license-string

DEFAULT

If you are specifying a COMCONTROL control and it requires a license string, the quoted license string should be placed here. If you have a machine license installed on all computers that run your script, you can place an empty string in this field. The Dialog function will then interrogate the system for the controls license. Use the DEFAULT keyword as a placeholder if the control does not require a license.

progid / classid / moniker

"servername.classname"

progid: is used with COMCONTROL controls and is the programmatic identifier of an ActiveX , OLE or COM component control that supports integration into an automation client container. It is usually in the form servername.classname.

classid: can be used as alternative to a controls progid. It is a sequence of hexadecimal numbers that must be quoted and enclosed in a curly brace ({}) pair. It is usually in the form "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" were each X is a hexadecimal digit.

moniker: Two special monikers can be used in this attribute to implicitly use the WebBrowser Control or MSHTML component provided by Internet Explorer. You can use the WebBrowser control by placing a quoted URL moniker recognized by Internet Explorer in the attribute. The URL can point to either a local file or a document on the Internet. Use the Document control by specifying the programmatic identifier "MSHTML:" in this attribute. You can optionally add valid html text after the colon (:) and the MSHTML document object will parse and render the html in its window.

See the discussion under the topic "Internet Explorer COMCONTROL" for more information.

value

DEFAULT

Not applicable to this control.

tab-order

30

Allows you to specify a control's tab order independently of a control's position or name in the dialog template. Tab-order controls the order in which controls are accessed when the keyboard is used to navigate the dialog. It also influences which control is on top when controls have overlapping positions in the dialog. It can be any positive integer, but each control should have a unique number.

When you navigate through a dialog using the tab key, lower number controls will be given the keyboard focus before higher controls. Likewise, low-numbered overlapping controls will appear on top of higher numbered controls. If you specify the DEFAULT keyword for this attribute or if you give two controls the same tab order, a tab order will be arbitrarily assigned to the control.

Note: The dialog function, under certain circumstances, may change the tab order you specify. The GROUPBOX controls tab order may be adjusted so that it is smaller than any of the controls it contains. In addition, the tab order of the controls inside the GROUPBOX may be adjusted so that they are consecutive.

style 

DEFAULT

Allows you to control the initial appearance and behavior of your control. Numbers represent each style and they can be combined, using the bit-wise OR (|) operator, to set multiple styles. The following table lists the style constants and their meanings.

Style

Meaning

@csInvisible (1)

Control is invisible

@csDisabled (2)

Control has disabled appearance and does not accept any user input, it would otherwise accept input.

 

Note: Specifying 0 for this attribute is equivalent to using the DEFAULT keyword and means that the control will exhibit default behavior.

font 

DEFAULT

You can include text font, text color and background color information in the appropriate attribute fields of the control definition string. However, many COM based controls ignore this information. As an alternative, many controls provide properties and method to change the appearance and behavior of the control. To use these properties and methods you can use the DialogObject function to obtain a reference to the control in the initialization (0) call to a user defined dialog callback procedure. Once you have the control reference, you can directly access the properties and methods of the control using standard COM dot notation.

textcolor 

DEFAULT

You can include text font, text color and background color information in the appropriate attribute fields of the control definition string. However, many COM based controls ignore this information. As an alternative, many controls provide properties and method to change the appearance and behavior of the control. To use these properties and methods you can use the DialogObject function to obtain a reference to the control in the initialization (0) call to a user defined dialog callback procedure. Once you have the control reference, you can directly access the properties and methods of the control using standard COM dot notation.

backgroundcolor 

DEFAULT

You can include text font, text color and background color information in the appropriate attribute fields of the control definition string. However, many COM based controls ignore this information. As an alternative, many controls provide properties and method to change the appearance and behavior of the control. To use these properties and methods you can use the DialogObject function to obtain a reference to the control in the initialization (0) call to a user defined dialog callback procedure. Once you have the control reference, you can directly access the properties and methods of the control using standard COM dot notation.

 

 

Event Options

Use the DialogProcOptions function to control when your User-Defined-Callback procedure is called by its associated dialog. You can also use it to control your dialog's behavior, while your procedure is executing. You usually establish callback events during the first call to the procedure i.e., event 0, but this can be done during any call.

Event-Option-Code Values

Meaning

@deComEvent (14)

COM-Event: This event is not supported by DialogProcOptions. Use DialogObject to monitor for COM events.

 

 

 

 
Dialog Callback Procedure Function Options

DialogControlGet function returns text and state information associated with a control.

Request

Meaning

@dcPosition (17)

Space delimited list of a control's position and size in dialog units relative to the dialog's client area. The first two numbers are the horizontal and vertical location of the upper-left corner of the control while the third and fourth numbers are the width and height of the control.

@dcMenuNames (18)

Tab delimited list of menu item names associated with the control, menu item or menu bar.

@dchWnd (19)

Window handle of a dialog control.

 

 

 

DialogControlSet function changes the text or appearance of a control.

Request

Meaning

@dcPosition (17)

Space delimited list of a control's position and size in dialog units relative to the dialog's client area. The first two numbers are the horizontal and vertical location of the upper-left corner of the control while the third and fourth numbers are the width and height of the control.

 

 

 

DialogControlState function changes a control’s style or gives control input focus.

Style

Meaning

@csInvisible (1)

Control is invisible

@csDisabled (2)

Control has disabled appearance and does not accept any user input, it would otherwise accept input.

 

 
 

 

§         Dialog

§         Dialog Overview

§         Defining the Dialog

§         Defining the Dialog Controls

§         Dialog Control Types

§         Dynamic Dialogs

§         InternetExplorer Controls

§         Dialog Units

§         Dialog Fonts

 

Control Types

§         Calendar

§         Checkbox

§         ComControl

§         DropListbox

§         Editbox

§         FileListbox

§         Groupbox

§         Itembox

§         MenuBar

§         MenuItem

§         MultiLinebox

§         Picture

§         PictureButton

§         PushButton

§         RadioButton

§         ReportView

§         Spinner

§         StaticText

§         VaryText