C# Class Sense.WinApi

Afficher le fichier Open project: MrWindows/MrWindows

Méthodes publiques

Méthode 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

Méthode 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 méthode

public static CreateScreenshot ( ) : Bitmap
Résultat System.Drawing.Bitmap

GetCursorPosition() public static méthode

public static GetCursorPosition ( ) : Point
Résultat Point

IsMouseLeftDown() public static méthode

public static IsMouseLeftDown ( ) : bool
Résultat bool

IsMouseLeftUp() public static méthode

public static IsMouseLeftUp ( ) : bool
Résultat bool

Logon() public static méthode

public static Logon ( ) : void
Résultat void

Logon2() public static méthode

public static Logon2 ( ) : void
Résultat void

ManagedSendKeys() public static méthode

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
Résultat void

ManagedSendKeys() public static méthode

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

ManagedSendKeys() public static méthode

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
Résultat void

MouseLeftClick() public static méthode

public static MouseLeftClick ( ) : void
Résultat void

MouseLeftDown() public static méthode

public static MouseLeftDown ( ) : void
Résultat void

MouseLeftUp() public static méthode

public static MouseLeftUp ( ) : void
Résultat void

MouseMiddleClick() public static méthode

public static MouseMiddleClick ( ) : void
Résultat void

MouseMove() public static méthode

public static MouseMove ( int x, int y ) : void
x int
y int
Résultat void

MouseRightClick() public static méthode

public static MouseRightClick ( ) : void
Résultat void

ScrollHorizontally() public static méthode

public static ScrollHorizontally ( int units ) : void
units int
Résultat void

ScrollVertically() public static méthode

public static ScrollVertically ( int units ) : void
units int
Résultat void

SendKeyboardEvent() public static méthode

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

SendKeyboardEventDown() public static méthode

public static SendKeyboardEventDown ( VirtualKey key ) : void
key VirtualKey
Résultat void

SendKeyboardEventUp() public static méthode

public static SendKeyboardEventUp ( VirtualKey key ) : void
key VirtualKey
Résultat void

WindowActivate() public static méthode

public static WindowActivate ( IntPtr handle ) : void
handle System.IntPtr
Résultat void

WindowActivate() public static méthode

public static WindowActivate ( string windowName ) : void
windowName string
Résultat void

WindowActive() public static méthode

public static WindowActive ( IntPtr myHandle ) : bool
myHandle System.IntPtr
Résultat bool

WindowActive() public static méthode

public static WindowActive ( string windowName ) : bool
windowName string
Résultat bool

WindowMove() public static méthode

public static WindowMove ( int x, int y, string windowName ) : void
x int
y int
windowName string
Résultat void

WindowMove() public static méthode

public static WindowMove ( int x, int y, string windowName, int width, int height ) : void
x int
y int
windowName string
width int
height int
Résultat void