AcquireModalDialogLockAndParent function

Notify Windows Internet Explorer that the caller will handle its own message loop.

Syntax

HRESULT AcquireModalDialogLockAndParent(
  _In_  HWND   proposedParentWindow,
  _Out_ HWND   *pActualParentWindow,
  _Out_ HANDLE *phModalDialogLock
);

Parameters

  • proposedParentWindow [in]
    Proposed parent window to be used by CreateWindow and similar functions.

  • pActualParentWindow [out]
    Window handle that should be used as parent of new window.

  • phModalDialogLock [out]
    Handle to control the lifetime of the lock. Used when calling ReleaseModalDialogLockAndParent. Can be NULL even in success case.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Some windows have their own dialog manager or other similar modal message loop. By aquiring this lock, you notify Internet Explorer that the code will provide its own message pump.

When running in Internet Explorer, modal dialogs get special treatment. The security differences between windows in the hierarchy can affect whether a dialog will show up correctly. In addition, isolation boundaries need to be kept for security reasons. A new parent with the correct security mode and input forwarding will be provided in pActualParentWindow if necessary.

The static method IEProcess::GetTabWindowExports returns a pointer to this function.

Requirements

Minimum supported client

Windows XP with SP2

Minimum supported server

Windows Server 2003

Header

Ieprocess.h

DLL

Iertutil.dll

See also

IEProcess