- E -


Ellipse Function

Declare Function Ellipse Lib "gdi32.dll" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

Ellipse draws an ellipse on a graphical object. The two coordinates passed to the function are not actually a part of the ellipse itself! Imagine the smallest possible rectangular box containing the ellipse. X1 and Y1 are the coordinates of the upper-left corner, and X2 and Y2 are the coordinates of the lower-right corner. The ellipse is drawn with the color of the object's ForeColor property. You can safely ignore the error code returned.
hdcThe device context of the object.
X1The x coordinate of the imaginary box's upper-left corner.
Y1The y coordinate of the imaginary box's upper-left corner.
X2The x coordinate of the imaginary box's lower-right corner.
Y2The y coordinate of the imaginary box's lower-right corner.
Example:
  'Draw a red ellipse
  Picture1.ForeColor = RGB(255, 0, 0) 'red
  x = Ellipse(Picture1.hdc, 25, 25, 75, 50)


Category: Graphics
Back to the index.


EqualRect Function

Declare Function EqualRect Lib "user32.dll" (lpRect1 As RECT, lpRect2 As RECT) As Long

EqualRect determines if two RECT-type variables are equal. Rectangles are considered equal if and only if the .Left, .Top, .Right, and .Bottom properties of one equal the .Left, .Top, .Right, and .Bottom properties of the other. In other words, they are equal if they identify exactly the same rectangle. The function returns 1 if the rectangles are equal and 0 if the rectangles are unequal.
lpRect1The first of the two rectangles to check.
lpRect2The second of the two rectangles to check.
Example:
  'Check to see if the rectangles are equal
  'This example uses the SetRect API function to set the values of a RECT
  Dim r As RECT, s As RECT
  x = SetRect(r, 50, 50, 150, 150) 'Set r.Left, .Top, .Right, .Bottom
  x = SetRect(s, 50, 50, 150, 150) 'Set s the same way
  Form1.Print EqualRect(r, s) 'returns 1 -- they are equal
  x = SetRect(s, 100, 100, 200, 200) 'Set s to this
  Form1.Print EqualRect(r, s) 'returns 0 -- they are unequal


Related Call: CopyRect
Category: RECT Manipulation
Back to the index.


ExitWindowsEx Function

Declare Function ExitWindowsEx Lib "user32.dll" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long

ExitWindowsEx allows you to easily reboot or even shut down the user's computer. Its commands have basically the same effect as the Shut Down option on the Start Menu do, only no prompt appears. Of course, the computer will shut down or reboot immediately, so don't expect you program to continue running after you execute the function. The function returns an error code that you can safely ignore.
uFlagsExactly one of the Exit Windows flags that tell the function what to do.
dwReservedReserved for future versions of Windows. Always set to 0.
Example:
  'This code will reboot the user's computer.
  x = ExitWindowsEx(EWX_REBOOT, 0)


Category: Miscellaneous/Uncategorized
Back to the index.


Home
Paul Kuliniewicz
E-mail: Borg953@aol.com
All material presented on these pages is Copyright © Paul Kuliniewicz, except for other copyrighted material.
http://members.aol.com/Borg953/api/e.html