C# Class Sense.WinApi

Datei anzeigen Open project: MrWindows/MrWindows

Public Methods

Method Description
CreateScreenshot ( ) : Bitmap
GetCursorPosition ( ) : Point
IsMouseLeftDown ( ) : bool
IsMouseLeftUp ( ) : bool
Logon ( ) : void
Logon2 ( ) : void
ManagedSendKeys ( string keys ) : void

simulates a keypress, see http://msdn2.microsoft.com/en-us/library/system.windows.forms.sendkeys(VS.71).aspx no winapi but this works just fine for me

ManagedSendKeys ( string keys, IntPtr handle ) : void

sends a keystring to a window

ManagedSendKeys ( string keys, string windowName ) : void

checks if the correct window is active, then send keypress

MouseLeftClick ( ) : void
MouseLeftDown ( ) : void
MouseLeftUp ( ) : void
MouseMiddleClick ( ) : void
MouseMove ( int x, int y ) : void
MouseRightClick ( ) : void
ScrollHorizontally ( int units ) : void
ScrollVertically ( int units ) : void
SendKeyboardEvent ( Keys key, int delay ) : void

sends a key to a window, pressing the button for x seconds

SendKeyboardEventDown ( VirtualKey key ) : void
SendKeyboardEventUp ( VirtualKey key ) : void
WindowActivate ( IntPtr handle ) : void
WindowActivate ( string windowName ) : void
WindowActive ( IntPtr myHandle ) : bool
WindowActive ( string windowName ) : bool
WindowMove ( int x, int y, string windowName ) : void
WindowMove ( int x, int y, string windowName, int width, int height ) : void

Private Methods

Method Description
BitBlt ( IntPtr hObject, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hObjectSource, int nXSrc, int nYSrc, int dwRop ) : bool
CreateCompatibleBitmap ( IntPtr hDC, int nWidth, int nHeight ) : IntPtr
CreateCompatibleDC ( IntPtr hDC ) : IntPtr
DeleteDC ( IntPtr hDC ) : bool
DeleteObject ( IntPtr hObject ) : bool
DuplicateToken ( IntPtr ExistingTokenHandle, int SECURITY_IMPERSONATION_LEVEL, IntPtr &DuplicateTokenHandle ) : bool
FindWindow ( string lpClassName, string lpWindowName ) : IntPtr
FindWindowEx ( IntPtr hwndParent, IntPtr hwndChildAfter, String lpszClass, String lpszWindow ) : IntPtr
GetCursorPos ( POINT &lpPoint ) : bool
GetDesktopWindow ( ) : IntPtr
GetForegroundWindow ( ) : IntPtr
GetKeyState ( VirtualKey nVirtKey ) : short
GetWindowDC ( IntPtr hWnd ) : IntPtr
GetWindowRect ( IntPtr hWnd, System.Windows.Forms.RECT &rect ) : IntPtr
LockWorkStation ( ) : void
LogonUser ( string lpszUsername, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, IntPtr &phToken ) : bool
MoveWindow ( IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint ) : bool
ReleaseDC ( IntPtr hWnd, IntPtr hDC ) : IntPtr
SelectObject ( IntPtr hDC, IntPtr hObject ) : IntPtr
SendMessage ( IntPtr hwnd, MsgType uMsg, int wParam, int lParam ) : bool
SetCursorPos ( int x, int y ) : int
SetForegroundWindow ( IntPtr hWnd ) : bool
keybd_event ( byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo ) : void
mouse_event ( uint dwFlags, uint dx, uint dy, uint dwData, int dwExtraInfo ) : void

Method Details

CreateScreenshot() public static method

public static CreateScreenshot ( ) : Bitmap
return System.Drawing.Bitmap

GetCursorPosition() public static method

public static GetCursorPosition ( ) : Point
return Point

IsMouseLeftDown() public static method

public static IsMouseLeftDown ( ) : bool
return bool

IsMouseLeftUp() public static method

public static IsMouseLeftUp ( ) : bool
return bool

Logon() public static method

public static Logon ( ) : void
return void

Logon2() public static method

public static Logon2 ( ) : void
return void

ManagedSendKeys() public static method

simulates a keypress, see http://msdn2.microsoft.com/en-us/library/system.windows.forms.sendkeys(VS.71).aspx no winapi but this works just fine for me
public static ManagedSendKeys ( string keys ) : void
keys string the keys to press
return void

ManagedSendKeys() public static method

sends a keystring to a window
public static ManagedSendKeys ( string keys, IntPtr handle ) : void
keys string
handle System.IntPtr
return void

ManagedSendKeys() public static method

checks if the correct window is active, then send keypress
public static ManagedSendKeys ( string keys, string windowName ) : void
keys string keys to press
windowName string window to send the keys to
return void

MouseLeftClick() public static method

public static MouseLeftClick ( ) : void
return void

MouseLeftDown() public static method

public static MouseLeftDown ( ) : void
return void

MouseLeftUp() public static method

public static MouseLeftUp ( ) : void
return void

MouseMiddleClick() public static method

public static MouseMiddleClick ( ) : void
return void

MouseMove() public static method

public static MouseMove ( int x, int y ) : void
x int
y int
return void

MouseRightClick() public static method

public static MouseRightClick ( ) : void
return void

ScrollHorizontally() public static method

public static ScrollHorizontally ( int units ) : void
units int
return void

ScrollVertically() public static method

public static ScrollVertically ( int units ) : void
units int
return void

SendKeyboardEvent() public static method

sends a key to a window, pressing the button for x seconds
public static SendKeyboardEvent ( Keys key, int delay ) : void
key Keys
delay int
return void

SendKeyboardEventDown() public static method

public static SendKeyboardEventDown ( VirtualKey key ) : void
key VirtualKey
return void

SendKeyboardEventUp() public static method

public static SendKeyboardEventUp ( VirtualKey key ) : void
key VirtualKey
return void

WindowActivate() public static method

public static WindowActivate ( IntPtr handle ) : void
handle System.IntPtr
return void

WindowActivate() public static method

public static WindowActivate ( string windowName ) : void
windowName string
return void

WindowActive() public static method

public static WindowActive ( IntPtr myHandle ) : bool
myHandle System.IntPtr
return bool

WindowActive() public static method

public static WindowActive ( string windowName ) : bool
windowName string
return bool

WindowMove() public static method

public static WindowMove ( int x, int y, string windowName ) : void
x int
y int
windowName string
return void

WindowMove() public static method

public static WindowMove ( int x, int y, string windowName, int width, int height ) : void
x int
y int
windowName string
width int
height int
return void