IB Gateway + SPY++

Discussion in 'App Development' started by Xraptor, Jan 8, 2017.

  1. InvBox

    InvBox

    IB Controller uses Java specific classes from AWT. In C# no analogue for Java applications.

    Actually window messages should to work (and doesn't matter what the technology uses as a background) and window handles should to exist.
     
    #11     Jan 9, 2017
  2. Xraptor

    Xraptor

    nonlinear5, java and C# this is different thing!
     
    #12     Jan 9, 2017
  3. Xraptor

    Xraptor

    Window of IB Gateway doesn't have Children handles I written about it at the first post You can check out it use SPY++ in Visial Studio.
     
    #13     Jan 9, 2017
  4. I've been a software engineer for the last 20 years, so I know the difference.

    I'll try one more time: automation of the TWS/IBGateway login has already been implemented in IB Controller. If you want your own implementation, nothing stops you from coding it yourself.
     
    #14     Jan 9, 2017
  5. southall

    southall

    Figure out how to start IB Gateway from command line promt:

    eg:

    java -cp jts.jar:total.2013.jar -Dsun.java2d.noddraw=true -Xmx512M ibgateway.GWClient .

    The exact command will depend on which version of the Gateway you are using.

    Then supply this exact same command to c# createProcess call (or what ever this method is called in c#)

    You can switch the java main class to one that will do an auto login for you eg the IBController entry point.
     
    #15     Jan 9, 2017
  6. Xraptor

    Xraptor

    nonlinear5, IB Controller this is Java I coding on C# and I can't use technology the IB Controller even if I will be coding it self. Which analog of technology the IB Controller I can use in C#?

    If do you know pls tell me!
     
    Last edited: Jan 9, 2017
    #16     Jan 9, 2017
  7. Xraptor

    Xraptor

    yeap, I found a sample code there IB started via cmd.exe without windows. That's not what I wanted but ...
     
    Last edited: Jan 9, 2017
    #17     Jan 9, 2017
  8. Xraptor

    Xraptor

    I thought that there is a C# library where can simulate some action user ... "click", "past", "tab" or "enter".
    Where is the window we know location coordinates of the window not changing.
     
    #18     Jan 9, 2017
  9. IBController is a wrapper to launch and log in to IB Gateway. Even if it is in Java it can be spawned like an .exe and therefore can be invoked through a Process via C#. So simply use your C# tool to execute the command line needed to launch IBController. (It's possible to launch Java applications via C# since its nothing more than a java process).

    You can then use Visual Studio's Automation library to navigate the pop-up panel (you'll be able to find the window, not sure about the individual controls, but blind tabbing will work).

    https://msdn.microsoft.com/en-us/library/ms747327(v=vs.110).aspx


    Note, this will not work (I think?) if you have two factor authentication. Haven't seen anything in IBController that can handle that.... which I suppose is good from a security point of view :p
     
    #19     Jan 9, 2017
  10. InvBox

    InvBox

    As I understand IB Controller, the Gataway was implemented via Swing. Swing has handles, like a WPF, but it is dynamic. Not sure Spy++ can track it.

    Anyway - use SendInput. It should to work.
     
    #20     Jan 9, 2017