CXTPTaskDialog |
Post Reply |
Author | |
Michl
Senior Member Joined: 14 September 2007 Status: Offline Points: 138 |
Post Options
Thanks(0)
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 |
|
Michl
Senior Member Joined: 14 September 2007 Status: Offline Points: 138 |
Post Options
Thanks(0)
|
Can anybody confirm this problem?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
Michl
Senior Member Joined: 14 September 2007 Status: Offline Points: 138 |
Post Options
Thanks(0)
|
Hello
I changed code as following
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. |
|
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 |