SendInput Problems

Discussion in 'Windows 64 Bit' started by Jamie Turner, Feb 12, 2007.

  1. Jamie Turner

    Jamie Turner Guest

    Hi all

    I have an app that uses Sendinput to simulate keystrokes in other apps. It
    works fine in regular XP but not in XP x64. I can't find any documentation
    about why the API call doesn't work - does anyone know of compatibility
    issues?

    TIA

    Jamie.
     
    Jamie Turner, Feb 12, 2007
    #1
    1. Advertisements

  2. I cannot be sure, but I think that the standard 'char' type has to be a
    'wchar' today (in support of uni-code). I havn't been doing any of this for
    a long time, but I think this is all pretty much standardized and should be
    handled more or less automatically in compiled routines, if they call the
    correct header files?

    But there is one other possibility. It concerns the subsystem that arranges
    for how 32bit and 64bit apps are installed on XP x64. They both use the
    Program Files Directory, but they must be distinctly separated, if your app
    is making non-system calls that directs your keystrokes to the wrong
    directory - you are in trouble! But I may be wrong, and your trouble could
    turn out to be more trivial. If nothing else turns up here, I think a
    developer group might be able to give more specific answers. Might be a
    guide to find the most suitable one, if you knew what language the app was
    originally written in?


    Tony. . .
     
    Tony Sperling, Feb 12, 2007
    #2
    1. Advertisements

  3. Jamie Turner

    Jamie Turner Guest

    Hi Tony

    Thanks for the response. I'm writing in VB.NET (.NET 2.0) using this
    declaration (which I'm sure is right):

    <DllImport("user32.dll")> Private Shared Function SendInput(ByVal cInputs As
    Integer, ByRef pInputs As INPUT, ByVal cbSize As Integer) As Integer
    End Function

    It works fine in 32bit XP but doesn't do anything in 64bit XP. I'm not
    touching the file system so I don't think it's that. Any ideas?!

    Thanks

    Jamie.
     
    Jamie Turner, Feb 13, 2007
    #3
  4. Ah - that has to be the *.DLL, then. I'm not absolutly certain at the
    moment, and I'm not at all 'home' on Basic, but I think you should have
    that - or a copy of any 32bit DLL's you use, in the SYSWOW directory - this
    whole compatibility re-direction issue, is very confusing. This link may
    help:

    http://support.microsoft.com/kb/896456

    Your routines don't have to actually call anything in the filesystem, or
    manipulate it in any way, to be subject to compatibility side-effects - this
    is an effect of how 32bit app's are installed in the filesystem on this OS.

    Tony. . .
     
    Tony Sperling, Feb 13, 2007
    #4
  5. Jamie Turner

    Jamie Turner Guest

    Hi Tony

    That's really useful - thank you so much! Rather than moving files around, I
    changed the .NET compiler settings to force it to compile for x86 rather
    than Any. That forces it to be 32bit (as in that article) and it seems that
    windows then picks the right dlls!

    Thanks again - really appreciate your help - it's been driving me nuts!

    Jamie.
     
    Jamie Turner, Feb 13, 2007
    #5
  6. That is good news, Jamie. Thanks for letting us know.


    Tony. . .
     
    Tony Sperling, Feb 13, 2007
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.