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

FSX Window inside FSX

Discussion in 'Tools programming' started by Konny, 10/9/09.

  1. Konny

    Konny

    Joined:
    2/11/08
    Messages:
    7
    Hi,

    I've read a lot of threads here about how to show a window inside FSX and wanted to try it myself now. I have to admit that I'm not really an expert in WinAPI programming and from what I've seen there's still nobody here who knows how to show a modeless window in fullscreen and window mode.

    But I can't even get a modal window to show up inside the FSX. I started off with the SimConnect example which enables the Dialog Mode and then tried to get the handle to the FS window and create a child window, but nothing happens.

    Here's what I did when the Dialog Mode is turned on:
    Code:
    hFSimWindow = FindWindow((LPCWSTR)"FS98MAIN", NULL);
    hInst = (HINSTANCE)GetWindowLong( hFSimWindow, GWL_HINSTANCE );
    
    WNDCLASSEX wcex;
    wcex.cbSize = sizeof(WNDCLASSEX); 
    wcex.style			= CS_HREDRAW | CS_VREDRAW; 
    wcex.lpfnWndProc	= (WNDPROC)WndProc;
    wcex.cbClsExtra		= 0;
    wcex.cbWndExtra		= 0;
    wcex.hInstance		= hInst;
    wcex.hIcon			= NULL;
    wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
    wcex.hbrBackground	= (HBRUSH)(COLOR_WINDOW+1);
    wcex.lpszMenuName	= NULL;
    wcex.lpszClassName	= (LPCWSTR)L"TestModule";
    wcex.hIconSm		= NULL;
    
    RegisterClassEx(&wcex);
    
    hWnd = CreateWindowEx(WS_EX_TOPMOST,wcex.lpszClassName, (LPCWSTR)L"TestModule", WS_CHILD | WS_CAPTION | WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 300, 200, hFSimWindow, NULL, hInst, NULL);
    
    What am I doing wrong here? And has anyone made progress regarding modeless windows?
  2. YuliyF

    YuliyF

    Joined:
    23/11/09
    Messages:
    1
    Country:
    ukraine
    You do all right. But, next step need create a loop of redraw window - else you can't see window

Share This Page