Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Modeless Property Sheet not working as Expected!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Modeless Property Sheet not working as Expected!

 Post Reply Post Reply
Author
Message
Satyen View Drop Down
Groupie
Groupie
Avatar

Joined: 22 December 2008
Location: India
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Satyen Quote  Post ReplyReply Direct Link To This Post Topic: Modeless Property Sheet not working as Expected!
    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.
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 2013 at 10:14am
Hi, please create a support ticket. Thanks

Codejock support
Back to Top
Satyen View Drop Down
Groupie
Groupie
Avatar

Joined: 22 December 2008
Location: India
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Satyen Quote  Post ReplyReply Direct Link To This Post Posted: 29 May 2013 at 7:18am
While surfing on internet about modeless propertysheet I came across this discussion.
 
 
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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.059 seconds.