PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Sending a key message

Reply

Sending a key message

 
Thread Tools Rate Thread
Old 16-01-2006, 04:16 PM   #1
=?Utf-8?B?UkljaA==?=
Guest
 
Posts: n/a
Default Sending a key message


There is lots of doc on how to capture a key on the smartphone (e.g. back
key), but how do you send a key. I would like to programmatically push the
'home' key.

Rich
  Reply With Quote
Old 16-01-2006, 04:21 PM   #2
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: Sending a key message

You could try P/Invoking keybd_event() to do that. If the Home key is
actually a *Home* key and not some software-interpreted key value (you'd
send VK_HOME).

Paul T.

"RIch" <RIch@discussions.microsoft.com> wrote in message
news:6545963C-E627-40B3-B56B-6052D7081D7C@microsoft.com...
> There is lots of doc on how to capture a key on the smartphone (e.g. back
> key), but how do you send a key. I would like to programmatically push
> the
> 'home' key.
>
> Rich



  Reply With Quote
Old 17-01-2006, 04:18 AM   #3
=?Utf-8?B?UkljaA==?=
Guest
 
Posts: n/a
Default Re: Sending a key message

I tried
[DllImport("Uibase.lib", EntryPoint = "keybd_event")]
public static extern void keybd_event(byte bVk, byte bScan, uint
dwFlags, uint dwExtraInfo);

I've also tried using user32.dll instead of uibase.lib. I get a runtime
exception that it cant find the dll. From the doc's I can find, I have the
correct dll. What I'm I doing wrong?

Rich

"Paul G. Tobey [eMVP]" wrote:

> You could try P/Invoking keybd_event() to do that. If the Home key is
> actually a *Home* key and not some software-interpreted key value (you'd
> send VK_HOME).
>
> Paul T.
>
> "RIch" <RIch@discussions.microsoft.com> wrote in message
> news:6545963C-E627-40B3-B56B-6052D7081D7C@microsoft.com...
> > There is lots of doc on how to capture a key on the smartphone (e.g. back
> > key), but how do you send a key. I would like to programmatically push
> > the
> > 'home' key.
> >
> > Rich

>
>
>

  Reply With Quote
Old 17-01-2006, 04:49 AM   #4
Guest
 
Posts: n/a
Default Re: Sending a key message

You're not calling the right dll. Like everyinthing in CE, it's coredll.dll

-Chris

"RIch" <RIch@discussions.microsoft.com> wrote in message
news:69A346D2-178B-4B92-A892-48DC3EAB3734@microsoft.com...
>I tried
> [DllImport("Uibase.lib", EntryPoint = "keybd_event")]
> public static extern void keybd_event(byte bVk, byte bScan, uint
> dwFlags, uint dwExtraInfo);
>
> I've also tried using user32.dll instead of uibase.lib. I get a runtime
> exception that it cant find the dll. From the doc's I can find, I have the
> correct dll. What I'm I doing wrong?
>
> Rich
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> You could try P/Invoking keybd_event() to do that. If the Home key is
>> actually a *Home* key and not some software-interpreted key value (you'd
>> send VK_HOME).
>>
>> Paul T.
>>
>> "RIch" <RIch@discussions.microsoft.com> wrote in message
>> news:6545963C-E627-40B3-B56B-6052D7081D7C@microsoft.com...
>> > There is lots of doc on how to capture a key on the smartphone (e.g.
>> > back
>> > key), but how do you send a key. I would like to programmatically push
>> > the
>> > 'home' key.
>> >
>> > Rich

>>
>>
>>



  Reply With Quote
Old 17-01-2006, 05:05 AM   #5
=?Utf-8?B?UkljaA==?=
Guest
 
Posts: n/a
Default Re: Sending a key message

do'h!
Its been a while since I was into ce code. I remenber it all too clearly!

Thanks

"<ctacke/>" wrote:

> You're not calling the right dll. Like everyinthing in CE, it's coredll.dll
>
> -Chris
>
> "RIch" <RIch@discussions.microsoft.com> wrote in message
> news:69A346D2-178B-4B92-A892-48DC3EAB3734@microsoft.com...
> >I tried
> > [DllImport("Uibase.lib", EntryPoint = "keybd_event")]
> > public static extern void keybd_event(byte bVk, byte bScan, uint
> > dwFlags, uint dwExtraInfo);
> >
> > I've also tried using user32.dll instead of uibase.lib. I get a runtime
> > exception that it cant find the dll. From the doc's I can find, I have the
> > correct dll. What I'm I doing wrong?
> >
> > Rich
> >
> > "Paul G. Tobey [eMVP]" wrote:
> >
> >> You could try P/Invoking keybd_event() to do that. If the Home key is
> >> actually a *Home* key and not some software-interpreted key value (you'd
> >> send VK_HOME).
> >>
> >> Paul T.
> >>
> >> "RIch" <RIch@discussions.microsoft.com> wrote in message
> >> news:6545963C-E627-40B3-B56B-6052D7081D7C@microsoft.com...
> >> > There is lots of doc on how to capture a key on the smartphone (e.g.
> >> > back
> >> > key), but how do you send a key. I would like to programmatically push
> >> > the
> >> > 'home' key.
> >> >
> >> > Rich
> >>
> >>
> >>

>
>
>

  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