Jump to content

WpAddPowerPage: Difference between revisions

From EDM2
Created page with "{{DISPLAYTITLE:wpAddPowerPage}} This method is specific to version 2.1, or higher, of the OS/2 operating system. This instance method adds the ''Standard Power'' page to the Settings notebook of the power object. ==Syntax== <PRE> #define INCL_WINWORKPLACE #include <os2.h> WPPower *somSelf; Pointer to the object on which the method is being invoked.: HWND hwndNotebook; Settings notebook handle.: ULONG rc; /* Page identif..."
 
No edit summary
Line 5: Line 5:


==Syntax==
==Syntax==
<PRE>
  _wpAddPowerPage(somSelf, hwndNotebook)
#define INCL_WINWORKPLACE
#include <os2.h>
 
WPPower      *somSelf;        /* Pointer to the object on which the method is being invoked. */
HWND        hwndNotebook; /* Settings notebook handle. */
ULONG        rc;            /* Page identifier. */
 
rc = _wpAddPowerPage(somSelf, hwndNotebook);
</PRE>


==Parameters==
==Parameters==
Line 30: Line 21:
::PageId: Identifier for the inserted page.
::PageId: Identifier for the inserted page.


==Related Methods==
==Example Code==
* [[wpAddPowerPage]]
Declaration:
* [[wpAddPowerViewPage]]
<PRE>
* [[wpChangePowerState]]
#define INCL_WINWORKPLACE
* [[wpQueryAutoRefresh]]
#include <os2.h>
* [[wpQueryPowerConfirmation]]
 
* [[wpQueryPowerManagement]]
WPPower      *somSelf;        /* Pointer to the object on which the method is being invoked. */
* [[wpQueryRefreshRate]]
HWND        hwndNotebook;  /* Settings notebook handle. */
* [[wpSetAutoRefresh]]
ULONG        rc;            /* Page identifier. */
* [[wpSetPowerConfirmation]]
* [[wpSetPowerManagement]]
* [[wpSetRefreshRate]]


==Example Code==
rc = _wpAddPowerPage(somSelf, hwndNotebook);
</PRE>
This example overrides this method to eliminate this page from the object's settings.
This example overrides this method to eliminate this page from the object's settings.
<PRE>
<PRE>
Line 57: Line 46:
}
}
</PRE>
</PRE>
==Related Methods==
* [[wpAddPowerPage]]
* [[wpAddPowerViewPage]]
* [[wpChangePowerState]]
* [[wpQueryAutoRefresh]]
* [[wpQueryPowerConfirmation]]
* [[wpQueryPowerManagement]]
* [[wpQueryRefreshRate]]
* [[wpSetAutoRefresh]]
* [[wpSetPowerConfirmation]]
* [[wpSetPowerManagement]]
* [[wpSetRefreshRate]]


[[Category:Workplace Instance Methods]]
[[Category:Workplace Instance Methods]]

Revision as of 22:00, 1 September 2025

This method is specific to version 2.1, or higher, of the OS/2 operating system.

This instance method adds the Standard Power page to the Settings notebook of the power object.

Syntax

_wpAddPowerPage(somSelf, hwndNotebook)

Parameters

somSelf (WPPower *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPPower.
hwndNotebook (HWND) - input
Settings notebook handle.

Returns

rc (ULONG) - returns
Page identifier.
0: Error occurred
PageId: Identifier for the inserted page.

Example Code

Declaration:

#define INCL_WINWORKPLACE
#include <os2.h>

WPPower      *somSelf;        /* Pointer to the object on which the method is being invoked. */
HWND         hwndNotebook;  /* Settings notebook handle. */
ULONG        rc;            /* Page identifier. */

rc = _wpAddPowerPage(somSelf, hwndNotebook);

This example overrides this method to eliminate this page from the object's settings.

SOM_Scope ULONG    SOMLINK MyObj_wpAddPowerPage(MyObj *somSelf,
                        HWND hwndNotebook)
{
    /* MyObjData *somThis = MyObjGetData(somSelf); */
    MyObjMethodDebug("MyObj","MyObj_wpAddPowerPage");

/* return (parent_wpAddPowerPage(somSelf,hwndNotebook)); */

    return ( SETTINGS_PAGE_REMOVED );
}

Related Methods