• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Programmatically opening a new view window

Messages
64
Country
unitedkingdom
Does anyone know whether it is possible to programmatically open a new view window, ideally being able to specify it's size, the view that it opens in and then close it again?

Thanks
 
trigger_key_event(KEY_NEW_VIEW, 0);

. the title will be the red text in the upper right corner as the view is opened.

trigger_key_event(KEY_VIEW_MODE, 0); to cycle through the main view modes (topdown, spot, tower, cockpit, VC) and trigger_key_event(KEY_NEXT_SUB_VIEW, 0); to cycle through the sub views for that mode. At each cycle of the loop use FindWindowEx(FindWindow(L"FS98MAIN", NULL), NULL, L"FS98CHILD", L"title of desired view"); and when it returns a valid HWND stop the loop. The title will be the red text in the upper right corner as the view is opened.
 
Thanks, Naruto.
Is there a way to specify the size of the window that opens as of course by default it is a small window in the corner. Is this sized specified via a setting somewhere or is the only way to enlarge it by manually click and dragging?
The purpose of this is to get a screenshot of the sive
 
It is a known bug in FSX and P3D, that the handling of additional windows does not work. The only possibility is to define the additional windows for a mission basically. They will appear as small windows as you described. During runtime, out of your DLL or application, you can determine the additional windows with the functions Naruto-kun described. Once you have the window handle, you can resize and position the windows with the corresponding windows API functions. What I did for a 3 channel (3 windows) projection:
I developed a small application which starts FSX as process. The Application loops in the background and waits on FSX until it opens the additional windows. At this moment the application resizes and positions the additional windows with given parameters and ends itself. The detection of the additional windows is done in a loop with the API function FindWindow(NULL,"windows caption name"). The caption name can be determined by yourself when you run your mission and you open the additional windows manually. BTW, there is another bug in the additional windows. Directional lights behave erratic in additional windows.
Regards,
Mike
 
Just one thing, if you call SetWindowPos to change the size, use the SWP_NOMOVE flag and no others. Its the only one I have been able to use without getting Z buffer issues.
 
Back
Top