OLE SDK - Frame Interface (5): ioleinplaceframe :: setmenu

zhaozj2021-02-08  241

IoleinplaceFrame :: setmenu

Install the composite menu in the location where the window frame container object is activated.

HRESULT SEMENU (HMENU HMENUSHARED, // Complex Menu Handle HoleMenu HoleMenu, // Menu Descriptor Handle HWND HWndActiveObject // Object Window Handle);

parameter

Hmenushared

Call

IoleinplaceFrame :: Insertmenus and Windows

INSERTMENU functions constructed menu handle.

Holemenu

The Handle of the menu descriptor returned by the OlecReateMenudescriptor function.

HWndActiveObject

Handle with the window of the object and receives the menu message, command, and the window of the accelerator key.

return value

This method supports standard return value E_INVALIDARG and E_UNEXPECTED, also supports the following:

S_ok

The method was successfully completed.

Comment

Caller

Object call ioleinplaceframe :: setmenu to tell the container to install the composite menu structure through IoleinplaceFrame :: Insertmenus.

Realize attention

The implementation of this method of an SDI container should call Windows's setMenu function. A MDI window should send a WM_MDisetMenu message, use HMenushared as a menu to install. The container should call OLESETMENUDESCRIPTOR to install the OLE schedule code.

When it is inactive, the container must call ioleinplaceframe :: setMenu, specify null to remove the shared menu. This helps redraw the minimization window. The container should also call OLESETMENUDESCRIPTOR to specify null to decline the scheduling code. Finally, the object application calls OLEDESTROYMENUDESCRIPTOR to release the data structure.

Note You cannot call Windows PeekMessage or GetMessage Functions when you execute IoleInplaceFrame :: SetMenu, or a dialog box. If this is done, the system can crash. The OLE interface methods and functions that can be called in SetMenU have more restrictions.

Quick information

Windows NT: 3.1 or higher. Windows: Windows 95 or higher. Windows CE: does not support. HEADER: Oleidl.h.

See

IoleinplaceFrame :: Insertmenus, Olesetmenudescriptor, OLEDESTROYMENUDESCRIPTOR

Peekmessage, GetMessage in Win32

转载请注明原文地址:https://www.9cbs.com/read-3428.html

New Post(0)