Indesign Extension from Plugin Modal dialog
Hi
I have a InDesign C++ plugin that is has a modal dialog and it's corresponding observer. I am launching a extension on the click of a button on this modal dialog. Here's a rough pseudocode
CMyDlgObserver::Update(const ClassID& pChange, ISubject* pSubject, const PMIID& pProtocol, void* pChangedBy)
{
// Call the base class Update function so that default behavior will still occur (OK and Cancel buttons, etc.).
CDialogObserver::Update(pChange, pSubject, pProtocol, pChangedBy);
do
{
InterfacePtr<IControlView> controlView(pSubject, UseDefaultIID());
CHECK_BREAK(controlView);
// Get the widget ID from the view.
WidgetID theSelectedWidget = controlView->GetWidgetID();
if(theSelectedWidget == kMyButtonWidgetID && pProtocol == IID_IBOOLEANCONTROLDATA && pChange == kTrueStateMessage)
{
LaunchExtension(controlView);
}
} while (kFalse);
}
My Extension has the following fragment of manifest (
<HostList>
<Host Name="IDSN" Version="15" />
</HostList> <UI>
<Type>ModalDialog</Type>
<Menu>MyExtension</Menu>
<Geometry>
<Size>
<Height>107</Height>
<Width>290</Width>
</Size>
<MaxSize>
<Height>700</Height>
<Width>1280</Width>
</MaxSize>
<MinSize>
<Height>107</Height>
<Width>290</Width>
</MinSize>
</Geometry>
</UI>
I have the folowing observations and questions:
1. Does Indesign support Modal Extensions?
2. When the call LaunchExtension is done, the extension window launches correctly, on top the plugin modal dialog. However, after closing the extension window, I notice that my original modal dialog (on who's button click the extension is launched) effectively becomes non modal (I can click the InDesign Menus though most of them are non functional). This creates possiblity to execute some otherwise impossible use cases had the plugin dialog stayed modal. One such example is right clicking the InDesign instance on the windows status bar and click on "Close Window" as shown)

This shutdown event is effectively blocked while a modal dialog is shown, but now since the plugin dialog is open, shutdown event seems to get triggerred. There are several such undesirable behaviors that become possible just because the original plugin modal dialog effectively became non-modal.
Continuing, now, when I dismiss the plugin dialog, when I click on any menu item, InDesign Debug version shows the following dialog

I suspect this is due to some interaction of the extension and the plugin. I need some help with my situation and to understand what is happening behind these observed behaviors and what is the right way to integrate the modal plugin dialog and the extension (in case it already isn't)
Thanks,
