3.52 DM_QueryBox

Using this function you can open a specified messagebox. The program waits until the user has closed this box.

DM_Enum DML_default DM_EXPORT DM_QueryBox
(
  DM_ID objectID,
  DM_ID parentID,
  DM_Options options
)

Parameters

-> DM_ID objectID

This parameter specifies the messagebox to be opened.

-> DM_ID parentID

This parameter specifies the window in which the messagebox is to appear. The parameter may be ignored. If this parameter is indicated, a window or NULL has to be specified.

If the window system allows it, the messagebox is represented centered in the parent window. Otherwise, the position is defined by the window system (e.g. screen center).

-> DM_Options options

Currently not used. Please specify with 0.

Return Value

Number of pressed button. There are the following definitions for it:

Example

A messagebox is to be opened out of a C function. This C function looks as follows:

DM_Boolean DML_default DM_ENTRY MESSBOX __1((DM_ID id))

{

    DM_Value data;

    /* Setting the text to be displayed */

    data.type = DT_string;

    data.value.string = "HELLO TEST";

    DM_SetValue(id , AT_text , 0 , &data , DMF_ShipEvent );

 

    /* Setting the title of the messagebox. */

    data.type = DT_string;

    data.value.string = "test output";

    DM_SetValue(id , AT_title , 0 , &data , DMF_ShipEvent );

    /*

    ** Opening messagebox and returning TRUE

    ** on pressing OK

    */

    return ((DM_QueryBox(id,0,0)== MB_ok) ? TRUE : FALSE);

}

See Also

C function DM_OpenBox

Object messagebox

Built-in function querybox() in manual “Rule Language”