Sending a key message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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
 
You're not calling the right dll. Like everyinthing in CE, it's coredll.dll

-Chris

RIch said:
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 said:
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.
 
do'h!
Its been a while since I was into ce code. I remenber it all too clearly!

Thanks

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

-Chris

RIch said:
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 said:
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.

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
 
Back
Top