L_InetSendSetRectCmd

#include "l_bitmap.h"
#include "ltnet.h"

L_INT EXT_FUNCTION L_InetSendSetRectCmd(hComputer, uCommandID, uWindowID, nType, nLeft, nTop, nWidth, nHeight)

L_COMP hComputer;

/* handle to a remote computer */

L_UINT uCommandID;

/* command id */

L_UINTuWindowID;

/* window id */

RECTTYPE nType;

/* rectangle type */

L_INT nLeft;

/* horizontal position */

L_INT nTop;

/* vertical position */

L_INT nWidth;

/* width */

L_INT nHeight;

/* height */

Sends a set rectangle command to a remote computer.

Parameter

Description

hComputer

Handle of the remote computer to which the command will be sent.

uCommandID

Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.

uWindowID

The id of the window to receive the command.

nType

Type of rectangle to set. For possible values, refer to RECTTYPE.

nLeft

X coordinate of the origin of the display rectangle.

nTop

Y coordinate of the origin of the display rectangle.

nWidth

Width of the display rectangle.

nHeight

Height of the display rectangle.

Returns

SUCCESS

This function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The remote computer should respond by calling L_InetSendSetRectRsp in its INETCOMMANDCALLBACK function. This callback function must be set using L_InetSetCommandCallback.

The INETCOMMANDCALLBACK function will receive the uWindowID, nType, nLeft, nTop, nWidth and nHeight information in the pParams parameter. The uWindowID information will be in pParams[0]. The nType information will be in pParams[1], and so forth.

To receive responses to commands, provide an INETRESPONSECALLBACK function. This function must be set using L_InetSetResponseCallback.

This command is only beneficial to windows that have a bitmap associated with them.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_InetSendSetRectRsp, INETRESPONSECALLBACK, INETCOMMANDCALLBACK

Topics:

Sending Commands and Responses

 

A Client-Server Diagram: Sending Commands and Responses

Example

L_UINT guCommandID;

// Note that pszRemoteFilename is a file name on the remote computer!
L_INT FitToRect(L_COMP hComputer, L_UINT uWindowID, LPRECT pRect)
{
   return L_InetSendSetRectCmd(hComputer, guCommandID++, uWindowID, RECT_DSTALL, pRect->left, pRect->top, pRect->right – pRect->left, pRect->bottom – pRect->top);
}

//**********  Code on the remote computer ****************/
L_INT SetWindowRect(HWND hwnd, CMDTYPE cmdType, L_INT nLeft, L_INT nTop, L_INT nWidth, L_INT nHeight)
{
   // Set the window rectangle for painting here...
}

L_INT EXT_CALLBACK InetCommandCallback(L_COMP hComputer, CMDTYPE uCommand, L_UINT uCommandID,  L_INT  nError, L_UINT uParams, pPARAMETER  pParams, L_UINT uExtra, L_CHAR L_FAR *pExtra, L_VOID L_FAR *pUserData)
{
   L_INT nStatus = ERROR_FEATURE_NOT_SUPPORTED;

   if(nError != SUCCESS)
      nStatus = ERROR_TRANSFER_ABORTED;
   else
      switch(uCommand)
      {
         case CMD_SET_RECT:
            // check the validity of the parameters
            if(uParams == 6 && pParams[0].uType == PARAM_UINT32 && pParams[1].uType == PARAM_INT32 && pParams[2].uType == PARAM_INT32 && pParams[3].uType == PARAM_INT32 && pParams[4].uType == PARAM_INT32 && pParams[5].uType == PARAM_INT32)
            {
               nStatus = SetWindowRect((HWND)pParams[0].pValue, (CMDTYPE)pParams[1].iValue, pParams[2].iValue, pParams[3].iValue, pParams[4].iValue, pParams[5].iValue);
            }
            else
               nStatus = ERROR_INV_PARAMETER; // invalid parameters
            return L_InetSendSetRectRsp(hComputer, uCommandID, 0, NULL, nStatus);
      }

   return L_InetSendRsp(hComputer, uCommand, uCommandID, NULL, nStatus);
}