comctl32: Improve the stub of TaskDialogIndirect to display a simple message box pending a full implementation

Jeff Latimer lats at yless4u.com.au
Wed Jul 20 09:39:56 CDT 2011


This should allow more apps to run.  My mail import has blown up and I
may have messed up the format of the patch.

dlls/comctl32/commctrl.c |   22
+++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
index a82b233..a0d8536 100644
--- a/dlls/comctl32/commctrl.c
+++ b/dlls/comctl32/commctrl.c
@@ -1696,9 +1696,29 @@ int WINAPI DrawShadowText(HDC hdc, LPCWSTR
pszText, UINT cch, RECT *rect, DWORD
 HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *pTaskConfig,
int *pnButton,
                                   int *pnRadioButton, BOOL
*pfVerificationFlagChecked)
 {
+    UINT uType = 0;
+    INT  ret;
     FIXME("%p, %p, %p, %p\n", pTaskConfig, pnButton, pnRadioButton,
pfVerificationFlagChecked);
 
-    if (pnButton) *pnButton = IDYES;
+    if (pTaskConfig->dwCommonButtons & (TDCBF_YES_BUTTON |
TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON))
+        uType &= MB_YESNOCANCEL;
+    else
+    if (pTaskConfig->dwCommonButtons & (TDCBF_YES_BUTTON |
TDCBF_NO_BUTTON))
+        uType &= MB_YESNO;
+    else
+    if (pTaskConfig->dwCommonButtons & (TDCBF_RETRY_BUTTON |
TDCBF_CANCEL_BUTTON))
+        uType &= MB_RETRYCANCEL;
+    else
+    if (pTaskConfig->dwCommonButtons & (TDCBF_OK_BUTTON |
TDCBF_CANCEL_BUTTON))
+        uType &= MB_OKCANCEL;
+    else
+    if (pTaskConfig->dwCommonButtons & TDCBF_OK_BUTTON)
+        uType &= MB_OK;
+    ret = MessageBoxW(pTaskConfig->hwndParent,
pTaskConfig->pszMainInstruction,
+                      pTaskConfig->pszWindowTitle, uType);
+    FIXME("dwCommonButtons=%x uType=%x ret=%x\n",
pTaskConfig->dwCommonButtons, uType, ret);
+
+    if (pnButton) *pnButton = ret;
     if (pnRadioButton) *pnRadioButton = pTaskConfig->nDefaultButton;
     if (pfVerificationFlagChecked) *pfVerificationFlagChecked = TRUE;
     return S_OK;



More information about the wine-patches mailing list