On 24.02.2017 23:04, Fabian Maurer wrote:
Signed-off-by: Fabian Maurer dark.shadow4@web.de
dlls/comctl32/taskdialog.c | 137 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 105 insertions(+), 32 deletions(-)
diff --git a/dlls/comctl32/taskdialog.c b/dlls/comctl32/taskdialog.c index 3d6b99000c..63848303f5 100644 --- a/dlls/comctl32/taskdialog.c +++ b/dlls/comctl32/taskdialog.c @@ -69,6 +69,26 @@ typedef struct UINT y; }button_info;
+typedef struct +{
- struct list entry;
- const TASKDIALOGCONFIG *task_config;
- HFONT font_default;
- HFONT font_main;
- HWND hwnd;
+}taskdialog_info;
+struct list taskdialogs = LIST_INIT(taskdialogs);
+static CRITICAL_SECTION taskdialog_section; +static CRITICAL_SECTION_DEBUG taskdialog_section_debug = +{
- 0, 0, &taskdialog_section,
- { &taskdialog_section_debug.ProcessLocksList, &taskdialog_section_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": taskdialog_section") }
+}; +static CRITICAL_SECTION taskdialog_section = { &taskdialog_section_debug, -1, 0, 0, 0, 0 };
Why would you need something like that? What is unsafe about regular dialog window?
Why would you need something like that? What is unsafe about regular dialog window?
Since there can be multiple taskdialogs open at the same time, I figured the instance-list should only be accessed in a thread-safe manner. Am I wrong there?
Regards, Fabian Maurer
On 25.02.2017 0:43, Fabian Maurer wrote:
Why would you need something like that? What is unsafe about regular dialog window?
Since there can be multiple taskdialogs open at the same time, I figured the instance-list should only be accessed in a thread-safe manner. Am I wrong there?
Why do you need such a list?
Regards, Fabian Maurer
Why do you need such a list?
The DialogProc needs to access some additional information, like whether the dialog be cancelled or not, or the callback pointer. If you have a better idea to solve this problem, I'd love to hear it. That was just the one I came up with.
Regards, Fabian Maurer
On 25.02.2017 1:22, Fabian Maurer wrote:
Why do you need such a list?
The DialogProc needs to access some additional information, like whether the dialog be cancelled or not, or the callback pointer. If you have a better idea to solve this problem, I'd love to hear it. That was just the one I came up with.
If you mean you need to store control specific data, take a look how it's done for other controls in comctl32.
Also, please, let's focus on basic structure first, instead of resending everything. Things to discuss and think about:
- moving to separate files, I'm fine with that as if follows what comctl32 is already doing. Anyone opposed? - implementing dialog using dynamically constructed dialog template. Why is it better than creating controls manually at runtime? What are pros and cons of those solutions?
I'll comment on other patches too, but first thing to do would be to properly implement taskdialog in its current incomplete form, that's based on messagebox, so we get proper structure first and don't loose anything in behavior.
Regards, Fabian Maurer
If you mean you need to store control specific data, take a look how it's done for other controls in comctl32.
Thanks, that makes sense. I'll change the way that works.
implementing dialog using dynamically constructed dialog template. Why is it better than creating controls manually at runtime? What are pros and cons of those solutions?
Well, the main reason for using a dialog is that it makes the code a lot easier. Instead of creating and destroying all controls by hand, we can let the dialog functions take care of that. It just seemed easier to implement, and generating a template in memory isn't that difficult.
I'll comment on other patches too, but first thing to do would be to properly implement taskdialog in its current incomplete form, that's based on messagebox, so we get proper structure first and don't loose anything in behavior.
I see, that was my first idea, too. I'll try to temporarily remove the parts that aren't necessary for my implementation to replace the current one.
Regards, Fabian Maurer