JavaScript Editor js editor     Web development 

Main Page

Creates a new window at the positions specified by the top, left, bottom, and right parameters.

WHANDLE _WOpenP(int top, int left, int bottom, int right, int flag, 
         int scheme_num, Scheme FAR *scheme, char FAR *bord)
int top;                     /* Top coordinate in pixels. */
int left;                     /* Left coordinate in pixels. */
int bottom;                  /* Bottom coordinate in pixels. */
int right;                     /* Right coordinate in pixels. */
int flag;                     /* Attributes. */
int scheme_num;            /* Color scheme. */
Scheme FAR *scheme;      /* Points to color scheme to use. */
char FAR *bord;            /* Border type. */


The window positions may be off the screen. Additional memory is allocated to hold the off-screen image of this window.

The flag parameter determines the attributes for this window. The flag may be one or more of the flag values in the table below. You can combine multiple flag values using the C | or + operator. Typical window borders are defined in PRO_EXT.H.

flag Value Window attribute


The insertion point may be displayed in this window.


The user may zoom the window.


The user may adjust the size of the window.


The user may close the window.


The user may move the window.


The window scrolls when output rolls off the bottom line.


The window receives, activates, and deactivates events.


The window casts a shadow.


The user can't send this window to the back.


The user can minimize this window.

The scheme_num may be any valid color scheme number, or – 1 to indicate that the scheme parameter points to the color scheme to use.

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


The following example creates windows using a number of different color schemes and borders. In particular, note the custom color scheme.

Visual FoxPro Code

В Copy Code

C Code

В Copy Code
#include <pro_ext.h>

FAR Example(ParamBlk FAR *parm)
   WHANDLE wh;

   char customScheme[12] =
      BLACK_ON      | WHITE,
      RED_ON      | BLACK      | BLINK,
      WHITE_ON      | WHITE      | BRIGHT,
      CYAN_ON      | BLUE      | BRIGHT,
      GREEN_ON      | BROWN,
      BROWN_ON      | BROWN      | BRIGHT,
      RED_ON      | MAGENTA   | BRIGHT | BLINK,
      BROWN_ON      | GREEN      | BRIGHT,
      BLACK_ON      | CYAN,
      BLUE_ON      | CYAN,

   _Execute("WAIT WINDOW 'Press any key to see a window \
      in WINDOW_SCHEME with WO_DOUBLEBOX border'");

   wh = _WOpenP(10, 10, 160, 320, WEVENT | CLOSE, WINDOW_SCHEME,
      (Scheme FAR *)0, WO_DOUBLEBOX);

   _Execute("WAIT WINDOW 'Press any key to see a window \
      in ALERT_SCHEME with WO_SINGLEBOX border'");

   wh = _WOpenP(10, 10, 160, 320, WEVENT | CLOSE, ALERT_SCHEME,
      (Scheme FAR *)0, WO_SINGLEBOX);

   _Execute("WAIT WINDOW 'Press any key to see a window \
      in WINDOW_SCHEME with WO_PANELBORDER border'");

   wh = _WOpenP(10, 10, 160, 320, WEVENT | CLOSE, WINDOW_SCHEME,
      (Scheme FAR *)0, WO_PANELBORDER);

   _Execute("WAIT WINDOW 'Press any key to see a window \
      in a custom scheme with WO_SYSTEMBORDER border'");

   wh = _WOpenP(10,10,160,320,WEVENT | CLOSE,-1,customScheme,

FoxInfo myFoxInfo[] = {
   {"ONLOAD", Example, CALLONLOAD, ""},
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo

See Also

JavaScript Editor js editor     Web development