Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

imposterrific

Fullscreen window using API

This topic is 5222 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to create a new window in full screen mode using the API. Here is what I have so far: m_hWnd = CreateWindow( TEXT("EventWindow"), TEXT("Video Window"), WS_EX_TOPMOST | WS_POPUP | WS_VISIBLE, CW_USEDEFAULT, // right boundary x CW_USEDEFAULT, // top boundary y 640, // width 480, // height NULL, NULL, m_hInstance, NULL); Instead of hard coding 640 by 480 I would like to get these values from the OS as settings on unique computers vary. How would I go about doing this? Thanks, Jeff

Share this post


Link to post
Share on other sites
Advertisement
Hello imposterrific,

Are you trying to get the window size to the current screen resolution of your screen, or are you wanting to get all the current screen modes the graphic card can handle?

If its the first you can just do:

#include <windows.h>

int xPos, yPos;

xPos = GetSystemMetrics(SM_CXSCREEN);
yPos = GetSystemMetrics(SM_CYSCREEN);

// replace 640 with xPos

// replace 480 with yPos



Hope this helps,
- [BDS]StackOverflow


BlueDev Studios


[edited by - BlueDev on June 4, 2004 1:51:02 PM]
That did it. Thanks all.

new working code (for anyone else curious)

m_hWnd = CreateWindow(
TEXT("EventWindow"),
TEXT("Video Window"),
WS_EX_TOPMOST | WS_POPUP | WS_VISIBLE,
CW_USEDEFAULT, // right boundary x
CW_USEDEFAULT, // top boundary y
GetSystemMetrics(SM_CXSCREEN), // width
GetSystemMetrics(SM_CYSCREEN), // height
NULL,
NULL,
m_hInstance,
NULL);

Share this post


Link to post
Share on other sites
quote:
Original post by imposterrific
That did it. Thanks all.

new working code (for anyone else curious)

m_hWnd = CreateWindow(
TEXT("EventWindow"),
TEXT("Video Window"),
WS_EX_TOPMOST | WS_POPUP | WS_VISIBLE,
CW_USEDEFAULT, // right boundary x
CW_USEDEFAULT, // top boundary y
GetSystemMetrics(SM_CXSCREEN), // width
GetSystemMetrics(SM_CYSCREEN), // height
NULL,
NULL,
m_hInstance,
NULL);



Excuse me dude, but the WS_EX_TOPMOST flag is in the wrong place and the wrong function. WS_EX_TOPMOST is an ‘Ex’ style flag. Please, use CreateWindowEx instead. Example below:


CreateWindowEx(
WS_EX_TOPMOST,
TEXT( “EvenWindow” ),
TEXT( “Video Window” ),
GetSystemMetrics( SM_CXSCREEN ),
GetSystemMetrics( SM_CYSCREEN ),
NULL,
NULL,
m_hInstance,
NULL );


// EDIT: I'm a Win32 junky


[edited by - sakky on June 4, 2004 11:54:20 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!