Share via


IMsoComponent::HwndGetWindow Method

Applies to: Office 2010

Retrieves a window that is associated with the component.

HWND HwndGetWindow(
   DWORD dwWhich,
   DWORD dwReserved
);

Parameters

  • dwWhich [in]
    The window for which to obtain the window handle (HWND). The possible values are specified in the following table.

    Value

    Description

    msocWindowFrameToplevel = 0

    Specifies the top frame window. Multiple-document interface (MDI) applications should return the MDI frame (not the MDI client) or the application frame window. Single-document interface (SDI) applications should return the frame window that hosts the component. This should be the topmost window that owns the component.

    msocWindowFrameOwner = 1

    Specifies the window that owns the component. The window may be the same as the top frame window, or may be an owned window of the top frame window.

    msocWindowComponent = 2

    Specifies the main window of the component.

    msocWindowDlgOwner = 3

    Specifies that the caller needs to display a dialog box to be owned by the component. The component should return a window that is suitable for use as the dialog box's owner window.

  • dwReserved [in]
    Reserved for future use. Should be 0.

Return Value

The handle to the window associated with the component. If this method fails or the window does not exist, NULL is returned.

See Also

Reference

IMsoComponent Interface