Jump to content

WpFreeIconPosData: Difference between revisions

From EDM2
Created page with "{{DISPLAYTITLE:wpFreeIconPosData}} This method is specific to Version 4, or higher, of the OS/2 operating system. This instance method frees the .ICONPOS extended attribute (EA) information that is allocated by wpInitIconPosData. ==Syntax== _wpFreeIconPosData(somSelf) ==Parameters== ;''somSelf'' (WPFolder *) - input :Pointer to the object on which the method is being invoked. :Points to an object of class WPFolder. ==Returns== :There is no return value f..."
 
(No difference)

Latest revision as of 01:46, 17 November 2025

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

This instance method frees the .ICONPOS extended attribute (EA) information that is allocated by wpInitIconPosData.

Syntax

_wpFreeIconPosData(somSelf)

Parameters

somSelf (WPFolder *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPFolder.

Returns

There is no return value for this method.

How to Override

This method is not generally overridden.

Usage

You must call the **wpFreeIconPosData** method after you are finished using the icon position data that was loaded by calling the wpInitIconPosData method.

Example Code

#define INCL_WINWORKPLACE
#include <os2.h>

WPFolder *somSelf; /* Pointer to the object on which the method is being invoked. */

_wpFreeIconPosData(somSelf);

Remarks

This method frees memory that was allocated by the wpInitIconPosData method.

Example Code

This example shows how you can use the wpInitIconPosData, wpIdentify, wpQueryIconPosition, and **wpFreeIconPosData** methods to find the icon position information for all objects within a folder. In this example, *somSelf* contains the pointer to the folder being examined.

    BOOL       bSem;
    WPObject   *Object;
    CHAR       szIdentity[CCHMAXSTRING];
    POINTL     ptl;
    ULONG      ulIndex;

    /* Retrieve the icon position information for all objects within the
     * folder */
    _wpInitIconPosData(somSelf);

    /* Find the every object within the folder  */
    bSem = !_wpRequestObjectMutexSem(somSelf,SEM_INDEFINITE_WAIT);
    for (Object = _wpQueryContent(somSelf,NULL,QC_FIRST);
         Object;
         Object = _wpQueryContent(somSelf,Object,QC_NEXT));
    {

        /* For each object in the folder, find the position of its icon
         * in an Icon View of the folder  */
        if (_wpIdentify(Object,szIdentity))
        {
           if (_wpQueryIconPosition(somSelf,szIdentity,&ptl,&ulIndex))
           {
              /***** ptl contains the position of the icon for this object *****/
           }
        }
    }
    if (bSem)
    {
       _wpReleaseObjectMutexSem(somSelf);
    }

    /* Free the icon position data structure  */
    _wpFreeIconPosData(somSelf);

Related Methods