PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework keybd_event in C#



Reply

keybd_event in C#

 
Thread Tools Rate Thread
Old 10-06-2004, 04:01 PM   #1
=?Utf-8?B?a2FubmFu?=
Guest
 
Posts: n/a
Default keybd_event in C#

How to use keybd_event api function in c# for combination keys

eg. ctrl+shift +s

I tried like

keybd_event(0x11,0x1D,0,0)
keybd_event(0x10,0xAA,0,0)
keybd_event(0x53,0x1F,0,0)
keybd_event(0x53,0x1F,0x0002,0)
keybd_event(0x10,0xAA,0x0002,0)
keybd_event(0x11,0x1D,0x0002,0)

but it doesn't work

-kannan
  Reply With Quote
Old 11-06-2004, 08:23 AM   #2
gani
Guest
 
Posts: n/a
Default keybd_event in C#

hi,

i'm not familiar with keybd_event. but if you want to
know how to handle ctrl+shift+s in c#, here is a sample
using textbox:

private void textBox1_KeyDown(object
sender, System.Windows.Forms.KeyEventArgs e)
{
if (e.Control && e.Shift &&
e.KeyValue == 83) //83 is 's'
MessageBox.Show
("ctrl+shift+s");
}

HTH

gani
http://thedeveloperscorner.com.ph


>-----Original Message-----
>How to use keybd_event api function in c# for

combination keys
>
>eg. ctrl+shift +s
>
>I tried like
>
> keybd_event(0x11,0x1D,0,0)
> keybd_event(0x10,0xAA,0,0)
> keybd_event(0x53,0x1F,0,0)
> keybd_event(0x53,0x1F,0x0002,0)
> keybd_event(0x10,0xAA,0x0002,0)
> keybd_event(0x11,0x1D,0x0002,0)
>
>but it doesn't work
>
>-kannan
>.
>

  Reply With Quote
Reply


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off