You may use this resource:
Code:
RESOURCE DIALOG r_message_query_dialog
{
flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
items=
{
DLG_LINE
{
type = EAknCtPopupHeadingPane;
id = EAknMessageQueryHeaderId;
itemflags = EEikDlgItemNonFocusing;
control = AVKON_HEADING
{
};
},
DLG_LINE
{
type = EAknCtMessageQuery;
id = EAknMessageQueryContentId;
control = AVKON_MESSAGE_QUERY
{
};
}
};
}
RESOURCE TBUF r_heading_text
{
buf = qtn_heading_text;
}
RESOURCE TBUF r_message_text
{
buf = qtn_message_text;
}
Code:
Code:
void CYourClass::ShowInfoDialog(TInt aHeadingId, TInt aTitleResId)
{
HBufC *aInfoTxt = iEikonEnv->AllocReadResourceLC(aHeadingId);
HBufC *aTitle = iEikonEnv->AllocReadResourceLC(aTitleResId);
CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog();
dlg->PrepareLC(R_MESSAGE_QUERY_DIALOG);
dlg->SetMessageTextL(aInfoTxt->Des());
dlg->QueryHeading()->SetTextL(aTitle->Des());
dlg->RunLD();
CleanupStack::PopAndDestroy(aTitle);
CleanupStack::PopAndDestroy(aInfoTxt);
}
Now you can call like this: ShowInfoDialog(R_HEADING_TEXT, R_MESSAGE_TEXT);. You have to include aknmessagequerydialog.h header and link against avkon.lib.
NB: The above code will display a dialog with a header and message part with OK and Cancel CBA.