Share via


_WMoveP( ) API Library Routine

Moves the specified window to a new location specified by pt.

void _WMoveP(WHANDLE wh, Point pt)
WHANDLE wh;            /* Window handle. */
Point pt;                     /* New location. */

Remarks

The pt parameter specifies the location of the upper-left corner of the window in pixels. The new position can place the window partially or completely off the screen.

For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.

Example

The following example moves the active window diagonally 40 pixels down and 40 pixels to the right.

Visual FoxPro Code

SET LIBRARY TO WMOVEP 
=WMOVEP()

C Code

#include <pro_ext.h>

void FAR WMovePEx(ParamBlk FAR *parm)
{
   WHANDLE wh = _WOnTop();
   Point newPos;

   newPos.v = _WTopP(wh)  + 40;
   newPos.h = _WLeftP(wh) + 40;

   _WMoveP(wh, newPos);
}

FoxInfo myFoxInfo[] = {
   {"WMOVEP", WMovePEx, 0, ""},
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

See Also

_WSizeP( ) API Library Routine | Accessing the Visual FoxPro API | _MemMove( ) API Library Routine | MOVE WINDOW Command | Accessing the Visual FoxPro API