CXTPTaskDialog
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=17077
Printed Date: 17 November 2024 at 12:26am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: CXTPTaskDialog
Posted By: Michl
Subject: CXTPTaskDialog
Date 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
|
Replies:
Posted By: Michl
Date Posted: 11 August 2010 at 2:49am
Can anybody confirm this problem?
|
Posted By: Oleg
Date 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
|
Posted By: Michl
Date 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.
|
|