locked
how to send any key from my program to another - in windows-mobile ? RRS feed

  • Question

  • hi

    how to send any key from my program to another - in windows-mobile ?

    for ex: if i press 'A' in my program, and i want to send it to another program

    thank's in advance
    Thursday, October 14, 2010 2:40 PM

Answers

  • On Thu, 14 Oct 2010 14:40:08 +0000, E_gold wrote:


    hi


    how to send any key from my program to another - in windows-mobile ?


    for ex: if i press 'A' in my program, and i want to send it to another program

    I'll provide an answer that uses straight Win32. If you're using C# or
    VB, someone other than me will need to "translate".

    If you want to send characters, you can send WM_CHAR messages. If you
    want to send strings, you can use WM_SETTEXT. Either method would
    require finding the handle for an appropriate window in the receiving
    app. If you can rebuild the receiving app, you can use a unique window
    classname for the receiving window, and then the sending app can use
    that classname as the first arg in FindWindow.

    If you really want to send keyboard events (not just characters),
    keybd_event will send to whatever window has focus.

    If you want to do something else, I suggest providing a bit more
    information.


    thank's in advance

    Friday, October 15, 2010 4:47 PM

All replies

  • hi

    how to send any key from my program to another - in windows-mobile ?

    for ex: if i press 'A' in my program, and i want to send it to another program

    thank's in advance
    Thursday, October 14, 2010 2:40 PM
  • On Thu, 14 Oct 2010 14:40:08 +0000, E_gold wrote:


    hi


    how to send any key from my program to another - in windows-mobile ?


    for ex: if i press 'A' in my program, and i want to send it to another program

    I'll provide an answer that uses straight Win32. If you're using C# or
    VB, someone other than me will need to "translate".

    If you want to send characters, you can send WM_CHAR messages. If you
    want to send strings, you can use WM_SETTEXT. Either method would
    require finding the handle for an appropriate window in the receiving
    app. If you can rebuild the receiving app, you can use a unique window
    classname for the receiving window, and then the sending app can use
    that classname as the first arg in FindWindow.

    If you really want to send keyboard events (not just characters),
    keybd_event will send to whatever window has focus.

    If you want to do something else, I suggest providing a bit more
    information.


    thank's in advance

    Friday, October 15, 2010 4:47 PM