Re: Barcode scanner/keyboard queue - Windows CE

This is a discussion on Re: Barcode scanner/keyboard queue - Windows CE ; It is possible to write a driver that is selective about what window it will send keystrokes to. One way to do it is to use the FindWindow API function to see if the application that you want to receive ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: Barcode scanner/keyboard queue

  1. Re: Barcode scanner/keyboard queue

    It is possible to write a driver that is selective about what window
    it will send keystrokes to. One way to do it is to use the FindWindow
    API function to see if the application that you want to receive the
    keystrokes is actually open. You can pass the title bar text for the
    window that you are looking for to the FindWindow function.
    If the window is open, it will return the window handle to the
    program's window.
    You would then need to either enumerate all windows to see if the
    program's window is the top level window and if it is, you could send
    the keystrokes and if not, you could do nothing.
    If the window is open but it is not the top level window, you could
    also use the SetForegroundWindow API function to force the window into
    the focus if it is running in the background and then send the
    keystrokes to it after it is forced to the foreground.
    Unfortunately you cannot send keystrokes to a background window.


    On Wed, 24 Mar 2004 14:12:52 -0000, "Tweeeek"
    wrote:

    >Hi
    >Our product has a built in barcode scanner, the barcode scanner driver
    >receives the resulting barcode and puts it into the keyboard queue so that
    >our applications and other applications such as pocket word display the
    >resultant barcode.
    >
    >What I want to do is that somehow I need to know if an application is open
    >and only then should the barcode driver send the barcode to the keyboard
    >queue. I want this because if say I am on the desktop and scan a barcode
    >the resulting data is treated as key inputs and if icons are seelcted they
    >are executed and some of the data is treated as unidentified keystrokes and
    >I get a series of error beeps.
    >
    >Is there anyway from within a driver of detecting if a window such as say
    >pocket word or other application is open???
    >Is there anyway of detecting if we are on the dessktop and say the start bar
    >is up??
    >
    >Any help, advice would be very much appreciated.
    >
    >Regards
    >
    >



  2. Re: Barcode scanner/keyboard queue

    This note somehow inspired me:
    How about a mostly generic wedge that accepted input specifying
    windows handles (HWND). An application-specific (registered) window
    message would probably be the simplest way to implement this. So an
    application that wanted barcodes would send appropriate HWNDs to the
    wedge, and the wedge would then send codes only to one of those
    windows. If the list of HWNDs has more than one entry, the wedge
    should have some algorithm for choosing (perhaps choose active window
    if it is in the list). It should also make sure whatever window it
    chooses exists (I think IsWindow would suffice). If the wedge has no
    list, it can behave as "normal": send codes to whatever window has
    focus.

    On Wed, 21 Apr 2004 14:11:42 GMT, Thomas Lutz wrote:

    >It is possible to write a driver that is selective about what window
    >it will send keystrokes to. One way to do it is to use the FindWindow
    >API function to see if the application that you want to receive the
    >keystrokes is actually open. You can pass the title bar text for the
    >window that you are looking for to the FindWindow function.
    >If the window is open, it will return the window handle to the
    >program's window.
    >You would then need to either enumerate all windows to see if the
    >program's window is the top level window and if it is, you could send
    >the keystrokes and if not, you could do nothing.
    >If the window is open but it is not the top level window, you could
    >also use the SetForegroundWindow API function to force the window into
    >the focus if it is running in the background and then send the
    >keystrokes to it after it is forced to the foreground.
    >Unfortunately you cannot send keystrokes to a background window.
    >
    >
    >On Wed, 24 Mar 2004 14:12:52 -0000, "Tweeeek"
    > wrote:
    >
    >>Hi
    >>Our product has a built in barcode scanner, the barcode scanner driver
    >>receives the resulting barcode and puts it into the keyboard queue so that
    >>our applications and other applications such as pocket word display the
    >>resultant barcode.
    >>
    >>What I want to do is that somehow I need to know if an application is open
    >>and only then should the barcode driver send the barcode to the keyboard
    >>queue. I want this because if say I am on the desktop and scan a barcode
    >>the resulting data is treated as key inputs and if icons are seelcted they
    >>are executed and some of the data is treated as unidentified keystrokes and
    >>I get a series of error beeps.
    >>
    >>Is there anyway from within a driver of detecting if a window such as say
    >>pocket word or other application is open???
    >>Is there anyway of detecting if we are on the dessktop and say the start bar
    >>is up??
    >>
    >>Any help, advice would be very much appreciated.
    >>
    >>Regards
    >>
    >>


    -----------------------------------------
    To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

    Robert E. Zaret, eMVP
    PenFact, Inc.
    500 Harrison Ave., Suite 3R
    Boston, MA 02118
    www.penfact.com

+ Reply to Thread