Miscellaneous Dialog Control Methods

The following methods are general purpose dialog control methods.

ProcessMessage

>>-aDialogControl~ProcessMessage(--message--,--firstParam--,--secondParam--)-><


The ProcessMessage method sends a Windows message to a dialog control.

Arguments:

The arguments are:

message

The number of the message to be sent to the dialog control.

firstParam,secondParam

Additional arguments specific to the message.

Return value:

The return values are message-specific.

Example:

The following example erases the background of the edit control with the resource ID (symbolic ID) of IDC_EDIT1:

dlgc = MyDialog~GetEditControl("IDC_EDIT1")
WM_ERASEBACKGROUND = "14"~x2d
hdc = dlgc~GetDc
dlgc~ProcessMessage(WM_ERASEBACKGROUND, hdc, 0)
dlgc~FreeDC(hdc)

Note: Use the Windows documentation and Platform SDK to obtain the Window message numbers.

Value

>>-aDialogControl~Value----------------------------------------><


The Value method retrieves the current value of a dialog control.

Return value:

The current value set in the dialog control.

Note: See GetValue for more information.

Value=

>>-aDialogControl~Value=--new_value----------------------------><


The Value= method sets a value for a dialog control.

Arguments:

The only argument is:

new_value

The value assigned to the dialog control.

Example:

The following example selects check box RESTART and deselects check box VERIFY:

MyDialog~GetCheckControl("RESTART")~Value=1
MyDialog~GetCheckControl("VERIFY")~Value=0

Note: See SetValue for more information.

AssignWindow

>>-aDialogControl~AssignWindow(--hwnd--)-----------------------><


The AssignWindow method connects a dialog or dialog control with an existing object of the PlainBaseDialog or DialogControl class. Note that the connected dialog or dialog control might not support all methods provided by the DialogControl class.

Note Well:

The AssignWindow method is used internally to connect ooRexx objects (a DialogControl object) to the underlying Windows dialog control. It is not recommended that the programmer use this method unless he throughly understands the ooDialog framework. Otherwise, using this method has the potential for causing unpredictable behavior.

Arguments:

The only argument is:

hwnd

The handle to the dialog or dialog control that you want to assign to the DialogControl object.

Return value:

The handle to the dialog or dialog control that has been assigned, or 0 if the connection failed.

Example:

The following example searches the desktop for a dialog with the title "Monitoring Applications", connects it to the object dlgc of the DialogControl class, and then hides the dialog:

dlgc = .DialogControl~new
...
whnd = FindWindow("Monitoring Application")
if whnd \= 0 then do
   dlgc~AssignWindow(whnd)
   dlgc~Display("HIDE")
end