Exemple #1
0
/***********************************************************************
 *           OleUIPasteSpecialW (OLEDLG.22)
 */
UINT WINAPI OleUIPasteSpecialW(LPOLEUIPASTESPECIALW ps)
{
    LPCDLGTEMPLATEW dlg_templ = (LPCDLGTEMPLATEW)ps->hResource;
    UINT ret;

    TRACE("(%p)\n", ps);

    if(TRACE_ON(ole)) dump_pastespecial(ps);

    if(!ps->lpSrcDataObj)
        OleGetClipboard(&ps->lpSrcDataObj);

    if(ps->hInstance || !ps->hResource)
    {
        HINSTANCE hInst = ps->hInstance ? ps->hInstance : OLEDLG_hInstance;
        const WCHAR *name = ps->hInstance ? ps->lpszTemplate : MAKEINTRESOURCEW(IDD_PASTESPECIAL4);
        HRSRC hrsrc;

        if(name == NULL) return OLEUI_ERR_LPSZTEMPLATEINVALID;
        hrsrc = FindResourceW(hInst, name, (LPWSTR)RT_DIALOG);
        if(!hrsrc) return OLEUI_ERR_FINDTEMPLATEFAILURE;
        dlg_templ = LoadResource(hInst, hrsrc);
        if(!dlg_templ) return OLEUI_ERR_LOADTEMPLATEFAILURE;
    }

    ret = DialogBoxIndirectParamW(OLEDLG_hInstance, dlg_templ, ps->hWndOwner, ps_dlg_proc, (LPARAM)ps);

    return ret;
}
Exemple #2
0
/*************************************************************************
 * ShellAboutW                [SHELL32.289]
 */
BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
                         HICON hIcon )
{
    ABOUT_INFO info;
    HRSRC hRes;
    DLGTEMPLATE *DlgTemplate;
    BOOL bRet;

    TRACE("\n");

    // DialogBoxIndirectParamW will be called with the hInstance of the calling application, so we have to preload the dialog template
    hRes = FindResourceW(shell32_hInstance, MAKEINTRESOURCEW(IDD_ABOUT), (LPWSTR)RT_DIALOG);
    if(!hRes)
        return FALSE;

    DlgTemplate = (DLGTEMPLATE *)LoadResource(shell32_hInstance, hRes);
    if(!DlgTemplate)
        return FALSE;

    info.szApp        = szApp;
    info.szOtherStuff = szOtherStuff;
    info.hIcon        = hIcon ? hIcon : LoadIconW( 0, (LPWSTR)IDI_WINLOGO );

    bRet = DialogBoxIndirectParamW((HINSTANCE)GetWindowLongPtrW( hWnd, GWLP_HINSTANCE ),
                                   DlgTemplate, hWnd, AboutDlgProc, (LPARAM)&info );
    return bRet;
}
Exemple #3
0
/*
 * @implemented
 */
int
WINAPI
WlxDialogBoxIndirectParam(
    HANDLE hWlx,
    HANDLE hInst,
    LPCDLGTEMPLATE hDialogTemplate,
    HWND hwndOwner,
    DLGPROC dlgprc,
    LPARAM dwInitParam)
{
    PDIALOG_LIST_ENTRY ListEntry;
    int ret;

    UNREFERENCED_PARAMETER(hWlx);

    TRACE("WlxDialogBoxIndirectParam()\n");

    ListEntry = AddDialogListEntry();
    if (ListEntry == NULL)
        return -1;

    ListEntry->DlgProc = dlgprc;
    ListEntry->lParam = dwInitParam;

    ret = (int)DialogBoxIndirectParamW(hInst, hDialogTemplate, hwndOwner, DefaultWlxWindowProc, (LPARAM)ListEntry);

    RemoveDialogListEntry(ListEntry);

    return ret;
}
Exemple #4
0
/***********************************************************************
 *           acmFormatChooseW (MSACM32.@)
 */
MMRESULT WINAPI acmFormatChooseW(PACMFORMATCHOOSEW pafmtc)
{
    if (pafmtc->fdwStyle & ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATEHANDLE)
        return DialogBoxIndirectParamW(MSACM_hInstance32, (LPCDLGTEMPLATEW)pafmtc->hInstance,
                                       pafmtc->hwndOwner, FormatChooseDlgProc, (LPARAM)pafmtc);

    if (pafmtc->fdwStyle & ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATE)
        return DialogBoxParamW(pafmtc->hInstance, pafmtc->pszTemplateName,
                               pafmtc->hwndOwner, FormatChooseDlgProc, (LPARAM)pafmtc);

    return DialogBoxParamW(MSACM_hInstance32, MAKEINTRESOURCEW(DLG_ACMFORMATCHOOSE_ID),
                           pafmtc->hwndOwner, FormatChooseDlgProc, (LPARAM)pafmtc);
}
Exemple #5
0
static void hugsprim_DialogBoxIndirectParamW_2(HugsStackPtr hugs_root)
{
    HsPtr arg1;
    HsPtr arg2;
    HsPtr arg3;
    HsFunPtr arg4;
    HsInt32 arg5;
    HsInt res1;
    arg1 = hugs->getPtr();
    arg2 = hugs->getPtr();
    arg3 = hugs->getPtr();
    arg4 = hugs->getFunPtr();
    arg5 = hugs->getInt32();
    res1 = DialogBoxIndirectParamW(arg1, arg2, arg3, arg4, arg5);
    hugs->putInt(res1);
    hugs->returnIO(hugs_root,1);
}
INT_PTR UserImp::dialogBoxIndirectParamW(HINSTANCE hInstance, LPCDLGTEMPLATE hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
{
	if (!bUserLoaded && !loadExports(bAllowLoadLibrary))
	{
		_ASSERTEX(hUser32!=NULL);
		return 0;
	}
	
	INT_PTR nRc = DialogBoxIndirectParamW(hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam);
	/*
	if (dialogBoxIndirectParamW_f)
	{
		nRc = dialogBoxIndirectParamW_f(hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam);
	}
	else
	{
		_ASSERTEX(dialogBoxIndirectParamW_f!=NULL);
	}
	*/
	return nRc;
}
Exemple #7
0
/////////////////////////////////////////////////////////////////////////////
// LaunchWininetDialog
/////////////////////////////////////////////////////////////////////////////
DWORD LaunchWininetDialog
(
    HWND    hwnd,
    DWORD   dwError,
    LPVOID  lpInfo
)
{
    DWORD dwRet = ERROR_CALL_NOT_IMPLEMENTED;

    PERRORINFODLGTYPE   pDlgInfo = (PERRORINFODLGTYPE)lpInfo;


    switch (dwError)
    {
        //
        // NOTE NOTE!  If you remove any of these codes we handle w/o UI
        // then you will have to add UI resources to display the error
        //
        case ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION:
        {
            // decline
            dwRet = ERROR_CANCELLED;
            break;
        }
        
        case ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR:
        {
            // accept
            dwRet = ERROR_SUCCESS;
            break;
        }

        default:
            DLGPROC dlgProc;

            if ( ERROR_SUCCESS == MapWininetErrorToDlgId(dwError, &pDlgInfo->dwDlgId, &pDlgInfo->dwDlgFlags, &dlgProc) )
            {
                if ( TRUE == DialogBoxIndirectParamW(HINST_RESDLL,
                                (LPCDLGTEMPLATEW)LoadResource(HINST_RESDLL,FindResourceW(HINST_RESDLL,MAKEINTRESOURCEW(pDlgInfo->dwDlgId),RT_DIALOG)),
                                SHGetLastActiveWindow(hwnd),(DLGPROC)dlgProc,(LPARAM)lpInfo) )
                {
                    dwRet = ERROR_SUCCESS;
                }
                else
                {
                    dwRet = ERROR_CANCELLED;
                }
            }
            else
            {
                // this is REALLY bad, we encountered a WININET error we didn't have
                // dialogs for-- but it's better to be safe and cancel than let the 
                // user do something unsecure

                // should we have this registry enabled?
                // just in the small chance that we'd be denying some important site
                dwRet = ERROR_CANCELLED;
            }
            break;
    }

    return dwRet;
}