Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - CXTPTaskDialog
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPTaskDialog

 Post Reply Post Reply
Author
Message
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Topic: CXTPTaskDialog
    Posted: 06 August 2010 at 7:10am
Hello codejock developers!

This window/dialog is not subclassable when it uses system dialog!

I derived this class and start a thread for doing a long process. My thread sends progress information back to task dialog which updates his progress bar.
This works fine if codejock draws the task dialog itself (no vista/win7 or DoModal(false)).

But if codejock uses system dialog, I must subclass the system dialog for receiving my messages throw WndProc (message handlers). This works fine, too.
(it would be nice when codejock automatically attach the system dialog, so the class CDialog has an valid hWnd for calling methods such as GetSafeHwnd)


However, now you cannot call e.g. SetContent(...) anymore! Because the class thinks it is in simulation mode and response on TDM_SET_ELEMENT_TEXT. At end it calls RecalcLayout which resizes the window to minimal size.
(it should only response in simulation mode!)

I think the solution is, that the class should remember if it uses system dialog and don't process code in callbacks when it not in simulation mode...

Is this possible to realize?? If yes, please realize it as fast as possible!

Thanks
Back to Top
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Posted: 11 August 2010 at 2:49am
Can anybody confirm this problem?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 August 2010 at 3:40am
Try instead of subclassing use our Hooking:

XTPHookManager()->SetHook(hwnd, pThis);


int CMy::OnHookMessage(HWND hWnd, UINT nMessage, WPARAM& wParam, LPARAM& lParam, LRESULT& /*lResult*/)
{
     if (nMessage == WM_...)
     {
          ...
     }

     return FALSE;
}
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Posted: 11 August 2010 at 8:19am
Hello

I changed code as following

void CINSSoftwareUpdateDlg::OnDialogConstructed()
{
    //SubclassWindow( m_hwndTaskDialog );
    XTPHookManager()->SetHook(m_hwndTaskDialog, this);
   .
   .
   .


and insert the hook callback. So I can also access my private messages and works. Good idea.

However, think still about support subclassing!

First, code is more transparent. Now I have to change several things (it's only allowed native api calls, no message map support, ...)
Second, I can't validate in parent if dialog was created successfully. GetSafeHwnd() is now always NULL and m_hwndTaskDialog is protected.

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.203 seconds.