This should fix a timeout on the apitests.
if (m_pInfo->oaifInFlags & OAIF_EXEC)
m_pAppList->Execute(pApp, m_pInfo->pcszFile);
if (m_pInfo->oaifInFlags & OAIF_EXEC)
m_pAppList->Execute(pApp, m_pInfo->pcszFile);
- DestroyWindow(m_hDialog);
+ EndDialog(m_hDialog, 1);
return TRUE;
}
case IDCANCEL: /* cancel */
return TRUE;
}
case IDCANCEL: /* cancel */
- DestroyWindow(hwndDlg);
return TRUE;
default:
break;
return TRUE;
default:
break;
- DestroyWindow(hwndDlg);
return TRUE;
default:
break;
return TRUE;
default:
break;
HRESULT WINAPI
SHOpenWithDialog(HWND hwndParent, const OPENASINFO *poainfo)
{
HRESULT WINAPI
SHOpenWithDialog(HWND hwndParent, const OPENASINFO *poainfo)
{
TRACE("SHOpenWithDialog hwndParent %p poainfo %p\n", hwndParent, poainfo);
TRACE("SHOpenWithDialog hwndParent %p poainfo %p\n", hwndParent, poainfo);
COpenWithDialog pDialog(poainfo);
COpenWithDialog pDialog(poainfo);
- hwnd = CreateDialogParam(shell32_hInstance, MAKEINTRESOURCE(IDD_OPEN_WITH), hwndParent, COpenWithDialog::DialogProc, (LPARAM)&pDialog);
- if (hwnd == NULL)
- {
- ERR("Failed to create dialog\n");
- return E_FAIL;
- }
-
if (pDialog.IsNoOpen(hwndParent))
return S_OK;
if (pDialog.IsNoOpen(hwndParent))
return S_OK;
- ShowWindow(hwnd, SW_SHOWNORMAL);
+ ret = DialogBoxParamW(shell32_hInstance, MAKEINTRESOURCE(IDD_OPEN_WITH), hwndParent,
+ COpenWithDialog::DialogProc, (LPARAM)&pDialog);
- while (GetMessage(&msg, NULL, 0, 0) && IsWindow(hwnd))
+ if (ret == (INT_PTR)-1)
- if (!IsDialogMessage(hwnd, &msg))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
+ ERR("Failed to create dialog: %u\n", GetLastError());
+ return E_FAIL;
LPWSTR pszCmdLineW = NULL;
TRACE("%p, %p, %s, %d\n", hwnd, hinst, debugstr_a(cmdline), cmdshow);
LPWSTR pszCmdLineW = NULL;
TRACE("%p, %p, %s, %d\n", hwnd, hinst, debugstr_a(cmdline), cmdshow);
- __SHCloneStrAtoW(&pszCmdLineW, cmdline);
+ if (cmdline)
+ __SHCloneStrAtoW(&pszCmdLineW, cmdline);
OpenAs_RunDLLW(hwnd, hinst, pszCmdLineW, cmdshow);
SHFree(pszCmdLineW);
}
OpenAs_RunDLLW(hwnd, hinst, pszCmdLineW, cmdshow);
SHFree(pszCmdLineW);
}