Package winappdbg :: Package win32 :: Module user32 :: Class Rect
[hide private]
[frames] | no frames]

Class Rect

source code


Python wrapper over the RECT class.

Instance Methods [hide private]
 
__init__(self, left=0, top=0, right=0, bottom=0)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__iter__(self) source code
 
__len__(self) source code
 
__getitem__(self, index) source code
 
__setitem__(self, index, value) source code
 
__get_width(self) source code
 
__get_height(self) source code
 
__set_width(self, value) source code
 
__set_height(self, value) source code
Rect
screen_to_client(self, hWnd)
Translates window screen coordinates to client coordinates.
source code
Rect
client_to_screen(self, hWnd)
Translates window client coordinates to screen coordinates.
source code
Rect
translate(self, hWndFrom=0, hWndTo=0)
Translate coordinates from one window to another.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
int width
Width in pixels.
int height
Height in pixels.
int bottom
Vertical coordinate for the bottom right corner.
int left
Horizontal coordinate for the top left corner.
int right
Horizontal coordinate for the bottom right corner.
int top
Vertical coordinate for the top left corner.
Properties [hide private]
  _as_parameter_
Compatibility with ctypes.

Inherited from object: __class__

Method Details [hide private]

__init__(self, left=0, top=0, right=0, bottom=0)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • left (int) - Horizontal coordinate for the top left corner.
  • top (int) - Vertical coordinate for the top left corner.
  • right (int) - Horizontal coordinate for the bottom right corner.
  • bottom (int) - Vertical coordinate for the bottom right corner.
Overrides: object.__init__

See Also: RECT

screen_to_client(self, hWnd)

source code 

Translates window screen coordinates to client coordinates.

Parameters:
Returns: Rect
New object containing the translated coordinates.

client_to_screen(self, hWnd)

source code 

Translates window client coordinates to screen coordinates.

Parameters:
Returns: Rect
New object containing the translated coordinates.

translate(self, hWndFrom=0, hWndTo=0)

source code 

Translate coordinates from one window to another.

Parameters:
  • hWndFrom (int or HWND or system.Window) - Window handle to translate from. Use HWND_DESKTOP for screen coordinates.
  • hWndTo (int or HWND or system.Window) - Window handle to translate to. Use HWND_DESKTOP for screen coordinates.
Returns: Rect
New object containing the translated coordinates.

Instance Variable Details [hide private]

width

Width in pixels. Same as right - left.
Get Method:
__get_width(self)
Set Method:
__set_width(self, value)

height

Height in pixels. Same as bottom - top.
Get Method:
__get_height(self)
Set Method:
__set_height(self, value)

Property Details [hide private]

_as_parameter_

Compatibility with ctypes. Allows passing transparently a Point object to an API call.

Get Method:
unreachable._as_parameter_(self) - Compatibility with ctypes.