1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

2d panels Multiple montiors

Discussion in 'General chat' started by Wood, 4/5/12.

  1. Wood

    Wood

    Joined:
    23/11/11
    Messages:
    70
    Country:
    canada
    Hi Guy's
    I'm having a little difficulty here and was wondering if anyone here has any ideas. I'm soory if this is not a question that belongs here or is in the wrong place but I need to ask because most of the info I've found on this is at least a year old.

    I'm building an F/A18E cockpit.
    [​IMG]

    I purchased an 8 inch touch screen fror the UFCD and placed it in "not showing in pic" I have another 3 more 8 inch screens coming for the 3 DDI displays. Now what I've noticed with FSX so far is that When I set the UFCD onto the touch screen it works great but when I exit FSX the display does not save to where I placed the panel and I have to drag it back to the 8 inch monitor everytime I start the sim. I read and tried this http://forum.avsim.net/topic/63144-a-software-to-save-your-panel-position/ with no sucess and it seems to be the most recent info I can find but last post dating back to July of last year.
    I'm not sure if there is another way to save the display layout, so I thought i would ask guy's who dig into the meat of FSX.

    I did read that Prepared 3d does not have the problem in this area and was wondering what is different and is there away to adapt what they have done to FSX.

    Any suggestions would be great.

    Thanks in advance

    Mark
  2. TOWSIM

    TOWSIM

    Joined:
    4/1/10
    Messages:
    111
    Country:
    germany
    Hi Mark,
    you found an old Bug in FSX. I even got no Results on my questions and had to go the hard way. I created a program which is used to launch the simulator. As soon as FSX is started, the program uses the API function "FindWindow(NULL,"name of your MFD window"). The name is, what you can read in the caption of your MFD windows. The returned window handle can be used with the API function "SetWindowPos", to set the windows on to the right position, in the right size.
    Below you find the important C++ code snippet to execute the task.
    Regards
    Mike


    int APIENTRY _tWinMain(HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPTSTR lpCmdLine,
    int nCmdShow)
    {

    BOOL rval;
    char pathStr[256];
    char directory[256];
    HWND LeftWnd = NULL;
    HWND RightWnd = NULL;
    if(appINI.GetPrivateValue("GENERAL","path",pathStr,256)) // get the location of FSX from an INI file
    { // or take fix wired names
    if(appINI.GetPrivateValue("GENERAL","directory",directory,256))
    {
    rval = CreateProcess(NULL,pathStr,NULL,NULL,FALSE,0,NULL,directory,&si,&pinf); // start FSX
    }
    }
    while(!LeftWnd)
    { // now loop until FSX responses to report the window
    LeftWnd = FindWindow(NULL,"Left Channel - View 01"); // handle of the first additional window
    Sleep(100);
    }
    while(!RightWnd)
    { // do the same for the right channel window
    RightWnd = FindWindow(NULL,"Right Channel - View 02");
    Sleep(100);
    }
    rval = SetWindowPos( LeftWnd,HWND_TOPMOST,0,0,1920,1200,SWP_SHOWWINDOW); // now place and scale the windows for your
    rval = SetWindowPos( RightWnd,HWND_TOPMOST,1920 * 2,0,1920,1200,SWP_SHOWWINDOW); // personal use

    return (0);
    }
  3. Wood

    Wood

    Joined:
    23/11/11
    Messages:
    70
    Country:
    canada
    Hi Mike

    Thank you for you reply. Not sure what the code all means or where it goes as I'm no coder. From what I see it can be used for all additional monitors when added. correct?

    Thank you very much for this.

    Mark.
  4. TOWSIM

    TOWSIM

    Joined:
    4/1/10
    Messages:
    111
    Country:
    germany
    That is correct.
    Mike

Share This Page