Print Page | Close Window

Close TaskDialog or Hide Buttons

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=13866
Printed Date: 23 November 2024 at 2:45am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Close TaskDialog or Hide Buttons
Posted By: jpbro
Subject: Close TaskDialog or Hide Buttons
Date Posted: 30 March 2009 at 11:29pm
I'm really desperate for a way to either:

A) Close the TaskDialog menu without clicking a button, or
B) Hide a button on the TaskDialog so I can close it with ClickButton (but the user cannot see it or click it).

The reason for this is that I have a marquee style progress bar moving with a separate thread doing background processing. The user has the option to click the Cancel button, but I would also like the ability to close the TaskDialog in code when the thread is finished processing (without clicking the Cancel button in code).

Any chance at all of either (or both) of these in the next release?



-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6




Replies:
Posted By: Oleg
Date Posted: 31 March 2009 at 2:54am

Hi,

Why you can't call
TaskDialog1.ClickButton xtpTaskButtonCancel and set some flag variable that you close it manually? :)
 
But anyway you are right, we need some Close method.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jpbro
Date Posted: 31 March 2009 at 9:14am
You're right that I could do it this way (and I may have to for now). I was hoping to avoid this, because I am already tracking a somewhat complex state machine in the TaskDialog timer event, and adding extra variables would just add to the code complication...

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 31 March 2009 at 6:17pm
Hi Oleg,
Sorry for being a pest, but is there any chance this feature (close TaskDialog) could make it into an early build (or at least the next release)?


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 27 July 2009 at 10:36am
Hi Oleg,

I'm back to this one as I've found I need the ability to close the TaskDialog by code without showing a button again. Any chance of this? Or could you expose the Hwnd and maybe SendMessage(WM_CLOSE) or CloseWindow would work?

Thanks.


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 27 July 2009 at 1:50pm
Ok, I've been able to get the Hwnd of the dialog by calling FindWindow in the Constructed event. Unfortunately, I haven't been able to close it. I've tried:

SendMessage(WM_CLOSE) <this get consumed because I also need AllowCancellation = False
DestroyWindow() <Dialog disappears, but does not release itself so the app gets stuck.

Any ideas what I could call to close the window now that I have the hwnd?

Thanks.


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 27 July 2009 at 1:56pm
Got it...If I set .AllowCancellation = True immediately before I call SendMessage(WM_CLOSE), then I can close the window.

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 27 July 2009 at 6:13pm
I think I've solved most of the problems that I was having. If anyone else is interested, then here's some demo code:

https://forum.codejock.com/forum_posts.asp?TID=14843 - https://forum.codejock.com/forum_posts.asp?TID=14843


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net