65.9K
CodeProject is changing. Read more.
Home

Window API's

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.51/5 (55 votes)

Aug 27, 2006

CPOL

1 min read

viewsIcon

40393

downloadIcon

1244

Capture Screen , Block Mouse and Keyboard , System info , Get Caption , Check running Internet Explorer , All Running Windows , Capture Keyboards Inputs

 

API AND VC# DOT NET

It consists of four classes

  1. KeyboardHook
  2. PlatformInvokeGDI32
  3. Registry
  4. WindowAPI

 

These classes perform 6 functions

  1. Capture Screen
  2. Block Mouse and Keyboard
  3. System info
  4. Get Caption
  5. Check running Internet Explorer
  6. All Running Windows
  7. Capture Keyboards Inputs

 

CAPTURE SCREEN

Simple one line function to capture screen

 

ü      pbox.Image = Win32.WindowAPI.GetDesktopImage();

 

BLOCK MOUSE AND KEYBOARD

This function capture bool variable if u pass true its block key board and muse and false then unblock

 

 

ü      Win32.WindowAPI.BlockInput(true);

 

SYSTEM INFO

This function demads the SYSTEM_INFO structure that is declare in WindowAPI class so pass simple ref and enjoy system information

 

SYSTEM_INFO pSI = new SYSTEM_INFO();

 

ü      Win32.WindowAPI.GetSystemInfo(ref pSI);

 

public uint dwOemId;

public uint dwPageSize;

public uint lpMinimumApplicationAddress;

public uint lpMaximumApplicationAddress;

public uint dwActiveProcessorMask;

public uint dwNumberOfProcessors;

public uint dwProcessorType;

public uint dwAllocationGranularity;

public uint dwProcessorLevel;

           

GET CAPTION

Simple string return active window handler and name

 

ü      String str=Win32.WindowAPI.GetWindowHandle();

 

It also contains code that Monitors the windows inputs and Keyboard inputs Called this on form constructor

 

ü      kh = new KeyboardHook();

ü      kh.KeyDown+=new KeyEventHandler (frmactivewindow_ KeyDown);

 

and enjoy to capture key board input even u enter msn password(:>)

 

 

CHECK RUNNING (IE and Programmas)

It gets all running internet explorer u simple send a list box and enjoy all internet explorer

 

ü      WindowAPI.GetIExp(lstBox);

 

One more function it perform it close the running window u only List Box like

 

ü      Win32.WindowAPI.CloseIE(lstBox);