Print Page | Close Window

Modeless Property Sheet not working as Expected!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=21648
Printed Date: 18 June 2025 at 4:10am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Modeless Property Sheet not working as Expected!
Posted By: Satyen
Subject: Modeless Property Sheet not working as Expected!
Date Posted: 17 May 2013 at 3:58am

I have a desktop application. I want to invoke a modeless dialog from my application. Thus, I created a dialog usingCXTPPropertySheet’class. These are my requirements - Though my dialog is modeless I want it to be always in front. From my dialog I invoke a separate dialog. Now the new dialog should be the active one and in front. But if I again click on my dialog it should be the active and it should be in front.

This is my code –

Class  Declaration -

class JFEAOptimizationMainDlg : public CXTPPropertySheet
{
 
  DECLARE_DYNAMIC(JFEAOptimizationMainDlg
)

   private:

}; 

Class  Constructor -

JFEAOptimizationMainDlg::JFEAOptimizationMainDlg(JFEACreateOptimizationCmd* pCmd, CWnd* pParentWnd)

{

     HMODULE       hDCXResource = NULL;

     HINSTANCE     hInstPrevious = NULL;

     HWND          hWnd = GetSafeHwnd();

 

     JMGetPartDCXResourceModuleHandle(hDCXResource);

 

     if( NULL != hDCXResource )

     {

          hInstPrevious = AfxGetResourceHandle();

          AfxSetResourceHandle( hDCXResource );

     }

 

    

    CXTPPropertyPageListNavigator* pList = new 

       CXTPPropertyPageListNavigator();                   
    pList
->SetListStyle(xtpListBoxOffice2007);

    SetNavigator(pList);

    m_psh.dwFlags |= PSH_NOAPPLYNOW;

 

     // Add pages on main dialog.

     AddPage(&m_DesOptObjectivePage);

     AddPage(&m_DesOptLimitsPage);

     AddPage(&m_DesOptVariablesPage);

     AddPage(&m_DesOptCtrlParamPage);

     AddPage(&m_DesOptConvParamPage);

 

     // Create the dialog and display it.

     Create(); 

     

      SetWindowPos(

         &this->wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
     
      SetResizable();

}

  

With this code in place, my dialog always remains on top of all windows present. E.g. If I open IE then also my dialog appears in front. If I invoke a new dialog from my dialog then the new dialog goes behind my dialog. If I click on new dialog it does not come on front. This is annoying. In the SetWindowPos’ function I tried setting the firs parameter to  this->wndTop’ but then my dialog does not remain in front; and it minimizes if I click somewhere else in my application. Please refer this image.

    

I also tried sending different parameters to
Create’
function but none helped. I found that for modeless dialogs the create method should be called like this –

Create(JFEAOptimizationMainDlg::IDD, NULL);

However sinceCXTPPropertySheet’ does not have a resource associated with (no template id for my dialog) it I can’t use this.

Please help me to figure out the problem here. How can I achieve my required behavior? Let me know whether this is a limitation of codejock.

I have a urgency for this fix.



-------------
Thanks & Regards,
Satyenjit Bagal.
Software Development Engineer.
SIEMENS Automation and Drives.



Replies:
Posted By: ABuenger
Date Posted: 24 May 2013 at 10:14am
Hi, please create a support ticket. Thanks



-------------
Codejock support


Posted By: Satyen
Date Posted: 29 May 2013 at 7:18am
While surfing on internet about modeless propertysheet I came across this discussion.
 
http://msgroups.net/microsoft.public.vc.mfc/how-to-make-a-popup-window-always-on/564218" rel="nofollow - http://msgroups.net/microsoft.public.vc.mfc/how-to-make-a-popup-window-always-on/564218
 
I think we can not make modeless property sheets to stay always on top of our application windows. It will either stay on top of all windows or it will go in background. This seems to be a limitation from Microsoft. I request forum members to confirm  this.  


-------------
Thanks & Regards,
Satyenjit Bagal.
Software Development Engineer.
SIEMENS Automation and Drives.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net