![]() |
Modeless Property Sheet not working as Expected! |
Post Reply ![]() |
Author | |
Satyen ![]() Groupie ![]() ![]() Joined: 22 December 2008 Location: India Status: Offline Points: 16 |
![]() ![]() ![]() ![]() ![]() 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 using ‘CXTPPropertySheet’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 –
}; 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
since ‘CXTPPropertySheet’ 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. |
|
![]() |
|
ABuenger ![]() Newbie ![]() ![]() Joined: 02 February 2006 Status: Offline Points: 1075 |
![]() ![]() ![]() ![]() ![]() |
Hi, please create a support ticket. Thanks
|
|
Codejock support
|
|
![]() |
|
Satyen ![]() Groupie ![]() ![]() Joined: 22 December 2008 Location: India Status: Offline Points: 16 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |