Solved

Writing to the entire screen in GDI

Posted on 2001-08-05
4
318 Views
Last Modified: 2012-05-04
I use the windows GDI routines (GetDC(), ...) to put grafix in a my program's window.
However, I want to write to the entire screen (full screen mode, where the only the content of the window is showing, no status bar and no window borders etc.)

I tried using GetDCEx(NULL, NULL, DCX_WINDOW) but it returns me NULL and GetLastError() returns 0.

How do I switch to full screen mode?
0
Comment
Question by:mathought
  • 3
4 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 100 total points
ID: 6353549
Try using GetDC(NULL) instead.  That always works form me.

>> How do I switch to full screen mode?
There is no such thing.
0
 
LVL 22

Expert Comment

by:nietod
ID: 6353568
Usually if you want to draw to the full screen, you must size your window to the dimensions of the full screen.  You can do this with

int ScnWdt = GetSystemMetrics(SM_CXSCREEN);
int ScnHgt = GetSystemMetrics(SM_CYSCREEN);

MoveWindow(WindowHandle,0,0ScnWdt,ScnHgt,true);

This will move your window to fill the screen.  If you usually have borders on your window and don't want them to show when taking up the whole screen, you either need to handle WM_NCCALCSIZE to rmeove the borders when using the full screen, so your client area fills the entire window, which in turn fills the entire screen.  Or you can use AdjustWindowRect() to figure out what size window rectangle you need in order to produce a client area that fills the screen.

You also might consider wha tyou want to do when the users has multiple monitors....
0
 

Author Comment

by:mathought
ID: 6354857
Thanks!
I should have guessed that.
Why isn't it documented?...
0
 
LVL 22

Expert Comment

by:nietod
ID: 6355322
Why isn't what documented?   I don't know of anything in that answer that is not documented.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question