ImpelClass Library Documentation
Win32Automation Class
NamespacesImpelWin32Automation
Impel
Provides methods for test automation that are based on windows libraries.
Declaration Syntax
C#Visual BasicVisual C++
public class Win32Automation
Public Class Win32Automation
public ref class Win32Automation
Members
All MembersConstructorsMethodsFields



IconMemberDescription
Win32Automation()()()
ActivateMenuItem(IntPtr, Int32)
Sends the command message to a menu item (thus selecting or expanding)

BringWindowToTop(IntPtr)
The BringWindowToTop function brings the specified window to the top of the Z order. If the window is a top-level window, it is activated. If the window is a child window, the top-level parent window associated with the child window is activated.

CaptureControl(Control)
Captures a screenshot of the specified control.

CaptureCords(Int32, Int32, Int32, Int32)
Creates an Image object containing a screen shot of a specific area of the desktop.

CaptureScreen()()()
Creates an Image object containing a screen shot of the entire desktop

CaptureWindow(IntPtr)
Creates an Image object containing a screen shot of a specific window

ChildWindowFromPoint(IntPtr, Win32Automation..::.POINT)
http://msdn.microsoft.com/en-us/library/ms632676(VS.85).aspx

Click(Control)
Sends a left mouse button click message to the control.

ClickOn(IntPtr)
Sends a left mouse button click message to the handle's control.

ClickOnCords(IntPtr, Int32, Int32)
Sends a left mouse button click message to the handle's control at the specified Cords within the control.

ClickOnCordsPost(IntPtr, Int32, Int32)
Sends a click message. Does not wait for it to be processed.

ClickOnCordsSend(IntPtr, Int32, Int32)
Sends a click message. Waits for it to be processed.

ClickOnPost(IntPtr)
Clicks on an object. (does not wait for the click to be processed)

CloseWindow(IntPtr)
Sends the close message to a window.

CloseWindowPost(IntPtr)
Sends the close message to a window and does not wait for the message to be processed.

CompareBitmaps(Bitmap, String)
Checks to see if two images are equal

CompareBitmaps(Bitmap, Bitmap)
Checks to see if two images are equal

ContainsText(IntPtr, String)
Determines if the a window (or control) contains specific text.

CreateCursor(String)
Creates a Cursor object from a .ani or .cur file.

CtrlClickOnCords(IntPtr, Int32, Int32)
Sends a left mouse button click message to the handle's control at the specified Cords within the control.

DestroyWindow(IntPtr)
The DestroyWindow function destroys the specified window. The function sends WM_DESTROY and WM_NCDESTROY messages to the window to deactivate it and remove the keyboard focus from it. The function also destroys the window's menu, flushes the thread message queue, destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if the window is at the top of the viewer chain). If the specified window is a parent or owner window, DestroyWindow automatically destroys the associated child or owned windows when it destroys the parent or owner window. The function first destroys child or owned windows, and then it destroys the parent or owner window. DestroyWindow also destroys modeless dialog boxes created by the CreateDialog function.

DoesWindowExist(IntPtr)
Used to detect if a handle to a top level window is still present.

DoubleClick(Control)
Sends a left mouse button double click message to the control.

DoubleClickOn(IntPtr)
Sends a left mouse button double click message to the handle's control.

DoubleClickOnCords(IntPtr, Int32, Int32)
Sends a left mouse button double click message to the handle's control at the specified Cords within the control.

DoubleRightClick(Control)
Sends a right mouse button double click message to the control.

DoubleRightClickOn(IntPtr)
Sends a right mouse button double click message to the handle's control.

DoubleRightClickOnCords(IntPtr, Int32, Int32)
Sends a right mouse button double click message to the handle's control at the specified Cords within the control.

EnumChildWindows(IntPtr, Win32Automation..::.EnumWindowProc, IntPtr)
http://msdn.microsoft.com/en-us/library/ms633494(VS.85).aspx

Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Finalize()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Find(IntPtr, String)
Uses a finder string to locate an object.

Find(IntPtr, String, Int32)
Uses a finder string to locate an object.

Find(Control, String, Int32)
Uses a finder string to locate an object.

FindMenu(IntPtr)

FindScriptingFixtureDescription(IntPtr)
Recommends a finder string for a Win32 object.

FindTopLevelWindow(String)
Finds a window with the specified caption.

FindTopLevelWindowTimeout(String, Int32)
Waits a specified number of seconds for a window to appear.

FindWindow(String, String)
The FindWindow function retrieves a handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows. This function does not perform a case-sensitive search. To search child windows, beginning with a specified child window, use the FindWindowEx function.

FindWindowByIndex(IntPtr, Int32)
Use this method to find controls that do not have specific text values or a unique name. The index is usually determined by the order that controls were added to the parent form.

FindWindowEx(IntPtr, IntPtr, String, String)
The FindWindowEx function retrieves a handle to a window whose class name and window name match the specified strings. The function searches child windows, beginning with the one following the specified child window. This function does not perform a case-sensitive search.

FindWindowRegex(String)
Locates a top level window whose title matches the given regular expression.

FindWindowRegex(String, Int32)
Locates a top level window whose title matches the given regular expression.

GetApplication(IntPtr)
Returns the name of the process/program that the window is running under.

GetApplicationWorkingDir(IntPtr)
Returns the working directory for a running application.

GetBitmapHash(IntPtr, Int32, Int32, Int32, Int32)
Creates a bitmap checksum hash of a region of an object

GetBitmapHash(IntPtr)
Generates a checksum hash for a bitmap of the given object.

GetChildWindows(IntPtr)
Returns a list of child windows

GetCursorPoint()()()
Retrieves the cursor's position, in screen coordinates.

GetDesktopWindow()()()
http://msdn.microsoft.com/en-us/library/ms633504(VS.85).aspx

GetFirstParentThatIsA(IntPtr, String)
Locates the first ancestor in the Win32 Parent tree that has a specific Win32 class name.

GetHashCode()()()
Serves as a hash function for a particular type. GetHashCode()()() is suitable for use in hashing algorithms and data structures like a hash table.
(Inherited from Object.)
GetMenu(IntPtr)
The GetMenu function retrieves a handle to the menu assigned to the specified window.

GetMenuInfo(IntPtr)
http://msdn.microsoft.com/en-us/library/ms647977(VS.85).aspx

GetMenuItemCount(IntPtr)
http://msdn.microsoft.com/en-us/library/ms647978(VS.85).aspx

GetMenuItemID(IntPtr, Int32)
http://msdn.microsoft.com/en-us/library/ms647979(VS.85).aspx

GetParent(IntPtr)
The GetParent function retrieves a handle to the specified window's parent or owner. To retrieve a handle to a specified ancestor, use the GetAncestor function.

GetSubMenu(IntPtr, Int32)
http://msdn.microsoft.com/en-us/library/ms647984(VS.85).aspx

GetType()()()
Gets the Type of the current instance.
(Inherited from Object.)
GetWin32ClassName(IntPtr)
Returns the windows (Not .Net) class name for a window.

GetWindowInfo(IntPtr)
Wrapper for user32 GetWindowInfo method.

GetWindowText(IntPtr)
Returns the result of sending a WM_GETTEXT message to a control/window.

GetWindowText2(IntPtr)
Returns the result of calling the user32 GetWindowText method on a control/window.

HighlightWindow(IntPtr)
Draws a rectangle around the specified window.

HighlightWindowRegion(IntPtr, Int32, Int32, Int32, Int32)
Draws a rectangle within a control.

IsChildOfA(IntPtr, String)
Determines if the object is a child of an ancestor with the given class name.

IsMenu(IntPtr)
The IsMenu function determines whether a handle is a menu handle.

IsWindowVisible(IntPtr)
Determines whether or not a window/control is visible to the user.

lastWindowText
Stores the result of the last GetWindowText call. (so it can be accessed in thread critical areas)

LocateBitmap(String)
Attempts to locate an image on the desktop.

LocateBitmap(Bitmap)
Attempts to locate an image on the desktop.

makeDWord(UInt16, UInt16)
Used to turn mouse coordinates into appropriate date type for sending in a windows message.

MaximizeWindow(IntPtr)
Sends the maximize window message to the window owned by the specified handle.

MemberwiseClone()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
MiddleClick(Control)
Sends a middle mouse button click message to the control.

MiddleClickOn(IntPtr)
Sends a middle mouse button double click message to the handle's control.

MiddleClickOnCords(IntPtr, Int32, Int32)
Sends a midle mouse button click message to the handle's control at the specified Cords within the control.

MinimizeAllWindows()()()
Will minimize all windows on the desktop.

MinimizeWindow(IntPtr)
Sends the restore minimize message to the window owned by the specified handle.

MoveMouse(Int32, Int32)
Moves mouse cursor to specified position on screen.

MoveWindowTo(IntPtr, Int32, Int32)
Wrapper for user32 MoveWindow function. Just sets the window's x,y position.

raw(String)
Converts a string to raw character codes by converting newlines, tabs, etc... to their character code combinations (\r,\n,\t, etc...)

RealChildWindowFromPoint(IntPtr, Win32Automation..::.POINT)
http://msdn.microsoft.com/en-us/library/ms633537(VS.85).aspx

RecommendVarNameFor(Control)
Recommends a variable name for a control.

RecommendVarNameFor(IntPtr)
Recommends a variable name to use for an object.

RestoreWindow(IntPtr)
Sends the restore window message to the window owned by the specified handle.

RightClick(Control)
Sends a right mouse button click message to the control.

RightClickOn(IntPtr)
Sends a right mouse button double click message to the handle's control.

RightClickOnCords(IntPtr, Int32, Int32)
Sends a right mouse button click message to the handle's control at the specified Cords within the control.

RightClickOnCordsPost(IntPtr, Int32, Int32)
Performs a right click on an object (and does not wait for the click to be processed)

SanitizeForClassName(String)
Cleans a string so that it can be used as a class name in a scripting language.

SanitizeForVariableName(String)
Cleans a string so that it can be used as a variable name in a scripting language.

SaveBitmapToFile(Bitmap, String)
Saves a bitmap object to the specified file (as a .bmp)

SC_CLOSE
Message to close a window.

Scroll(IntPtr, Win32Automation..::.ScrollDirections, Win32Automation..::.ScrollOptions)
Scrolls the control.

SendChar(IntPtr, Char)
Sends a character to a window/control.

SendCharPost(IntPtr, Char)
Sends a single character to a window/control. (and does not wait for them to be processed)

SendChars(IntPtr, String)
Sends a string to a window/control.

SendCharsPost(IntPtr, String)
Sends a string to a window/control. (and does not wait for them to be processed)

SetActiveWindow(IntPtr)
The SetActiveWindow function activates a window. The window must be attached to the calling thread's message queue.

SetFocus(IntPtr)
Changes the size, position, and Z order of a child, pop-up, or top-level window. These windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the Z order.

SetForegroundIfForm(IntPtr)
Brings the item to the foreground if it is a .NET Form object.

SetForegroundWindow(IntPtr)
The SetForegroundWindow function puts the thread that created the specified window into the foreground and activates the window. Keyboard input is directed to the window, and various visual cues are changed for the user. The system assigns a slightly higher priority to the thread that created the foreground window than it does to other threads.

ShowBitmap(Bitmap)
Displays an image in a PictureBox

ShowWindow(IntPtr, Int32)
The ShowWindow function sets the specified window's show state.

SizeWindowTo(IntPtr, Int32, Int32)
Wrapper for user32 MoveWindow function. Just sets the window's width/height.

Sleep(Int32)
Pauses execution.

StartSystemCommand(String)
Executes a system command (returns immediately)

ToString()()()
Returns a String that represents the current Object.
(Inherited from Object.)
varNameCounter
Used for objects where unique variable names cannot be identified.

WindowFromPoint(Win32Automation..::.POINT)
Returns the handle to the window that is under a specific location.

WindowRect(IntPtr)
C# friendly version of GetWindowRect: http://msdn.microsoft.com/en-us/library/ms633519(VS.85).aspx

WM_COMMAND
Specification of WM_COMMAND message - 0x111

WM_SYSCOMMAND
This message is sent to a window when the user chooses a command from the window menu, formerly known as the system or control menu, or when the user chooses the maximize button or the minimize button.

Inheritance Hierarchy
Object
Win32Automation

Assembly: Impel.Win32Automation (Module: Impel.Win32Automation) Version: 1.0.0.0 (1.0.0.0)