This documentation is archived and is not being maintained.

IOleInPlaceComponentUIManager.OnUIComponentEnterState Method

Informs the environment that an in-place VSPackage object has entered a new state.

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in

void OnUIComponentEnterState (
	[InAttribute] uint dwCompRole,
	[InAttribute] uint dwStateId,
	[InAttribute] uint dwReserved
void OnUIComponentEnterState (
	/** @attribute InAttribute() */ UInt32 dwCompRole, 
	/** @attribute InAttribute() */ UInt32 dwStateId, 
	/** @attribute InAttribute() */ UInt32 dwReserved
function OnUIComponentEnterState (
	dwCompRole : uint, 
	dwStateId : uint, 
	dwReserved : uint



[in] Role of the in-place object that has entered the new state. For a list of valid dwCompRole values, see OLEROLE.


[in] Identifier representing the new state. For a list of valid dwStateId values, see _OLECSTATE.


[in] Reserved for future use. Must be set to 0.

When an in-place VSPackage object managed by the SOleComponentUIManager service enters a new state, it calls OnUIComponentEnterState. One of the important states is the modal state, signifying that a modal dialog is visible. The SOleComponentUIManager informs all of the in-place objects that are affected by user interface changes and the innermost UI active object.

Any in-place object taking on the role of main component with subcomponents is responsible for notifying these sub-component objects of the new state. The subcomponent objects in turn should perform the necessary processing based on the state being entered. For a list of valid states, see _OLECSTATE.

The OnUIComponentEnterState method is analogous to the OnComponentEnterState method, which informs the SOleComponentManager service about changes in states that do not affect the user interface.

The SOleComponentUIManager uses the dwCompRole parameter to determine which in-place objects must be notified of the state change. If the caller is a main component, then typically only the innermost UI active object requires notification. The main component must notify its subcomponents by calling OnEnterState.

If the caller is a component control, it must be UI active.

If a sub-component is the caller of this method, the SOleComponentUIManager notifies both the main component and the UI active component. The sub-component must be prepared to receive the re-entrant OnEnterState call that comes before the OnUIComponentEnterState returns.