How to programmatically adjust the screen size of an Eikon .NET application?

Hi,

When I launch my Eikon .NET application, it seems the initial screen size of my control is not what I've defined in the xaml file. How can I specify the window size of my application programmatically?

Thanks,
Piyasak

Answers

  • Piyasak, this not yet available, but is planned as per
    http://www.iajira.amers.ime.reuters.com/browse/APPS-640 .
  • Denis,

    May I ask you more question? I saw that you have posted an intersting topic "Introduction to Ex Controls" in the hub. I've followed your instruction to get the control but it did not appear in the list shown under Eikon/Developer. I'm using the desktop version 4.0.27602.

    Please advise.

    Thanks,
    Piyasak
  • It appears the targeting of the Ex Gallery was not large enough. I've just updated it, you should now see it in Eikon, developer category. restarting Eikon is required.

    Please note that Ex Library is in alpha stage, meaning quite unstable, and breaking changes are expected.
  • Thank you very much, I now see it in my Eikon. :)
  • I attempted to download the control as mentioned in the Ex screen (fork sources on GitHub!) but I got Page Not Found. Is there any alternate source where I can download it?
  • Yes this link is here in anticipation of open-sourcing the code... we are not there yet. If you're ok to be a alpha tester of Ex Library (all kinds of early feedback are welcome), you can download add a reference to Ex Library through Nuget: 1. Configure your NuGet package manager as described in
    https://thehub.thomsonreuters.com/docs/DOC-515153 2. In your project, add a nuget package reference to Ex Library, currently version 0.6.0-rc6. It will only appear when you select "include Prerelease" in NuGet Dialog.
  • I've got the control installed successfully.

    Many Thanks,
    Piyasak
  • Follow a possible solution:

    [DllImport("user32.dll")]

    static extern IntPtr GetForegroundWindow();

    [DllImport("user32.dll")]

    public static extern bool GetWindowRect(IntPtr hwnd, ref
    Rect rectangle);

    [DllImport("user32.dll", SetLastError = true)]

    static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int
    nWidth, int nHeight, bool bRepaint);

    public struct Rect {

    public
    int Left { get; set; }

    public
    int Top { get; set; }

    public
    int Right { get; set; }

    public
    int Bottom { get; set; }

    }

    public MainControl()
    {

    InitializeComponent();

    IntPtr
    h = GetForegroundWindow();

    Rect r
    = new Rect();

    GetWindowRect(h,
    ref r);

    MoveWindow(h,
    r.Right, r.Left, 800, 600, true);

    ...

    }