Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29106 Discussions

Help to create main window with max size

cean
New Contributor II
1,182 Views

Hi,

 

My Fortran openGL program is using CreateWindowEx like this to create the main window:

hwnd = CreateWindowEx(           &
                    0,               &  ! Style
                    szApp,           &  ! lpClassName           
                    TITLE,           &  ! lpWindowName
                    wsflag,          &  ! dwStyle
                    CW_USEDEFAULT,   &  ! X
                    CW_USEDEFAULT,   &  ! Y
                    1200,            &  ! nWidth
                    800,             &  ! nHeight
                    NULL,            &  ! hWndParent
                    NULL,            &  ! hMenu
                    hInstance,       &  ! hInstance
                    NULL)               ! lpParam

    !                    1366,        &
    !                    768,        &
    !                CW_USEDEFAULT,   &  ! nWidth
    !                CW_USEDEFAULT,   &  ! nHeight

 If I use CW_USEDEFAULT for nWidth and nHeight, I still can't get a full screen window. My screen is set at 1920*1080.

How do I set it? Thanks for help.

 

Cheers,

Cean 

0 Kudos
1 Solution
cean
New Contributor II
1,085 Views

I have figured out.

 

After this line, use ShowWindow to change the window size.

 

    nCmdShow=SW_SHOWMAXIMIZED
    ignor = ShowWindow(hwnd, nCmdShow)           ! show windows

 

View solution in original post

0 Kudos
4 Replies
andrew_4619
Honored Contributor III
1,156 Views

what have you got set in wsflag, that has an effect on behaviour, do you have the WS_OVERLAPPEDWINDOW flag set.  I think you need that with CW_USEDEFAULT?

0 Kudos
cean
New Contributor II
1,133 Views

I just grabbed the CUBE demo code.

 

wsflag = or(or(WS_OVERLAPPEDWINDOW, WS_CLIPCHILDREN),WS_CLIPSIBLINGS)
0 Kudos
Robert_van_Amerongen
New Contributor III
1,106 Views

For fullscreen the dwstyle must contain WS_POPUP and not WS_OVERLAPPEDWINDOW. The required width and height can either be set (1920, 1080 in your case) or, better, be obtained by calls to GetSystemMetrics.

 

Robert

0 Kudos
cean
New Contributor II
1,086 Views

I have figured out.

 

After this line, use ShowWindow to change the window size.

 

    nCmdShow=SW_SHOWMAXIMIZED
    ignor = ShowWindow(hwnd, nCmdShow)           ! show windows

 

0 Kudos
Reply