How to detect that a modeless TaskDialog is closed |
Post Reply |
Author | |
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
Posted: 17 December 2010 at 8:16am |
I'm running a modeless TaskDialog using the create method.
My question is: "How do I detect that the dialog is closed ?" When I press a button the TaskDialog closes automatically, but the class of cause still lives. I was expecting that I could test the GetSafeHwnd() of the TaskDialog, but it seems that this is not set to NULL after it is closed ?
I'm not able to process the OnButtonClicked callbacks, since I'm running inside another windows message.
-cpede
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
OK I can check the ::IsWindowsVisible, and then I can continue.
But isn't it a little strange that the dialog is closed, and the handle is still valid?
-cpede
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 890 |
Post Options
Thanks(0)
|
It seems strange that you would be calling Create on a dialog you want to be modeless. I assume you are calling DoModal, in which case calling Create is not necessary. If you call Create, you need to call DestroyWindow.
|
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
What do you mean? It is normal to call the Create method to make a dialog modeless, whereas the DoModal makes is modal?
But on standard dialogs, closing the dialog means calling destroy, and then the window handle becomes NULL. This is somehow different on the TaskDialog, and that was what I was asking about; "if IsWindowVisible was the correct and recommended way to detect if a TaskDialog is closed"?
-cpede
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 890 |
Post Options
Thanks(0)
|
Sorry, I was thinking modal not modeless.
|
|
jimmy
Senior Member Joined: 11 November 2003 Location: Austria Status: Offline Points: 515 |
Post Options
Thanks(0)
|
Hi,
How do you create the instance ? With new, global, ??? Jimmy |
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 890 |
Post Options
Thanks(0)
|
I have not worked with this particular class but I would assume you create a window the same way you create any window in Windows.
When a modeless window is created, the call to destroy the window depends on the design. Some windows destroy themselves on close. Some windows are "global" and remain valid until some other code destorys the window.
If this window is not destorying itself and you want that behavior, subclass the window and when the close event occurs, call DestroyWindow.
|
|
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 |