Skip to main content

Posts

Showing posts from March, 2011

How to check the status of CAPS / NUMLOCK status in C#.NET

There are two types of codes available in C#.NET for checking the status of CAPS Lock and NUM Lock. a. Unmanaged Code : The code written in conventional languages like C, C++, VC++ etc. This kind of code can be called in the Managed Environment like .NET, JRE etc. [ DllImport ( "user32.dll" , CharSet = CharSet .Auto, ExactSpelling = true , CallingConvention = CallingConvention .Winapi)] public static extern short GetKeyState( int keyCode); bool CapsLock = ((( ushort )GetKeyState(0x14)) & 0xffff) != 0; bool NumLock = ((( ushort )GetKeyState(0x90)) & 0xffff) != 0; bool ScrollLock = ((( ushort )GetKeyState(0x91)) & 0xffff) != 0; MessageBox .Show( "Caps Lock is on: " + CapsLock.ToString()); MessageBox .Show( "Num Lock is on: " + NumLock.ToString()); MessageBox .Show( "Scroll Lock is on: " + ScrollLock.ToString()); b. Managed Code: Code which is managed by the Runtime environment. This type of code is basically a wr

Windows Internet Explorer 9 RTM

Microsoft RTM'd the Windows Internet Explorer 9 finally. This version of IE has changed the overall scenario of the IE again. With strong support from the end users, this IE is finally going to take Microsoft's IE into the right direction. Highly recommended. Sorry to the XP user's, the download is not available. Only meant for VISTA or Windows 7.