To use GetAsyncKeyState() you'd have to continously poll with a Timer.
Another option would be to register your key combination as a HotKey using the RegisterHotkey() API:
http://www.experts-exchang
Be aware, though, that if another application has already registered your desired key combo then you won't be able to trap it.
You could also use a low level keyboard hook which would allow you to trap the combination no matter what:
http://www.experts-exchang
Main Topics
Browse All Topics





by: cK-Posted on 2009-11-01 at 18:08:53ID: 25716675
>> Using Windows API's
ices;
syncKeySta te(KEY));
en-us/libr ary/ ms6455 40%28VS.85 %29.aspx
using System.Runtime.InteropServ
[DllImport("user32.dll")]
public static extern short GetAsyncKeyState(int vKey);
byte[] bytes = BitConverter.GetBytes(GetA
if (bytes[1] == 128) DoSomethig; //Key Pressed
//KEY = http://msdn.microsoft.com/