Click here to Skip to main content
Licence CPOL
First Posted 26 Aug 2006
Views 29,409
Bookmarked 35 times

Window API's

By | 17 Jan 2007 | Article
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);

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Muhammad Adeel Malik

Web Developer

Pakistan Pakistan

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Generaltanks Pinmembersuvers13:18 18 Apr '07  
GeneralSO SO nice PinmemberAla'a Dwekat11:06 19 Feb '07  
GeneralRe: SO SO nice PinmemberMuhammad Adeel Malik4:11 20 Feb '07  
QuestionWhy don't you application cannot run in my Computer? Pinmemberjamesleeli17:42 13 Sep '06  
AnswerRe: Why don't you application cannot run in my Computer? PinmemberMuhammad Adeel Malik6:30 14 Sep '06  
Generalwow PinmemberAnton Afanasyev8:47 27 Aug '06  
GeneralWell Gud start .. though error..... PinmemberKedar V23:00 26 Aug '06  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 18 Jan 2007
Article Copyright 2006 by Muhammad Adeel Malik
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid