comctl32: Preparatory changes for incoming TaskDialog implementation.

Patrick Gauthier webmaster at korosoft.net
Wed Jun 8 00:39:12 CDT 2011


Moved TaskDialogIndirect stub into newly-created taskdlg.c, added TaskDialog
function that calls TaskDialogIndirect, modified comctl32.spec to specify
ordinal for both functions as Windows' .lib files make compiled programs
import them by ordinal.
---
 dlls/comctl32/Makefile.in   |    1 +
 dlls/comctl32/comctl32.spec |    3 +-
 dlls/comctl32/commctrl.c    |   14 --------
 dlls/comctl32/taskdlg.c     |   72 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 75 insertions(+), 15 deletions(-)
 create mode 100644 dlls/comctl32/taskdlg.c

diff --git a/dlls/comctl32/Makefile.in b/dlls/comctl32/Makefile.in
index 1385da7..db72f7c 100644
--- a/dlls/comctl32/Makefile.in
+++ b/dlls/comctl32/Makefile.in
@@ -30,6 +30,7 @@ C_SRCS = \
 	string.c \
 	syslink.c \
 	tab.c \
+	taskdlg.c \
 	theme_button.c \
 	theme_combo.c \
 	theme_dialog.c \
diff --git a/dlls/comctl32/comctl32.spec b/dlls/comctl32/comctl32.spec
index 4613fda..f3804c6 100644
--- a/dlls/comctl32/comctl32.spec
+++ b/dlls/comctl32/comctl32.spec
@@ -61,6 +61,8 @@
 340 stdcall -ordinal DPA_CreateEx(long long)
 341 stdcall -noname SendNotify(long long long ptr)
 342 stdcall -noname SendNotifyEx(long long long ptr long)
+344 stdcall TaskDialog(long long wstr wstr wstr long wstr ptr)
+345 stdcall TaskDialogIndirect(ptr ptr ptr ptr)
 350 stdcall -noname StrChrA(str str)
 351 stdcall -noname StrRChrA(str str long)
 352 stdcall -noname StrCmpNA(str str long)
@@ -188,6 +190,5 @@
 @ stdcall PropertySheet(ptr) PropertySheetA
 @ stdcall PropertySheetA(ptr)
 @ stdcall PropertySheetW(ptr)
-@ stdcall TaskDialogIndirect(ptr ptr ptr ptr)
 @ stdcall UninitializeFlatSB(long)
 @ stdcall _TrackMouseEvent(ptr)
diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
index a82b233..eb0f6b5 100644
--- a/dlls/comctl32/commctrl.c
+++ b/dlls/comctl32/commctrl.c
@@ -1689,17 +1689,3 @@ int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *rect, DWORD
                                                                   crText, crShadow, ixOffset, iyOffset);
     return DrawTextW(hdc, pszText, cch, rect, DT_LEFT);
 }
-
-/***********************************************************************
- * TaskDialogIndirect [COMCTL32.@]
- */
-HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *pTaskConfig, int *pnButton,
-                                  int *pnRadioButton, BOOL *pfVerificationFlagChecked)
-{
-    FIXME("%p, %p, %p, %p\n", pTaskConfig, pnButton, pnRadioButton, pfVerificationFlagChecked);
-
-    if (pnButton) *pnButton = IDYES;
-    if (pnRadioButton) *pnRadioButton = pTaskConfig->nDefaultButton;
-    if (pfVerificationFlagChecked) *pfVerificationFlagChecked = TRUE;
-    return S_OK;
-}
diff --git a/dlls/comctl32/taskdlg.c b/dlls/comctl32/taskdlg.c
new file mode 100644
index 0000000..d1b9ab4
--- /dev/null
+++ b/dlls/comctl32/taskdlg.c
@@ -0,0 +1,72 @@
+/*
+ * Task Dialog
+ *
+ * Copyright 2011 Patrick Gauthier <webmaster at korosoft.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#include <assert.h>
+#include <stdarg.h>
+#include <string.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winnls.h"
+#include "commctrl.h"
+#include "comctl32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(taskdlg);
+
+/***********************************************************************
+ * TaskDialog [COMCTL32.344]
+ */
+HRESULT WINAPI TaskDialog(HWND hWndParent, HINSTANCE hInstance,
+                          PCWSTR pszWindowTitle, PCWSTR pszMainInstruction,
+                          PCWSTR pszContent, TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons,
+                          PCWSTR pszIcon, int *pnButton)
+{
+    TASKDIALOGCONFIG tdc;
+
+    memset(&tdc, 0, sizeof(TASKDIALOGCONFIG));
+    tdc.cbSize = sizeof(TASKDIALOGCONFIG);
+    tdc.hwndParent = hWndParent;
+    tdc.hInstance = hInstance;
+    tdc.dwCommonButtons = dwCommonButtons;
+    tdc.pszWindowTitle = pszWindowTitle;
+    tdc.pszMainInstruction = pszMainInstruction;
+    tdc.pszContent = pszContent;
+    tdc.pszMainIcon = pszIcon;
+
+    return TaskDialogIndirect(&tdc, pnButton, NULL, NULL);
+}
+
+/***********************************************************************
+ * TaskDialogIndirect [COMCTL32.345]
+ */
+HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *pTaskConfig, int *pnButton,
+                                  int *pnRadioButton, BOOL *pfVerificationFlagChecked)
+{
+    FIXME("%p, %p, %p, %p\n", pTaskConfig, pnButton, pnRadioButton, pfVerificationFlagChecked);
+
+    if (pnButton) *pnButton = IDYES;
+    if (pnRadioButton) *pnRadioButton = pTaskConfig->nDefaultButton;
+    if (pfVerificationFlagChecked) *pfVerificationFlagChecked = TRUE;
+    return S_OK;
+}
-- 
1.7.5.3


--Boundary_(ID_JedQmraSrBo44HGuD20dTQ)--



More information about the wine-patches mailing list