Jump to content

wpViewObject

From EDM2

This instance method either opens a view of the given object or resurfaces an existing view.

Syntax

_wpViewObject(somSelf, hwndCnr, ulView, param)

Parameters

somSelf (WPObject *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPObject.
hwndCnr (HWND) - input
Handle for the view of the object's container.
ulView (ULONG) - input
Flag indicating how to view the object. This parameter takes one of the following flags or any other defined open view for that class:
OPEN_CONTENTS Open contents view for folders only.
OPEN_DEFAULT Open default view (same as double-click).
OPEN_DETAILS Open details view.
OPEN_HELP Display HelpPanel.
OPEN_PALETTE Palettes only.
OPEN_RUNNING Execute object.
OPEN_SETTINGS Open Settings notebook.
OPEN_TREE Open tree view for folders only.
OPEN_USER Class-specific views have a greater value than this.
param (ULONG) - input
Optional parameter.

Returns

hwnd (HWND) - returns
Window handle of the view that has been opened or resurfaced.
A return value of NULLHANDLE indicates that an error occurred while trying to view the object.

Remarks

Depending on whether the view of this object already exists and whether multiple concurrent views are set for this object, the parameters are passed on to either wpOpen to open a view of this object or to wpSwitchTo to surface an existing view. It is recommended that you use this method instead of wpOpen.

Usage

This method can be called at any time to view an object.

How to Override

This method is generally not overridden.

Example Code

This example opens Hex and Text views.

SOM_Scope BOOL   SOMLINK Browse_O_Maticwps_wpMenuItemSelected(Browse_O_Matic *somSelf,
                                 HWND hwndFrame,
                                 ULONG ulMenuId)
{
    /* Browse_O_MaticData *somThis = Browse_O_MaticGetData(somSelf); */
    Browse_O_MaticMethodDebug("Browse_O_Matic","Browse_O_Maticwps_wpMenuItemSelected");
    switch( ulMenuId ){
      case ID_OPEN_TEXT:
         _wpViewObject( somSelf, NULLHANDLE, ulMenuId, 0L );
         break;
      case ID_OPEN_HEX:
         _wpViewObject( somSelf, NULLHANDLE, ulMenuId, 0L );
         break;
      case ID_OPEN_PRODUCTINFO:
      case ID_PRODUCTINFOMENU:
         _wpViewObject( somSelf, NULLHANDLE, ulMenuId, 0L );

      default:
         return( parent_wpMenuItemSelected( somSelf, hwndFrame, ulMenuId) );
    }
    return( TRUE );
}

Related Methods