Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - Close TaskDialog or Hide Buttons
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Close TaskDialog or Hide Buttons

 Post Reply Post Reply
Author
Message
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Topic: Close TaskDialog or Hide Buttons
    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

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: 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
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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