Click here to Skip to main content
15,897,187 members
Home / Discussions / C#
   

C#

 
GeneralRe: A lot of Sockets Pin
neroknights7-Apr-03 4:54
neroknights7-Apr-03 4:54 
GeneralRe: A lot of Sockets Pin
nahumtakum7-Apr-03 12:07
nahumtakum7-Apr-03 12:07 
GeneralRe: A lot of Sockets Pin
neroknights8-Apr-03 3:58
neroknights8-Apr-03 3:58 
GeneralRe: A lot of Sockets Pin
nahumtakum8-Apr-03 4:12
nahumtakum8-Apr-03 4:12 
GeneralRe: A lot of Sockets Pin
neroknights8-Apr-03 8:27
neroknights8-Apr-03 8:27 
GeneralRe: A lot of Sockets Pin
nahumtakum9-Apr-03 3:22
nahumtakum9-Apr-03 3:22 
GeneralAccessing Num Lock state from C# Pin
Katalyst6-Apr-03 9:46
Katalyst6-Apr-03 9:46 
GeneralRe: Accessing Num Lock state from C# Pin
Nathan Blomquist7-Apr-03 7:00
Nathan Blomquist7-Apr-03 7:00 
Here is some code, uses Win32 interop

using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

public enum SpecialKey
{
		CapsLock = 0x14,
		NumLock = 0x90,
		ScrollLock = 0x91
}
public class SpecialKeyState
{
  [DllImport("User32.dll")]
  private static extern short GetKeyState(int nVirtKey);

  public static bool GetSpecialKeyState( SpecialKey k ) 
  {
    int s;
    // get the key state
    s = GetKeyState((int)k);
    // check the lowest bit to see if the key is on or off
    s &= 0x01;
    // return a boolean
    if (s == 1)
       return true; // if on
    else
       return false; // if off
  }

}


I didn't test this code exactly. It is ripped from a component I made from some other code on the internet. I modified it to let you test any of the speical keys (my version allows you to set a member and then test that key on an interval).

Hope this helps,
Nathan

---------------------------
Hmmm... what's a signature?
GeneralRe: Accessing Num Lock state from C# Pin
Katalyst7-Apr-03 16:21
Katalyst7-Apr-03 16:21 
GeneralRe: Accessing Num Lock state from C# Pin
Katalyst7-Apr-03 17:25
Katalyst7-Apr-03 17:25 
GeneralRe: Accessing Num Lock state from C# Pin
Nathan Blomquist7-Apr-03 18:04
Nathan Blomquist7-Apr-03 18:04 
GeneralPictureBox problem Pin
Mazdak6-Apr-03 8:16
Mazdak6-Apr-03 8:16 
GeneralRe: PictureBox problem Pin
James T. Johnson6-Apr-03 8:35
James T. Johnson6-Apr-03 8:35 
GeneralRe: PictureBox problem Pin
Mazdak6-Apr-03 8:51
Mazdak6-Apr-03 8:51 
GeneralIPAddress Problem Pin
Mr BallyDaHob6-Apr-03 5:43
Mr BallyDaHob6-Apr-03 5:43 
GeneralRe: IPAddress Problem Pin
Richard Deeming7-Apr-03 1:43
mveRichard Deeming7-Apr-03 1:43 
GeneralMaking skinned apps. Pin
zamazula6-Apr-03 2:39
zamazula6-Apr-03 2:39 
GeneralResource editor Pin
Manish K. Agarwal6-Apr-03 2:31
Manish K. Agarwal6-Apr-03 2:31 
GeneralRe: Resource editor Pin
James T. Johnson6-Apr-03 4:41
James T. Johnson6-Apr-03 4:41 
GeneralRe: Resource editor Pin
Manish K. Agarwal6-Apr-03 17:37
Manish K. Agarwal6-Apr-03 17:37 
GeneralTextBox doubt Pin
Smitha Nishant6-Apr-03 2:16
protectorSmitha Nishant6-Apr-03 2:16 
GeneralRe: TextBox doubt Pin
James T. Johnson6-Apr-03 4:42
James T. Johnson6-Apr-03 4:42 
GeneralRe: TextBox doubt Pin
Smitha Nishant6-Apr-03 6:11
protectorSmitha Nishant6-Apr-03 6:11 
Generalhttp://www.codeproject.com/csharp/BigInteger.asp Pin
James Wanless6-Apr-03 1:24
James Wanless6-Apr-03 1:24 
General= Operator on TabPage Pin
monrobot135-Apr-03 9:28
monrobot135-Apr-03 9:28 

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.