Click here to Skip to main content
15,901,426 members
Articles / Operating Systems / Windows
Article

Window API's

Rate me:
Please Sign up or sign in to vote.
2.51/5 (55 votes)
17 Jan 2007CPOL1 min read 39.9K   1.2K   36   7
Capture Screen , Block Mouse and Keyboard , System info , Get Caption , Check running Internet Explorer , All Running Windows , Capture Keyboards Inputs

<o:p> 

API AND VC# DOT NET<o:p>

It consists of four classes

  1. KeyboardHook<o:p>
  2. PlatformInvokeGDI32<o:p>
  3. Registry<o:p>
  4. WindowAPI<o:p>

<o:p> 

These classes perform 6 functions

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

<o:p> 

CAPTURE SCREEN<o:p>

Simple one line function to capture screen <o:p>

<o:p> 

ü      pbox.Image = Win32.WindowAPI.GetDesktopImage();<o:p>

<o:p> 

BLOCK MOUSE AND KEYBOARD<o:p>

This function capture bool variable if u pass true its block key board and muse and false then unblock<o:p>

<o:p> 

<o:p> 

ü      Win32.WindowAPI.BlockInput(true);<o:p>

<o:p> 

SYSTEM INFO<o:p>

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

<o:p> 

SYSTEM_INFO pSI = new SYSTEM_INFO();<o:p>

<o:p> 

ü      Win32.WindowAPI.GetSystemInfo(ref pSI);<o:p>

<o:p> 

public uint dwOemId;<o:p>

public uint dwPageSize;<o:p>

public uint lpMinimumApplicationAddress;<o:p>

public uint lpMaximumApplicationAddress;<o:p>

public uint dwActiveProcessorMask;<o:p>

public uint dwNumberOfProcessors;<o:p>

public uint dwProcessorType;<o:p>

public uint dwAllocationGranularity;<o:p>

public uint dwProcessorLevel;<o:p>

           

GET CAPTION<o:p>

Simple string return active window handler and name<o:p>

<o:p> 

ü      String str=Win32.WindowAPI.GetWindowHandle();<o:p>

<o:p> 

It also contains code that Monitors the windows inputs and Keyboard inputs Called this on form constructor<o:p>

<o:p> 

ü      kh = new KeyboardHook();<o:p>

ü      kh.KeyDown+=new KeyEventHandler (frmactivewindow_ KeyDown);<o:p>

<o:p> 

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

<o:p> 

<o:p> 

CHECK RUNNING (IE and Programmas)<o:p>

It gets all running internet explorer u simple send a list box and enjoy all internet explorer<o:p>

<o:p> 

ü      WindowAPI.GetIExp(lstBox);<o:p>

<o:p> 

One more function it perform it close the running window u only List Box like <o:p>

<o:p> 

ü      Win32.WindowAPI.CloseIE(lstBox);<o:p>

License

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


Written By
Web Developer
Pakistan Pakistan
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Generaltanks Pin
suvers18-Apr-07 13:18
suvers18-Apr-07 13:18 
GeneralSO SO nice Pin
Ala'a Dwekat19-Feb-07 11:06
Ala'a Dwekat19-Feb-07 11:06 
GeneralRe: SO SO nice Pin
Muhammad Adeel Malik20-Feb-07 4:11
Muhammad Adeel Malik20-Feb-07 4:11 
God Bless you
(Alt,Tab,Ctrl,Del,Esc....).....if u are working in dot net then it simple check by
if(e.tab = key.tab)
sender.cancel
take care
god bless you

Muhammad Adeel Malik
BCS(Software Enginner)

QuestionWhy don't you application cannot run in my Computer? Pin
jamesleeli13-Sep-06 17:42
jamesleeli13-Sep-06 17:42 
AnswerRe: Why don't you application cannot run in my Computer? Pin
Muhammad Adeel Malik14-Sep-06 6:30
Muhammad Adeel Malik14-Sep-06 6:30 
Generalwow Pin
Anton Afanasyev27-Aug-06 8:47
Anton Afanasyev27-Aug-06 8:47 
GeneralWell Gud start .. though error..... Pin
K edar V26-Aug-06 23:00
K edar V26-Aug-06 23:00 

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

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