The wpRegisterView method should be called whenever a new view of an object is created. Registering a view will set the title of the frame window to the object's title and add the view title as the current view in the window list. The wpRegisterView method is used to allow an object to register a new open view. The following shows the syntax of wpRegisterView:
#define INCL_WINWORKPLACE #include <os2.h> BOOL wpRegisterView (WPObject *self, HWND hwndFrame, PSZ pszViewTitle)
The self (WPObject *) parameter is the pointer to the object on which the method is being invoked. It points to an object of class WPObject.
The hwndFrame (HWND) parameter is the handle of the frame window containing the new view.
The pszViewTitle (PSZ) parameter is the pointer to a string containing the name of the view.
The rc (BOOL) parameter is returned with one of the following values:
Boolean
Registering a view will set the object title as the title of the frame window and add a view title as the current view in the window list and titlebar. The following figure shows how to register a new open view of an object:
WPObject *self;HWND hwndFrame; PSZ pszViewTitle="OS/2 Programs - Icon View"; _wpRegisterView(self, hwndFrame, pszViewTitle);