Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

custom dialog questions


2 replies to this topic

cristraum

cristraum
  • Members
  • 2 posts

Posted 25 August 2005 - 12:25

hello,

considering that there's no DateTimePicker control in IS X (and i need to use it), i've created a function that launches a mfc dialog and returns some data, something like:
CODE

INT __declspec(dllexport) __stdcall SdCustomDlg(HWND hISWnd, char *pszData)
{
   AFX_MANAGE_STATE(AfxGetStaticModuleState());

   CWnd *parent = CWnd::FromHandle(hISWnd);
   if ( parent )
   {
        CMyDialog dlg(parent);
        if (dlg.DoModal() == IDOK)
            strncpy(pszData, dlg.m_szData, SOME_LEN);
   }

   return 0;
}


this function is exported by a dll and i call it from install script, in OnFirstUIBefore():
CODE

Dlg_SdPrevDlg:
    nResult = SdPrevDlg(...);
    /* check result */

Dlg_SdCustomDlg:
    hMsi = GetWindowHandle(HWND_INSTALL);
    nResult = myDLL.SdCustomDlg(hMsi, ...);
    /* check result */

Dlg_SdNextDlg:
    nResult = SdNextDlg(...);



the problem i have is that this dialog box is displayed on top of the previous window. there's also a brief moment between clicking next or cancel in the custom dialog and viewing the next dialog when the previous window is visible. could the handle returned by GetWindowHandle(HWND_INSTALL) be used to somehow access the wizard sheet and to insert a page created by me?


as a workaround, i've tried hiding the main UI before launching the dialog, by calling
CODE

Dlg_SdCustomDlg:
   ShowWindow(hMSI, SW_HIDE);

   /* ...launch custom dialog */

   ShowWindow(hMSI, SW_SHOW);
,
but this does not work. is there a way to hide the UI using some other install script function (and then to restore it later)?

best wishes,
cristian.traum

Edited by cristraum, 25 August 2005 - 18:23.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 26 August 2005 - 22:33

Call
Disable(DIALOGCACHE);
before you call your DLL dialog.

cristraum

cristraum
  • Members
  • 2 posts

Posted 29 August 2005 - 09:18

works beautifully,
thanks!