共用方式為


RECT Structure1

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at RECT Structure1.

The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle.

Syntax

typedef struct tagRECT {  
    LONG left;  
    LONG top;  
    LONG right;  
    LONG bottom;  
} RECT;  

Members

left
Specifies the x-coordinate of the upper-left corner of a rectangle.

top
Specifies the y-coordinate of the upper-left corner of a rectangle.

right
Specifies the x-coordinate of the lower-right corner of a rectangle.

bottom
Specifies the y-coordinate of the lower-right corner of a rectangle.

Example

      //Alternate ways to intialize a RECT structure:

      RECT rctA;
      rctA.left = 20;  
      rctA.top = 30;  
      rctA.right  = 180;  
      rctA.bottom = 230;

      RECT rctB = {20,30,180,230};   

Requirements

Header: windef.h

See Also

Structures, Styles, Callbacks, and Message Maps
CRect Class